palBody Class Reference

#include <palBodies.h>

Inheritance diagram for palBody:

palBodyBase palBox palCapsule palCompoundBody palConvex palGenericBody palSphere

List of all members.

Public Member Functions

void SetPosition (Float x, Float y, Float z)
virtual void SetPosition (palMatrix4x4 &location)
void SetPosition (Float x, Float y, Float z, Float roll, Float pitch, Float yaw)
void SetOrientation (Float roll, Float pitch, Float yaw)
virtual void ApplyForce (Float fx, Float fy, Float fz)
virtual void ApplyTorque (Float tx, Float ty, Float tz)
virtual void ApplyForceAtPosition (Float px, Float py, Float pz, Float fx, Float fy, Float fz)
virtual void ApplyImpulse (Float ix, Float iy, Float iz)
virtual void ApplyAngularImpulse (Float ix, Float iy, Float iz)
virtual void ApplyImpulseAtPosition (Float px, Float py, Float pz, Float ix, Float iy, Float iz)
virtual void GetLinearVelocity (palVector3 &velocity)=0
virtual void GetAngularVelocity (palVector3 &velocity_rad)=0
virtual void SetLinearVelocity (palVector3 velocity)=0
virtual void SetAngularVelocity (palVector3 velocity_rad)=0
virtual bool IsActive ()=0
virtual void SetActive (bool active)=0

Public Attributes

Float m_fMass
 The total mass of the body.


Detailed Description

The body class. A body represents a physical object in the physics engine. A body has location, mass (and inertia), and material properties. A body is usually accompianied by a geometry which represents the shape of the body.

Member Function Documentation

void palBody::ApplyAngularImpulse ( Float  ix,
Float  iy,
Float  iz 
) [virtual]

Applys an an angular impulse to the body. This will cause a change in the angular momentum, and subsequently a change in the angular velocity.

Parameters:
ix The impulse vector (x)
iy The impulse vector (y)
iz The impulse vector (z)

void palBody::ApplyForce ( Float  fx,
Float  fy,
Float  fz 
) [virtual]

Applies a force to the body. This applies a force with the direction and strength represented by the input vector. If you have a normalized vector, you will need to multiply it by the magnitude of the force to get the desired result. The force is only valid for a single update.

Parameters:
fx The force vector (x)
fy The force vector (y)
fz The force vector (z)

void palBody::ApplyForceAtPosition ( Float  px,
Float  py,
Float  pz,
Float  fx,
Float  fy,
Float  fz 
) [virtual]

Applies a force to the body, at a specified, global, position. This applies a force at a given position on the body, with the direction and strength represented by the input vector. This has the result of adding both a force and a torque to the body (ie: results in a spin on the object).

Parameters:
px The position (x)
py The position (y)
pz The position (z)
fx The force vector (x)
fy The force vector (y)
fz The force vector (z)

void palBody::ApplyImpulse ( Float  ix,
Float  iy,
Float  iz 
) [virtual]

Applys a linear impulse to the body. In classical physics, momentum is related to velocity by $p=m.v$ where p is the Momentum, m is the Mass, and v is the Velocity. An impulse is simply a change in momentum.

Parameters:
ix The impulse vector (x)
iy The impulse vector (y)
iz The impulse vector (z)

void palBody::ApplyImpulseAtPosition ( Float  px,
Float  py,
Float  pz,
Float  ix,
Float  iy,
Float  iz 
) [virtual]

Applys an impulse to the body at a specified, global, position.

Parameters:
px The position (x)
py The position (y)
pz The position (z)
ix The impulse vector (x)
iy The impulse vector (y)
iz The impulse vector (z)

void palBody::ApplyTorque ( Float  tx,
Float  ty,
Float  tz 
) [virtual]

Applies a torque on the body. In classical physics, torque is related to angular acceleration by $T=I.\alpha$ where T is the Torque, I is the moment of inertia, and $\alpha$ is angular acceleration. The torque is only valid for a single update.

virtual void palBody::GetAngularVelocity ( palVector3 &  velocity_rad  )  [pure virtual]

Gets the angular velocity of the body

virtual void palBody::GetLinearVelocity ( palVector3 &  velocity  )  [pure virtual]

Gets the linear velocity of the body

virtual bool palBody::IsActive (  )  [pure virtual]

Returns:
true if this body is active, ie not sleeping or frozen

virtual void palBody::SetActive ( bool  active  )  [pure virtual]

Sets the body as active or sleeping

virtual void palBody::SetAngularVelocity ( palVector3  velocity_rad  )  [pure virtual]

Sets the angular velocity of the body

virtual void palBody::SetLinearVelocity ( palVector3  velocity  )  [pure virtual]

Sets the linear velocity of the body

void palBody::SetOrientation ( Float  roll,
Float  pitch,
Float  yaw 
)

Sets the orientation of the body

Parameters:
roll The roll (rotation) about the x-axis of the body (CHECK!)
pitch The pitch (rotation) about the y-axis of the body (CHECK!)
yaw The yaw (rotation) about the z-axis of the body (CHECK!)

void palBody::SetPosition ( Float  x,
Float  y,
Float  z,
Float  roll,
Float  pitch,
Float  yaw 
)

Sets the position and orientation of the body

Parameters:
x The x-coordinate of the body (world)
y The y-coordinate of the body (world)
z The z-coordinate of the body (world)
roll The roll (rotation) about the x-axis of the body (CHECK!)
pitch The pitch (rotation) about the y-axis of the body (CHECK!)
yaw The yaw (rotation) about the z-axis of the body (CHECK!)

void palBody::SetPosition ( palMatrix4x4 &  location  )  [virtual]

Sets the orientation of the body via a 4x4 transformation matrix. The location matrix may not include scaleing properties

Parameters:
location The transformation matrix

Reimplemented from palBodyBase.

void palBody::SetPosition ( Float  x,
Float  y,
Float  z 
) [virtual]

Sets the position of the body

Parameters:
x The x-coordinate of the body (world)
y The y-coordinate of the body (world)
z The z-coordinate of the body (world)

Reimplemented from palBodyBase.


The documentation for this class was generated from the following files:

Generated on Mon Aug 31 13:58:02 2009 for pal by  doxygen 1.5.7.1