#include <physicsObject.h>
Inheritance diagram for PhysicsObject:
Public Member Functions | |
PhysicsObject (void) | |
Default Constructor. | |
PhysicsObject (const PhysicsObject ©) | |
copy constructor | |
virtual | ~PhysicsObject (void) |
Destructor. | |
const PhysicsObject & | operator= (const PhysicsObject &other) |
void | set_mass (float) |
Specify the mass of the object. | |
float | get_mass (void) const |
Mass Query. | |
void | set_position (const LPoint3f &pos) |
Vector position assignment. | |
void | set_position (float x, float y, float z) |
Piecewise position assignment. | |
LPoint3f | get_position (void) const |
Position Query. | |
void | set_position_HandOfGod (const LPoint3f &pos) |
use this to place an object in a completely new position, that has nothing to do with its last position (moved by the Hand Of God, or "HOG") | |
void | set_last_position (const LPoint3f &pos) |
Last position assignment. | |
LPoint3f | get_last_position (void) const |
Last position Query. | |
void | set_velocity (const LVector3f &vel) |
Vector velocity assignment. | |
void | set_velocity (float x, float y, float z) |
Piecewise velocity assignment. | |
LVector3f | get_velocity (void) const |
Velocity Query. | |
void | set_active (bool flag) |
Process Flag assignment. | |
bool | get_active (void) const |
Process Flag Query. | |
void | set_oriented (bool flag) |
bool | get_oriented (void) const |
void | set_terminal_velocity (float tv) |
tv assignment | |
float | get_terminal_velocity (void) const |
tv query | |
void | set_orientation (const LOrientationf &orientation) |
LOrientationf | get_orientation (void) const |
void | set_rotation (const LVector3f &rotation) |
LVector3f | get_rotation (void) const |
virtual LMatrix4f | get_inertial_tensor (void) const |
returns a transform matrix that represents the object's willingness to be forced. | |
virtual LMatrix4f | get_lcs (void) const |
returns a transform matrix to this object's local coordinate system. | |
virtual PhysicsObject * | make_copy (void) const |
dynamic copy. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
int | get_ref_count () const |
Returns the current reference count. | |
int | ref () const |
Explicitly increments the reference count. | |
int | unref () const |
Explicitly decrements the reference count. | |
void | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Static Public Attributes | |
const float | _default_terminal_velocity |
Private Attributes | |
LPoint3f | _position |
LPoint3f | _last_position |
LVector3f | _velocity |
LOrientationf | _orientation |
LVector3f | _rotation |
float | _terminal_velocity |
float | _mass |
bool | _process_me |
bool | _oriented |
Static Private Attributes | |
TypeHandle | _type_handle |
If you're looking to add physical motion to your class, do NOT derive from this. Derive from Physical instead.
Definition at line 40 of file physicsObject.h.
|
Default Constructor.
Definition at line 35 of file physicsObject.cxx. References _last_position, _orientation, _position, _rotation, and _velocity. Referenced by operator=(). |
|
copy constructor
Definition at line 57 of file physicsObject.cxx. |
|
Destructor.
Definition at line 70 of file physicsObject.cxx. References _last_position, _orientation, _oriented, _position, _rotation, _terminal_velocity, and _velocity. |
|
Reimplemented from TypedReferenceCount. Definition at line 112 of file physicsObject.h. |
|
Process Flag Query.
Definition at line 205 of file physicsObject.I. |
|
Reimplemented from TypedReferenceCount. Definition at line 101 of file physicsObject.h. References TypedReferenceCount::get_class_type(). |
|
returns a transform matrix that represents the object's willingness to be forced.
Definition at line 139 of file physicsObject.cxx. |
|
Last position Query.
Definition at line 179 of file physicsObject.I. References _orientation. |
|
returns a transform matrix to this object's local coordinate system.
Definition at line 119 of file physicsObject.cxx. |
|
Mass Query.
Definition at line 153 of file physicsObject.I. References _process_me, and INLINE. |
|
Definition at line 254 of file physicsObject.I. |
|
Definition at line 290 of file physicsObject.I. Referenced by ActorNode::update_transform(). |
|
Position Query.
Definition at line 166 of file physicsObject.I. References _terminal_velocity, and INLINE. Referenced by GeomParticleRenderer::kill_particle(), LinearNoiseForce::~LinearNoiseForce(), LinearSinkForce::~LinearSinkForce(), and LinearSourceForce::~LinearSourceForce(). |
|
Returns the current reference count.
Definition at line 183 of file referenceCount.I. Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture(). |
|
Definition at line 266 of file physicsObject.I. |
|
tv query
Definition at line 218 of file physicsObject.I. References _oriented. |
|
Reimplemented from TypedReferenceCount. Definition at line 109 of file physicsObject.h. |
|
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). Definition at line 71 of file typedObject.I. References TypeHandle::get_name(), TypedObject::get_type(), and INLINE. |
|
Velocity Query.
Definition at line 192 of file physicsObject.I. References _orientation, and INLINE. Referenced by LinearFrictionForce::~LinearFrictionForce(). |
|
Reimplemented from TypedReferenceCount. Definition at line 104 of file physicsObject.h. References TypedReferenceCount::get_class_type(), and TypedReferenceCount::init_type(). |
|
Returns true if the current object is the indicated type exactly.
Definition at line 101 of file typedObject.I. Referenced by PT(), and CollisionNode::xform(). |
|
|
dynamic copy.
Reimplemented in BaseParticle, OrientedParticle, PointParticle, and ZSpinParticle. Definition at line 104 of file physicsObject.cxx. |
|
Definition at line 81 of file physicsObject.cxx. References PhysicsObject(). |
|
Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 225 of file referenceCount.I. Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering(). |
|
Process Flag assignment.
Definition at line 127 of file physicsObject.I. |
|
Last position assignment.
Definition at line 88 of file physicsObject.I. |
|
Specify the mass of the object.
Definition at line 31 of file physicsObject.I. |
|
Definition at line 230 of file physicsObject.I. Referenced by ActorNode::update_transform(). |
|
Definition at line 278 of file physicsObject.I. Referenced by PointParticle::PointParticle(). |
|
Piecewise position assignment.
Definition at line 57 of file physicsObject.I. References _last_position, and _position. |
|
Vector position assignment.
Definition at line 44 of file physicsObject.I. References _position, INLINE, x, and y. Referenced by ActorNode::update_transform(). |
|
use this to place an object in a completely new position, that has nothing to do with its last position (moved by the Hand Of God, or "HOG")
Definition at line 74 of file physicsObject.I. |
|
Definition at line 242 of file physicsObject.I. |
|
tv assignment
Definition at line 140 of file physicsObject.I. |
|
Piecewise velocity assignment.
Definition at line 114 of file physicsObject.I. |
|
Vector velocity assignment.
Definition at line 101 of file physicsObject.I. References _terminal_velocity, and INLINE. |
|
Does some easy checks to make sure that the reference count isn't completely bogus.
Definition at line 328 of file referenceCount.I. References INLINE. Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount(). |
|
Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 293 of file referenceCount.I. References INLINE. Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds(). |
|
Initial value:
config_physics.GetFloat("default_terminal_velocity", 400.0f)
Definition at line 51 of file config_physics.cxx. |
|
Reimplemented in BaseParticle. Definition at line 44 of file physicsObject.h. Referenced by PhysicsObject(), set_position(), and ~PhysicsObject(). |
|
Definition at line 52 of file physicsObject.h. Referenced by set_velocity(). |
|
Definition at line 48 of file physicsObject.h. Referenced by get_last_position(), get_velocity(), PhysicsObject(), and ~PhysicsObject(). |
|
Definition at line 55 of file physicsObject.h. Referenced by get_terminal_velocity(), and ~PhysicsObject(). |
|
Definition at line 43 of file physicsObject.h. Referenced by PhysicsObject(), set_active(), set_mass(), set_position(), and ~PhysicsObject(). |
|
Definition at line 54 of file physicsObject.h. Referenced by get_mass(). |
|
Definition at line 49 of file physicsObject.h. Referenced by get_active(), PhysicsObject(), and ~PhysicsObject(). |
|
Definition at line 51 of file physicsObject.h. Referenced by get_position(), set_velocity(), and ~PhysicsObject(). |
|
Reimplemented from TypedReferenceCount. Definition at line 24 of file physicsObject.cxx. |
|
Definition at line 45 of file physicsObject.h. Referenced by PhysicsObject(), set_last_position(), set_position_HandOfGod(), and ~PhysicsObject(). |