Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
physics::Body Class Reference

#include <Body.h>

Inheritance diagram for physics::Body:
scene::Node engine::Object

List of all members.

Public Member Functions

virtual void applyAngularImpulse (const core::vector3d &angularImpulse)
virtual void applyForce (const core::vector3d &force)
virtual void applyLinearImpulse (const core::vector3d &linearImpulse)
virtual void applyTorque (const core::vector3d &torque)
 Body (const std::string &name, BodyData *bodyData)
 Body (BodyData *bodyData)
f32 getAngularDamping () const
 Returns the amount of angular damping on this body.
const core::vector3d getAngularVelocity ()
 Gets the angular velocity of the body.
BodyDatagetBodyData () const
BodyType getBodyType ()
f32 getLinearDamping () const
 Returns the amount of linear damping on this body.
const core::vector3d getLinearVelocity ()
 Gets the linear velocity of the body.
f32 getMass () const
 Returns the mass.
MaterialgetMaterial () const
f32 getSleepiness () const
 Returns the body's sleepiness level.
bool isEnabled () const
 Returns true if the Solid is enabled.
bool isSleeping () const
 Returns true if the Solid is sleeping.
void setAngularDamping (f32 angularDamping)
 Sets the amount of angular damping on this body.
void setAngularVelocity (const core::vector3d &velocity)
 Sets the angular velocity of the body.
void setBodyData (const std::string &filename)
 Sets the body data this body will use.
void setBodyData (BodyData *bodyData)
void setBodyType (BodyType type)
virtual void setEnabled (bool enabled)
 Sets whether the Solid can collide with other Solids and be physically simulated.
void setLinearDamping (f32 linearDamping)
 Sets the amount of linear damping on this body.
void setLinearVelocity (const core::vector3d &velocity)
 Sets the linear velocity of the body.
void setMass (f32 mass)
 Sets the mass.
virtual void setMaterial (Material *material)
virtual void setMaterial (const std::string &filename)
 Sets the name of the material which this body will use.
void setSleepiness (f32 sleepiness)
 Sets the Solid's sleepiness level.
void setSleeping (bool sleeping)
 Sets whether the body is sleeping.
virtual ~Body ()

Protected Member Functions

void copyProperties ()
virtual void initializeImpl ()
void initProperties ()
virtual void updateTransformImpl ()

Protected Attributes

f32 mAngularDamping
 The amount of damping applied to the body's angular motion.
core::vector3d mAngularImpulse
core::vector3d mAngularVelocity
 The body's angular velocity.
BodyDatamBodyData
BodyType mBodyType
 Determines what type the body is.
bool mEnabled
 Determines whether the body is enabled.
core::vector3d mForce
f32 mLinearDamping
 The amount of damping applied to the body's linear motion.
core::vector3d mLinearImpulse
core::vector3d mLinearVelocity
 The body's linear velocity in global coordinates.
f32 mMass
 The total mass of the body.
MaterialmMaterial
 The material this body uses.
f32 mSleepiness
 The body's sleepiness level which determines how fast falls asleep.
bool mSleeping
 Determines whether the body is sleeping.
core::vector3d mTorque

Static Protected Attributes

static u32 msNextGeneratedActorIndex = 0

Detailed Description

Defines an actor in the physics world. Author: Kat'Oun version: 1.0


Constructor & Destructor Documentation

physics::Body::Body ( BodyData bodyData)
physics::Body::Body ( const std::string &  name,
BodyData bodyData 
)
physics::Body::~Body ( ) [virtual]

Member Function Documentation

void physics::Body::applyAngularImpulse ( const core::vector3d angularImpulse) [virtual]

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

References mAngularImpulse, and scene::Node::mOrientation.

void physics::Body::applyForce ( const core::vector3d force) [virtual]

Applies a force to the body. This applies a force with the direction and strength represented by the input vector.

References mForce, and scene::Node::mOrientation.

void physics::Body::applyLinearImpulse ( const core::vector3d linearImpulse) [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.

References mLinearImpulse, and scene::Node::mOrientation.

void physics::Body::applyTorque ( const core::vector3d torque) [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.

References scene::Node::mOrientation, and mTorque.

void physics::Body::copyProperties ( ) [protected]
f32 physics::Body::getAngularDamping ( ) const

Returns the amount of angular damping on this body.

References mAngularDamping.

const core::vector3d physics::Body::getAngularVelocity ( )

Gets the angular velocity of the body.

References mAngularVelocity.

BodyData * physics::Body::getBodyData ( ) const

References mBodyData.

BodyType physics::Body::getBodyType ( )

References mBodyType.

f32 physics::Body::getLinearDamping ( ) const

Returns the amount of linear damping on this body.

References mLinearDamping.

const core::vector3d physics::Body::getLinearVelocity ( )

Gets the linear velocity of the body.

References mLinearVelocity.

f32 physics::Body::getMass ( ) const

Returns the mass.

References mMass.

Material * physics::Body::getMaterial ( ) const

References mMaterial.

f32 physics::Body::getSleepiness ( ) const

Returns the body's sleepiness level.

References mSleepiness.

void physics::Body::initializeImpl ( ) [protected, virtual]

Reimplemented from engine::Object.

References copyProperties().

void physics::Body::initProperties ( ) [protected]

Reimplemented from scene::Node.

References mAngularImpulse, mEnabled, mForce, mLinearImpulse, mTorque, and core::vector3d::ORIGIN_3D.

Referenced by Body().

bool physics::Body::isEnabled ( ) const

Returns true if the Solid is enabled.

References mEnabled.

bool physics::Body::isSleeping ( ) const

Returns true if the Solid is sleeping.

References mSleeping.

void physics::Body::setAngularDamping ( f32  angularDamping)

Sets the amount of angular damping on this body.

References mAngularDamping.

void physics::Body::setAngularVelocity ( const core::vector3d velocity)

Sets the angular velocity of the body.

References mAngularVelocity.

void physics::Body::setBodyData ( BodyData bodyData)
void physics::Body::setBodyData ( const std::string &  filename)
void physics::Body::setBodyType ( BodyType  type)

References mBodyType.

void physics::Body::setEnabled ( bool  enabled) [virtual]

Sets whether the Solid can collide with other Solids and be physically simulated.

References mEnabled.

void physics::Body::setLinearDamping ( f32  linearDamping)

Sets the amount of linear damping on this body.

References mLinearDamping.

void physics::Body::setLinearVelocity ( const core::vector3d velocity)

Sets the linear velocity of the body.

References mLinearVelocity.

void physics::Body::setMass ( f32  mass)

Sets the mass.

References mMass.

void physics::Body::setMaterial ( const std::string &  filename) [virtual]

Sets the name of the material which this body will use.

References physics::PhysicsManager::createMaterial(), physics::PhysicsManager::getInstance(), and mMaterial.

void physics::Body::setMaterial ( Material material) [virtual]

References mMaterial.

void physics::Body::setSleepiness ( f32  sleepiness)

Sets the Solid's sleepiness level.

References mSleepiness.

void physics::Body::setSleeping ( bool  sleeping)

Sets whether the body is sleeping.

References mSleeping.

void physics::Body::updateTransformImpl ( ) [protected, virtual]

Reimplemented from scene::Node.


Member Data Documentation

The amount of damping applied to the body's angular motion.

Referenced by copyProperties(), getAngularDamping(), and setAngularDamping().

The body's angular velocity.

Referenced by copyProperties(), getAngularVelocity(), and setAngularVelocity().

Determines what type the body is.

Referenced by copyProperties(), getBodyType(), and setBodyType().

bool physics::Body::mEnabled [protected]

Determines whether the body is enabled.

Referenced by initProperties(), isEnabled(), and setEnabled().

Referenced by applyForce(), and initProperties().

The amount of damping applied to the body's linear motion.

Referenced by copyProperties(), getLinearDamping(), and setLinearDamping().

The body's linear velocity in global coordinates.

Referenced by copyProperties(), getLinearVelocity(), and setLinearVelocity().

The total mass of the body.

Referenced by copyProperties(), getMass(), and setMass().

The material this body uses.

Referenced by copyProperties(), getMaterial(), and setMaterial().

The body's sleepiness level which determines how fast falls asleep.

Referenced by copyProperties(), getSleepiness(), and setSleepiness().

bool physics::Body::mSleeping [protected]

Determines whether the body is sleeping.

Referenced by copyProperties(), isSleeping(), and setSleeping().

Referenced by applyTorque(), and initProperties().


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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by Doxygen (1.7.4)