28 nassertv(!pos.is_nan());
37 nassertv(!LPoint3(x, y, z).is_nan());
38 _position.set(x, y, z);
47 nassertv(!pos.is_nan());
50 _velocity.set(0.0f, 0.0f, 0.0f);
58 nassertv(!orientation.is_nan());
59 _orientation = orientation;
60 _rotation = LRotation::ident_quat();
76 nassertv(!vel.is_nan());
85 nassertv(!LVector3(x, y, z).is_nan());
86 _velocity.set(x, y, z);
96 nassertv(!torque.is_nan());
97 _rotation+=_orientation.xform(torque);
107 nassertv(!impulse.is_nan());
108 _velocity += _orientation.xform(impulse);
118 nassertv(!torque.is_nan());
129 nassertv(!impulse.is_nan());
146 _terminal_velocity = tv;
171 return _last_position;
187 return _position-_last_position;
203 return _terminal_velocity;
209 INLINE
void PhysicsObject::
210 set_orientation(
const LOrientation &orientation) {
211 nassertv(!orientation.is_nan());
212 _orientation = orientation;
220 nassertv(!rotation.is_nan());
221 _rotation = rotation;
PN_stdfloat get_terminal_velocity() const
tv query
LPoint3 get_last_position() const
Get the position of the physics object at the start of the most recent do_physics.
LOrientation get_orientation() const
get current orientation.
void reset_position(const LPoint3 &pos)
use this to place an object in a completely new position, that has nothing to do with its last positi...
void add_impulse(const LVector3 &impulse)
Adds an impulse force (i.e.
void set_position(const LPoint3 &pos)
Vector position assignment.
void add_local_torque(const LRotation &torque)
Adds an torque force (i.e.
bool get_active() const
Process Flag Query.
void set_velocity(const LVector3 &vel)
Vector velocity assignment.
PN_stdfloat get_mass() const
Get the mass in slugs (or kilograms).
bool get_oriented() const
See set_oriented().
void set_active(bool flag)
Process Flag assignment.
void add_local_impulse(const LVector3 &impulse)
Adds an impulse force (i.e.
LRotation get_rotation() const
get rotation per second.
void set_last_position(const LPoint3 &pos)
Last position assignment.
void add_torque(const LRotation &torque)
Adds an torque force (i.e.
void reset_orientation(const LOrientation &orientation)
set the orientation while clearing the rotation velocity.
LVector3 get_velocity() const
Velocity Query per second.
LVector3 get_implicit_velocity() const
Velocity Query over the last dt.
void set_mass(PN_stdfloat)
Set the mass in slugs (or kilograms).
LPoint3 get_position() const
Position Query.
void set_rotation(const LRotation &rotation)
set rotation as a quaternion delta per second.
void set_terminal_velocity(PN_stdfloat tv)
tv assignment
void set_oriented(bool flag)
Set flag to determine whether this object should do any rotation or orientation calculations.