Panda3D
cConstrainPosHprInterval.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file cConstrainPosHprInterval.h
10  * @author pratt
11  * @date 2008-03-10
12  */
13 
14 #ifndef CCONSTRAINPOSHPRINTERVAL_H
15 #define CCONSTRAINPOSHPRINTERVAL_H
16 
17 #include "directbase.h"
18 #include "cConstraintInterval.h"
19 #include "nodePath.h"
20 #include "lvecBase3.h"
21 #include "lquaternion.h"
22 
23 /**
24  * A constraint interval that will constrain the position and orientation of
25  * one node to the position and orientation of another.
26  */
27 class EXPCL_DIRECT_INTERVAL CConstrainPosHprInterval : public CConstraintInterval {
28 PUBLISHED:
29  explicit CConstrainPosHprInterval(const std::string &name, double duration,
30  const NodePath &node, const NodePath &target,
31  bool wrt, const LVecBase3 posOffset=LVector3::zero(),
32  const LVecBase3 hprOffset=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(std::ostream &out) const;
39 
40 private:
41  NodePath _node;
42  NodePath _target;
43  bool _wrt;
44  LVecBase3 _posOffset;
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, "CConstrainPosHprInterval",
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 
66 
67 #endif
nodePath.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lvecBase3.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cConstraintInterval.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
directbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:159
CInterval::priv_step
virtual void priv_step(double t)
Advances the time on the interval.
Definition: cInterval.cxx:357
CConstraintInterval
The base class for a family of intervals that constrain some property to a value over time.
Definition: cConstraintInterval.h:24
cConstrainPosHprInterval.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CConstrainPosHprInterval
A constraint interval that will constrain the position and orientation of one node to the position an...
Definition: cConstrainPosHprInterval.h:27
lquaternion.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.