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