28 nassertv(!pos.is_nan());
36 set_position(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
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());
84 set_velocity(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
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;
get_oriented
See set_oriented().
get_active
Process Flag Query.
get_position
Position Query.
get_velocity
Velocity Query per second.
get_last_position
Get the position of the physics object at the start of the most recent do_physics.
set_active
Process Flag assignment.
void add_local_torque(const LRotation &torque)
Adds an torque force (i.e.
set_rotation
set rotation as a quaternion delta per second.
void add_local_impulse(const LVector3 &impulse)
Adds an impulse force (i.e.
set_velocity
Vector velocity assignment.
set_last_position
Last position assignment.
set_mass
Set the mass in slugs (or kilograms).
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...
get_terminal_velocity
tv query
void reset_orientation(const LOrientation &orientation)
set the orientation while clearing the rotation velocity.
get_rotation
get rotation per second.
void add_torque(const LRotation &torque)
Adds an torque force (i.e.
get_orientation
get current orientation.
set_terminal_velocity
tv assignment
void add_impulse(const LVector3 &impulse)
Adds an impulse force (i.e.
get_implicit_velocity
Velocity Query over the last dt.
set_position
Vector position assignment.
set_oriented
Set flag to determine whether this object should do any rotation or orientation calculations.
get_mass
Get the mass in slugs (or kilograms).