45 nassertv(!
LPoint3(x, y, z).is_nan());
46 _position.set(x, y, z);
61 _velocity.set(0.0f, 0.0f, 0.0f);
72 nassertv(!orientation.
is_nan());
73 _orientation = orientation;
105 nassertv(!
LVector3(x, y, z).is_nan());
106 _velocity.set(x, y, z);
119 nassertv(!torque.
is_nan());
120 _rotation+=_orientation.
xform(torque);
133 nassertv(!impulse.
is_nan());
134 _velocity += _orientation.
xform(impulse);
147 nassertv(!torque.
is_nan());
161 nassertv(!impulse.
is_nan());
182 _terminal_velocity = tv;
213 return _last_position;
233 return _position-_last_position;
253 return _terminal_velocity;
261 INLINE
void PhysicsObject::
263 nassertv(!orientation.
is_nan());
264 _orientation = orientation;
274 nassertv(!rotation.
is_nan());
275 _rotation = rotation;
static const LQuaternionf & ident_quat()
Returns an identity quaternion.
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...
This is a unit quaternion representing a rotation.
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.
This is a unit quaternion representing an orientation.
void set_velocity(const LVector3 &vel)
Vector velocity assignment.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
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.
LVecBase3f xform(const LVecBase3f &v) const
Transforms a 3-d vector by the indicated rotation.
LVector3 get_implicit_velocity() const
Velocity Query over the last dt.
void set_mass(PN_stdfloat)
Set the mass in slugs (or kilograms).
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
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.