This commit is contained in:
Dave Schuyler 2003-08-06 02:56:29 +00:00
parent a24f21767f
commit 2414326258

View File

@ -19,7 +19,7 @@
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : set_mass // Function : set_mass
// Access : Public // Access : Public
// Description : Specify the mass of the object // Description : Set the mass in slugs (or kilograms).
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE void PhysicsObject:: INLINE void PhysicsObject::
set_mass(float m) { set_mass(float m) {
@ -51,7 +51,7 @@ set_position(float x, float y, float z) {
// Access : Public // Access : Public
// Description : use this to place an object in a completely new // Description : use this to place an object in a completely new
// position, that has nothing to do with its last // position, that has nothing to do with its last
// position // position.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE void PhysicsObject:: INLINE void PhysicsObject::
reset_position(const LPoint3f &pos) { reset_position(const LPoint3f &pos) {
@ -105,7 +105,10 @@ set_velocity(float x, float y, float z) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : add_impulse // Function : add_impulse
// Access : Public // Access : Public
// Description : Adds an impulse force. // Description : Adds an impulse force (i.e. an instantanious change
// in velocity). This is a quicker way to get the
// velocity, add a vector to it and set that value to
// be the new velocity.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE void PhysicsObject:: INLINE void PhysicsObject::
add_impulse(const LVector3f &impulse) { add_impulse(const LVector3f &impulse) {
@ -135,7 +138,7 @@ set_terminal_velocity(float tv) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : get_mass // Function : get_mass
// Access : Public // Access : Public
// Description : Mass Query // Description : Get the mass in slugs (or kilograms).
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE float PhysicsObject:: INLINE float PhysicsObject::
get_mass() const { get_mass() const {
@ -155,7 +158,8 @@ get_position() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : get_last_position // Function : get_last_position
// Access : Public // Access : Public
// Description : Last position Query // Description : Get the position of the physics object at the start
// of the most recent do_physics.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE LPoint3f PhysicsObject:: INLINE LPoint3f PhysicsObject::
get_last_position() const { get_last_position() const {
@ -165,7 +169,7 @@ get_last_position() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : get_velocity // Function : get_velocity
// Access : Public // Access : Public
// Description : Velocity Query // Description : Velocity Query per second
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE LVector3f PhysicsObject:: INLINE LVector3f PhysicsObject::
get_velocity() const { get_velocity() const {
@ -175,7 +179,7 @@ get_velocity() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : get_implicit_velocity // Function : get_implicit_velocity
// Access : Public // Access : Public
// Description : Velocity Query // Description : Velocity Query over the last dt
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE LVector3f PhysicsObject:: INLINE LVector3f PhysicsObject::
get_implicit_velocity() const { get_implicit_velocity() const {
@ -215,7 +219,7 @@ set_orientation(const LOrientationf &orientation) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : set_rotation // Function : set_rotation
// Access : Public // Access : Public
// Description : // Description : set rotation on each axis per second.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE void PhysicsObject:: INLINE void PhysicsObject::
set_rotation(const LVector3f &rotation) { set_rotation(const LVector3f &rotation) {
@ -225,7 +229,7 @@ set_rotation(const LVector3f &rotation) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : get_orientation // Function : get_orientation
// Access : Public // Access : Public
// Description : // Description : get current orientation.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE LOrientationf PhysicsObject:: INLINE LOrientationf PhysicsObject::
get_orientation() const { get_orientation() const {
@ -235,7 +239,7 @@ get_orientation() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : get_rotation // Function : get_rotation
// Access : Public // Access : Public
// Description : // Description : get rotation per second.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE LVector3f PhysicsObject:: INLINE LVector3f PhysicsObject::
get_rotation() const { get_rotation() const {
@ -245,7 +249,8 @@ get_rotation() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : set_oriented // Function : set_oriented
// Access : Public // Access : Public
// Description : // Description : Set flag to determine whether this object should do
// any rotation or orientation calculations. Optimization.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE void PhysicsObject:: INLINE void PhysicsObject::
set_oriented(bool flag) { set_oriented(bool flag) {
@ -255,7 +260,7 @@ set_oriented(bool flag) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function : get_oriented // Function : get_oriented
// Access : Public // Access : Public
// Description : // Description : See set_oriented().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE bool PhysicsObject:: INLINE bool PhysicsObject::
get_oriented() const { get_oriented() const {