OpenMW
Public Member Functions | Private Member Functions | Private Attributes
MWWorld::PhysicsSystem Class Reference

#include <physicssystem.hpp>

List of all members.

Public Member Functions

 PhysicsSystem (OEngine::Render::OgreRenderer &_rend)
 ~PhysicsSystem ()
void addObject (const MWWorld::Ptr &ptr, bool placeable=false)
void addActor (const MWWorld::Ptr &ptr)
void addHeightField (float *heights, int x, int y, float yoffset, float triSize, float sqrtVerts)
void removeHeightField (int x, int y)
void removeObject (const std::string &handle)
void moveObject (const MWWorld::Ptr &ptr)
void rotateObject (const MWWorld::Ptr &ptr)
void scaleObject (const MWWorld::Ptr &ptr)
bool toggleCollisionMode ()
std::vector< std::string > getCollisions (const MWWorld::Ptr &ptr)
 get handles this object collides with
Ogre::Vector3 traceDown (const MWWorld::Ptr &ptr)
std::pair< float, std::string > getFacedHandle (float queryDistance)
std::pair< std::string,
Ogre::Vector3 > 
getHitContact (const std::string &name, const Ogre::Vector3 &origin, const Ogre::Quaternion &orientation, float queryDistance)
std::vector< std::pair< float,
std::string > > 
getFacedHandles (float queryDistance)
std::vector< std::pair< float,
std::string > > 
getFacedHandles (float mouseX, float mouseY, float queryDistance)
bool castRay (const Ogre::Vector3 &from, const Ogre::Vector3 &to, bool raycastingObjectOnly=true, bool ignoreHeightMap=false)
std::pair< bool, Ogre::Vector3 > castRay (const Ogre::Vector3 &orig, const Ogre::Vector3 &dir, float len)
std::pair< bool, Ogre::Vector3 > castRay (float mouseX, float mouseY)
 cast ray from the mouse, return true if it hit something and the first result (in OGRE coordinates)
OEngine::Physic::PhysicEnginegetEngine ()
bool getObjectAABB (const MWWorld::Ptr &ptr, Ogre::Vector3 &min, Ogre::Vector3 &max)
void queueObjectMovement (const Ptr &ptr, const Ogre::Vector3 &velocity)
const PtrVelocityListapplyQueuedMovement (float dt)

Private Member Functions

 PhysicsSystem (const PhysicsSystem &)
PhysicsSystemoperator= (const PhysicsSystem &)

Private Attributes

OEngine::Render::OgreRenderermRender
OEngine::Physic::PhysicEnginemEngine
std::map< std::string,
std::string > 
handleToMesh
PtrVelocityList mMovementQueue
PtrVelocityList mMovementResults
float mTimeAccum

Constructor & Destructor Documentation


Member Function Documentation

void MWWorld::PhysicsSystem::addHeightField ( float *  heights,
int  x,
int  y,
float  yoffset,
float  triSize,
float  sqrtVerts 
)
void MWWorld::PhysicsSystem::addObject ( const MWWorld::Ptr ptr,
bool  placeable = false 
)
bool MWWorld::PhysicsSystem::castRay ( const Ogre::Vector3 &  from,
const Ogre::Vector3 &  to,
bool  raycastingObjectOnly = true,
bool  ignoreHeightMap = false 
)
std::pair< bool, Ogre::Vector3 > MWWorld::PhysicsSystem::castRay ( const Ogre::Vector3 &  orig,
const Ogre::Vector3 &  dir,
float  len 
)
std::pair< bool, Ogre::Vector3 > MWWorld::PhysicsSystem::castRay ( float  mouseX,
float  mouseY 
)

cast ray from the mouse, return true if it hit something and the first result (in OGRE coordinates)

Todo:
make this distance (ray length) configurable
Todo:
make this distance (ray length) configurable
std::vector< std::string > MWWorld::PhysicsSystem::getCollisions ( const MWWorld::Ptr ptr)

get handles this object collides with

std::pair< float, std::string > MWWorld::PhysicsSystem::getFacedHandle ( float  queryDistance)
std::vector< std::pair< float, std::string > > MWWorld::PhysicsSystem::getFacedHandles ( float  queryDistance)
std::vector< std::pair< float, std::string > > MWWorld::PhysicsSystem::getFacedHandles ( float  mouseX,
float  mouseY,
float  queryDistance 
)
std::pair< std::string, Ogre::Vector3 > MWWorld::PhysicsSystem::getHitContact ( const std::string &  name,
const Ogre::Vector3 &  origin,
const Ogre::Quaternion &  orientation,
float  queryDistance 
)
bool MWWorld::PhysicsSystem::getObjectAABB ( const MWWorld::Ptr ptr,
Ogre::Vector3 &  min,
Ogre::Vector3 &  max 
)
PhysicsSystem& MWWorld::PhysicsSystem::operator= ( const PhysicsSystem ) [private]
void MWWorld::PhysicsSystem::queueObjectMovement ( const Ptr ptr,
const Ogre::Vector3 &  velocity 
)

Queues velocity movement for a Ptr. If a Ptr is already queued, its velocity will be overwritten. Valid until the next call to applyQueuedMovement.

void MWWorld::PhysicsSystem::removeHeightField ( int  x,
int  y 
)
void MWWorld::PhysicsSystem::removeObject ( const std::string &  handle)
Ogre::Vector3 MWWorld::PhysicsSystem::traceDown ( const MWWorld::Ptr ptr)

Member Data Documentation

std::map<std::string, std::string> MWWorld::PhysicsSystem::handleToMesh [private]

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