CrystalSpace

Public API Reference

CS::Physics::iPhysicalBody Struct Reference

A base interface of physical bodies. More...

#include <ivaria/physics.h>

Inheritance diagram for CS::Physics::iPhysicalBody:

List of all members.

Public Member Functions

virtual void AddForce (const csVector3 &force)=0
 Add a force to the whole body.
virtual bool Disable ()=0
 Disable this collision object.
virtual bool Enable ()=0
 Enable this collision object.
virtual PhysicalBodyType GetBodyType () const =0
 Get the body type of this physical body.
virtual float GetDensity () const =0
 Get the density of the body.
virtual float GetFriction ()=0
 Get the friction of this body.
virtual csVector3 GetLinearVelocity (size_t index=0) const =0
 Get the linear velocity (movement).
virtual float GetMass ()=0
 Get the mass of this body.
virtual float GetVolume ()=0
 Return the volume of this body.
virtual bool IsEnabled ()=0
 Check if the collision object is enabled.
virtual iRigidBodyQueryRigidBody ()=0
 Query the iRigidBody interface of this body.
virtual iSoftBodyQuerySoftBody ()=0
 Query the iSoftBody interface of this body.
virtual void SetDensity (float density)=0
 Set the density of this collider.
virtual void SetFriction (float friction)=0
 Set the friction of this body.
virtual void SetMass (float mass)=0
 Set the total mass of this body.

Detailed Description

A base interface of physical bodies.

iRigidBody and iSoftBody will be derived from this one.

Definition at line 90 of file physics.h.


Member Function Documentation

virtual void CS::Physics::iPhysicalBody::AddForce ( const csVector3 force  )  [pure virtual]

Add a force to the whole body.

virtual bool CS::Physics::iPhysicalBody::Disable (  )  [pure virtual]

Disable this collision object.

virtual bool CS::Physics::iPhysicalBody::Enable (  )  [pure virtual]

Enable this collision object.

virtual PhysicalBodyType CS::Physics::iPhysicalBody::GetBodyType (  )  const [pure virtual]

Get the body type of this physical body.

virtual float CS::Physics::iPhysicalBody::GetDensity (  )  const [pure virtual]

Get the density of the body.

virtual float CS::Physics::iPhysicalBody::GetFriction (  )  [pure virtual]

Get the friction of this body.

virtual csVector3 CS::Physics::iPhysicalBody::GetLinearVelocity ( size_t  index = 0  )  const [pure virtual]

Get the linear velocity (movement).

virtual float CS::Physics::iPhysicalBody::GetMass (  )  [pure virtual]

Get the mass of this body.

virtual float CS::Physics::iPhysicalBody::GetVolume (  )  [pure virtual]

Return the volume of this body.

virtual bool CS::Physics::iPhysicalBody::IsEnabled (  )  [pure virtual]

Check if the collision object is enabled.

virtual iRigidBody* CS::Physics::iPhysicalBody::QueryRigidBody (  )  [pure virtual]

Query the iRigidBody interface of this body.

It returns NULL if the interface is not valid, ie GetType() is not CS::Physics::BODY_RIGID.

virtual iSoftBody* CS::Physics::iPhysicalBody::QuerySoftBody (  )  [pure virtual]

Query the iSoftBody interface of this body.

It returns NULL if the interface is not valid, ie GetType() is not CS::Physics::BODY_SOFT.

virtual void CS::Physics::iPhysicalBody::SetDensity ( float  density  )  [pure virtual]

Set the density of this collider.

If the mass of the body was not defined then it will be computed from this. But iSoftBody must use SetMass instead.

You should be really careful when using densities because most of the game physics libraries do not work well when objects with large mass differences interact. It is safer to artificially keep the mass of moving objects in a safe range (from 1 to 100 kilogram for example).

virtual void CS::Physics::iPhysicalBody::SetFriction ( float  friction  )  [pure virtual]

Set the friction of this body.

[0,1] for soft body.

virtual void CS::Physics::iPhysicalBody::SetMass ( float  mass  )  [pure virtual]

Set the total mass of this body.


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1