Panda3D
cConstrainHprInterval.h
1 // Filename: cConstrainHprInterval.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 CCONSTRAINHPRINTERVAL_H
16 #define CCONSTRAINHPRINTERVAL_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 : CConstrainHprInterval
26 // Description : A constraint interval that will constrain the
27 // orientation of one node to the orientation of another.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_DIRECT CConstrainHprInterval : public CConstraintInterval {
30 PUBLISHED:
31  CConstrainHprInterval(const string &name, double duration,
32  const NodePath &node, const NodePath &target,
33  bool wrt, const LVecBase3 hprOffset=LVector3::zero());
34 
35  INLINE const NodePath &get_node() const;
36  INLINE const NodePath &get_target() const;
37 
38  virtual void priv_step(double t);
39  virtual void output(ostream &out) const;
40 
41 private:
42  NodePath _node;
43  NodePath _target;
44  bool _wrt;
45  LQuaternion _quatOffset;
46 
47 public:
48  static TypeHandle get_class_type() {
49  return _type_handle;
50  }
51  static void init_type() {
52  CConstraintInterval::init_type();
53  register_type(_type_handle, "CConstrainHprInterval",
54  CConstraintInterval::get_class_type());
55  }
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60 
61 private:
62  static TypeHandle _type_handle;
63 };
64 
65 #include "cConstrainHprInterval.I"
66 
67 #endif
68 
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
A constraint interval that will constrain the orientation of one node to the orientation of another...
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