15 #include "actorNode.h" 16 #include "config_physics.h" 17 #include "physicsObject.h" 19 #include "transformState.h" 33 _mass_center = get_physical(0)->get_phys_body();
36 _mass_center->set_name(name);
38 _ok_to_callback =
true;
39 _transform_limit = 0.0;
51 _ok_to_callback =
true;
52 _mass_center = get_physical(0)->get_phys_body();
53 _transform_limit = copy._transform_limit;
77 _ok_to_callback =
false;
79 _ok_to_callback =
true;
90 test_transform(
const TransformState *ts)
const {
92 nassertv(pos[0] < _transform_limit);
93 nassertv(pos[0] > -_transform_limit);
94 nassertv(pos[1] < _transform_limit);
95 nassertv(pos[1] > -_transform_limit);
96 nassertv(pos[2] < _transform_limit);
97 nassertv(pos[2] > -_transform_limit);
109 transform_changed() {
110 PandaNode::transform_changed();
113 if (!_ok_to_callback) {
118 CPT(TransformState) transform = get_transform();
120 if (_transform_limit > 0.0) {
121 test_transform(transform);
126 _mass_center->set_orientation(transform->get_quat());
141 write(ostream &out,
unsigned int indent)
const {
143 out.width(indent); out<<
""; out<<
"ActorNode:\n";
144 out.width(indent+2); out<<
""; out<<
"_ok_to_callback "<<_ok_to_callback<<
"\n";
145 out.width(indent+2); out<<
""; out<<
"_mass_center\n";
146 _mass_center->
write(out, indent+4);
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
void set_position(const LPoint3 &pos)
Vector position assignment.
static const LVector3f & zero()
Returns a zero-length vector.
void update_transform()
this sets the transform generated by the contained Physical, moving the node and subsequent geometry...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool get_oriented() const
See set_oriented().
Graph node that encapsulated a series of physical objects.
virtual ~ActorNode()
destructor
void set_active(bool flag)
Process Flag assignment.
This is a 4-by-4 transform matrix.
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
Defines a set of physically modeled attributes.
ActorNode(const string &name="")
Constructor.
TypeHandle is the identifier used to differentiate C++ class types.
Like a physical node, but with a little more.
virtual LMatrix4 get_lcs() const
returns a transform matrix to this object's local coordinate system.
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Sets the transform that will be applied to this node and below.