28 _contact_vector = LVector3::zero();
30 _mass_center = get_physical(0)->get_phys_body();
31 _mass_center->set_active(
true);
33 _mass_center->set_name(name);
35 _ok_to_callback =
true;
36 _transform_limit = 0.0;
45 _contact_vector = LVector3::zero();
46 _ok_to_callback =
true;
47 _mass_center = get_physical(0)->get_phys_body();
48 _transform_limit = copy._transform_limit;
64 LMatrix4 lcs = _mass_center->get_lcs();
67 _ok_to_callback =
false;
69 _ok_to_callback =
true;
80 nassertv(pos[0] < _transform_limit);
81 nassertv(pos[0] > -_transform_limit);
82 nassertv(pos[1] < _transform_limit);
83 nassertv(pos[1] > -_transform_limit);
84 nassertv(pos[2] < _transform_limit);
85 nassertv(pos[2] > -_transform_limit);
95 PandaNode::transform_changed();
98 if (!_ok_to_callback) {
105 if (_transform_limit > 0.0) {
106 test_transform(transform);
110 if (_mass_center->get_oriented() ==
true) {
111 _mass_center->set_orientation(transform->get_quat());
115 _mass_center->set_position(transform->get_pos());
125 out.width(
indent); out<<
""; out<<
"ActorNode:\n";
126 out.width(
indent+2); out<<
""; out<<
"_ok_to_callback "<<_ok_to_callback<<
"\n";
127 out.width(
indent+2); out<<
""; out<<
"_mass_center\n";
128 _mass_center->write(out,
indent+4);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual ~ActorNode()
destructor
ActorNode(const std::string &name="")
Constructor.
void update_transform()
this sets the transform generated by the contained Physical, moving the node and subsequent geometry.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
set_transform
Sets the transform that will be applied to this node and below.
PhysicalNode(const std::string &name)
default constructor
void add_physical(Physical *physical)
Adds a Physical to this PhysicalNode.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Defines a set of physically modeled attributes.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.