Panda3D
cConstrainPosHprInterval.h
1 // Filename: cConstrainPosHprInterval.h
2 // Created by: pratt (10Mar08)
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 CCONSTRAINPOSHPRINTERVAL_H
16 #define CCONSTRAINPOSHPRINTERVAL_H
17 
18 #include "directbase.h"
19 #include "cConstraintInterval.h"
20 #include "nodePath.h"
21 #include "lvecBase3.h"
22 #include "lquaternion.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : CConstrainPosHprInterval
26 // Description : A constraint interval that will constrain the
27 // position and orientation of one node to the
28 // position and orientation of another.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_DIRECT CConstrainPosHprInterval : public CConstraintInterval {
31 PUBLISHED:
32  CConstrainPosHprInterval(const string &name, double duration,
33  const NodePath &node, const NodePath &target,
34  bool wrt, const LVecBase3 posOffset=LVector3::zero(),
35  const LVecBase3 hprOffset=LVector3::zero());
36 
37  INLINE const NodePath &get_node() const;
38  INLINE const NodePath &get_target() const;
39 
40  virtual void priv_step(double t);
41  virtual void output(ostream &out) const;
42 
43 private:
44  NodePath _node;
45  NodePath _target;
46  bool _wrt;
47  LVecBase3 _posOffset;
48  LQuaternion _quatOffset;
49 
50 public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  CConstraintInterval::init_type();
56  register_type(_type_handle, "CConstrainPosHprInterval",
57  CConstraintInterval::get_class_type());
58  }
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
63 
64 private:
65  static TypeHandle _type_handle;
66 };
67 
68 #include "cConstrainPosHprInterval.I"
69 
70 #endif
71 
A constraint interval that will constrain the position and orientation of one node to the position an...
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:270
The base class for a family of intervals that constrain some property to a value over time...
This is the base quaternion class.
Definition: lquaternion.h:96
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