| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- // Filename: physics_object.I
- // Created by: charles (13Jun00)
- //
- ////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////
- // Function : set_mass
- // Access : Public
- // Description : Specify the mass of the object
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_mass(float m) {
- _mass = m;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_position
- // Access : Public
- // Description : Vector position assignment
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_position(const LPoint3f& pos) {
- _position = pos;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_position
- // Access : Public
- // Description : Piecewise position assignment
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_position(float x, float y, float z) {
- _position.set(x, y, z);
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_position_HandOfGod
- // Access : Public
- // Description : 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")
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_position_HandOfGod(const LPoint3f &pos) {
- _position = pos;
- _last_position = pos;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_last_position
- // Access : Public
- // Description : Last position assignment
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_last_position(const LPoint3f& pos) {
- _last_position = pos;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_velocity
- // Access : Public
- // Description : Vector velocity assignment
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_velocity(const LVector3f& vel) {
- _velocity = vel;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_velocity
- // Access : Public
- // Description : Piecewise velocity assignment
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_velocity(float x, float y, float z) {
- _velocity.set(x, y, z);
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_active
- // Access : Public
- // Description : Process Flag assignment
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_active(bool flag) {
- _process_me = flag;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_terminal_velocity
- // Access : Public
- // Description : tv assignment
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_terminal_velocity(float tv) {
- _terminal_velocity = tv;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_mass
- // Access : Public
- // Description : Mass Query
- ////////////////////////////////////////////////////////////////////
- INLINE float PhysicsObject::
- get_mass(void) const {
- return _mass;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_position
- // Access : Public
- // Description : Position Query
- ////////////////////////////////////////////////////////////////////
- INLINE LPoint3f PhysicsObject::
- get_position(void) const {
- return _position;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_last_position
- // Access : Public
- // Description : Last position Query
- ////////////////////////////////////////////////////////////////////
- INLINE LPoint3f PhysicsObject::
- get_last_position(void) const {
- return _last_position;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_velocity
- // Access : Public
- // Description : Velocity Query
- ////////////////////////////////////////////////////////////////////
- INLINE LVector3f PhysicsObject::
- get_velocity(void) const {
- return _velocity;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_active
- // Access : Public
- // Description : Process Flag Query
- ////////////////////////////////////////////////////////////////////
- INLINE bool PhysicsObject::
- get_active(void) const {
- return _process_me;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_terminal_velocity
- // Access : Public
- // Description : tv query
- ////////////////////////////////////////////////////////////////////
- INLINE float PhysicsObject::
- get_terminal_velocity(void) const {
- return _terminal_velocity;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_orientation
- // Access : Public
- // Description :
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_orientation(const LOrientationf &orientation) {
- _orientation = orientation;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_rotation
- // Access : Public
- // Description :
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_rotation(const LVector3f &rotation) {
- _rotation = rotation;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_orientation
- // Access : Public
- // Description :
- ////////////////////////////////////////////////////////////////////
- INLINE LOrientationf PhysicsObject::
- get_orientation(void) const {
- return _orientation;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_rotation
- // Access : Public
- // Description :
- ////////////////////////////////////////////////////////////////////
- INLINE LVector3f PhysicsObject::
- get_rotation(void) const {
- return _rotation;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : set_oriented
- // Access : Public
- // Description :
- ////////////////////////////////////////////////////////////////////
- INLINE void PhysicsObject::
- set_oriented(bool flag) {
- _oriented = flag;
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_oriented
- // Access : Public
- // Description :
- ////////////////////////////////////////////////////////////////////
- INLINE bool PhysicsObject::
- get_oriented(void) const {
- return _oriented;
- }
|