18TypeHandle CConstrainPosHprInterval::_type_handle;
32 bool wrt,
const LVecBase3 posOffset,
33 const LVecBase3 hprOffset) :
34 CConstraintInterval(name, duration),
40 _quatOffset.set_hpr(hprOffset);
50 check_started(get_class_type(),
"priv_step");
54 if(! _target.is_empty()) {
56 if(! _node.is_same_graph(_target)){
57 interval_cat.warning()
58 <<
"Unable to copy position and orientation in CConstrainPosHprInterval::priv_step;\n"
59 <<
"node (" << _node.get_name()
60 <<
") and target (" << _target.get_name()
61 <<
") are not in the same graph.\n";
64 _target.set_pos_quat(_node, _posOffset, _quatOffset);
66 _target.set_pos_quat(_node.get_pos() + _posOffset, _quatOffset*_node.get_quat());
74void CConstrainPosHprInterval::
75output(std::ostream &out)
const {
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CConstrainPosHprInterval(const std::string &name, double duration, const NodePath &node, const NodePath &target, bool wrt, const LVecBase3 posOffset=LVector3::zero(), const LVecBase3 hprOffset=LVector3::zero())
Constructs a constraint interval that will constrain the position and orientation of one node to the ...
virtual void priv_step(double t)
Advances the time on the interval.
get_name
Returns the interval's name.
get_duration
Returns the duration of the interval in seconds.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.