OpenMW
Public Member Functions | Private Member Functions | Private Attributes
OEngine::Physic::PhysicActor Class Reference

#include <physic.hpp>

List of all members.

Public Member Functions

 PhysicActor (const std::string &name, const std::string &mesh, PhysicEngine *engine, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, float scale)
 ~PhysicActor ()
void setPosition (const Ogre::Vector3 &pos)
void setRotation (const Ogre::Quaternion &quat)
void enableCollisions (bool collision)
bool getCollisionMode () const
Ogre::Vector3 getPosition ()
Ogre::Quaternion getRotation ()
void setScale (float scale)
Ogre::Vector3 getHalfExtents () const
void setInertialForce (const Ogre::Vector3 &force)
const Ogre::Vector3 & getInertialForce () const
void setOnGround (bool grounded)
bool getOnGround () const
btCollisionObject * getCollisionBody () const

Private Member Functions

void disableCollisionBody ()
void enableCollisionBody ()

Private Attributes

OEngine::Physic::RigidBodymBody
OEngine::Physic::RigidBodymRaycastingBody
Ogre::Vector3 mBoxScaledTranslation
Ogre::Quaternion mBoxRotation
btQuaternion mBoxRotationInverse
Ogre::Vector3 mForce
bool mOnGround
bool mCollisionMode
std::string mMesh
std::string mName
PhysicEnginemEngine

Detailed Description

A physic actor uses a rigid body based on box shapes. Pmove is used to move the physic actor around the dynamic world.


Constructor & Destructor Documentation

OEngine::Physic::PhysicActor::PhysicActor ( const std::string &  name,
const std::string &  mesh,
PhysicEngine engine,
const Ogre::Vector3 &  position,
const Ogre::Quaternion &  rotation,
float  scale 
)

Member Function Documentation

btCollisionObject* OEngine::Physic::PhysicActor::getCollisionBody ( ) const [inline]

Returns the half extents for this PhysiActor

const Ogre::Vector3& OEngine::Physic::PhysicActor::getInertialForce ( ) const [inline]

Gets the current amount of inertial force (incl. gravity) affecting this physic actor

This returns the visual position of the PhysicActor (used to position a scenenode). Note - this is different from the position of the contained mBody.

Returns the visual orientation of the PhysicActor

void OEngine::Physic::PhysicActor::setInertialForce ( const Ogre::Vector3 &  force)

Sets the current amount of inertial force (incl. gravity) affecting this physic actor

void OEngine::Physic::PhysicActor::setPosition ( const Ogre::Vector3 &  pos)
void OEngine::Physic::PhysicActor::setRotation ( const Ogre::Quaternion &  quat)

This adjusts the rotation of a PhysicActor If we have any problems with this (getting stuck in pmove) we should change it from setting the visual orientation to setting the orientation of the rigid body directly.

Sets the scale of the PhysicActor


Member Data Documentation

Ogre::Quaternion OEngine::Physic::PhysicActor::mBoxRotation [private]
Ogre::Vector3 OEngine::Physic::PhysicActor::mForce [private]
std::string OEngine::Physic::PhysicActor::mMesh [private]
std::string OEngine::Physic::PhysicActor::mName [private]

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