Panda3D
cConstrainTransformInterval.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 cConstrainTransformInterval.h
10  * @author pratt
11  * @date 2006-09-29
12  */
13 
14 #ifndef CCONSTRAINTRANSFORMINTERVAL_H
15 #define CCONSTRAINTRANSFORMINTERVAL_H
16 
17 #include "directbase.h"
18 #include "cConstraintInterval.h"
19 #include "nodePath.h"
20 
21 /**
22  * A constraint interval that will constrain the transform of one node to the
23  * transform of another.
24  */
25 class EXPCL_DIRECT_INTERVAL CConstrainTransformInterval : public CConstraintInterval {
26 PUBLISHED:
27  explicit CConstrainTransformInterval(const std::string &name, double duration,
28  const NodePath &node,
29  const NodePath &target, bool wrt);
30 
31  INLINE const NodePath &get_node() const;
32  INLINE const NodePath &get_target() const;
33 
34  virtual void priv_step(double t);
35  virtual void output(std::ostream &out) const;
36 
37 private:
38  NodePath _node;
39  NodePath _target;
40  bool _wrt;
41 
42 public:
43  static TypeHandle get_class_type() {
44  return _type_handle;
45  }
46  static void init_type() {
47  CConstraintInterval::init_type();
48  register_type(_type_handle, "CConstrainTransformInterval",
49  CConstraintInterval::get_class_type());
50  }
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
61 
62 #endif
virtual void priv_step(double t)
Advances the time on the interval.
Definition: cInterval.cxx:357
A constraint interval that will constrain the transform of one node to the transform of another.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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
The base class for a family of intervals that constrain some property to a value over time.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.