Panda3D
 All Classes Functions Variables Enumerations
cConstrainPosInterval.h
1 // Filename: cConstrainPosInterval.h
2 // Created by: pratt (29Sep06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CCONSTRAINPOSINTERVAL_H
16 #define CCONSTRAINPOSINTERVAL_H
17 
18 #include "directbase.h"
19 #include "cConstraintInterval.h"
20 #include "nodePath.h"
21 #include "lvecBase3.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : CConstrainPosInterval
25 // Description : A constraint interval that will constrain the
26 // position of one node to the position of another.
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_DIRECT CConstrainPosInterval : public CConstraintInterval {
29 PUBLISHED:
30  CConstrainPosInterval(const string &name, double duration,
31  const NodePath &node, const NodePath &target,
32  bool wrt, const LVecBase3 posOffset=LVector3::zero());
33 
34  INLINE const NodePath &get_node() const;
35  INLINE const NodePath &get_target() const;
36 
37  virtual void priv_step(double t);
38  virtual void output(ostream &out) const;
39 
40 private:
41  NodePath _node;
42  NodePath _target;
43  bool _wrt;
44  LVecBase3 _posOffset;
45 
46 public:
47  static TypeHandle get_class_type() {
48  return _type_handle;
49  }
50  static void init_type() {
51  CConstraintInterval::init_type();
52  register_type(_type_handle, "CConstrainPosInterval",
53  CConstraintInterval::get_class_type());
54  }
55  virtual TypeHandle get_type() const {
56  return get_class_type();
57  }
58  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
59 
60 private:
61  static TypeHandle _type_handle;
62 };
63 
64 #include "cConstrainPosInterval.I"
65 
66 #endif
67 
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
virtual void priv_step(double t)
Advances the time on the interval.
Definition: cInterval.cxx:407
static const LVector3f & zero()
Returns a zero-length vector.
Definition: lvector3.h:269
The base class for a family of intervals that constrain some property to a value over time...
A constraint interval that will constrain the position of one node to the position of another...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165