#include <OgreRefAppWorld.h>
Public Types | |
enum | WorldType |
World type, you'll want to extend this for your own apps. | |
Public Member Functions | |
World (SceneManager *sceneMgr, WorldType worldType=WT_REFAPP_GENERIC) | |
SceneManager * | getSceneManager (void) |
Get the scene manager for this world. | |
OgreHead * | createOgreHead (const String &name, const Vector3 &pos=Vector3::ZERO, const Quaternion &orientation=Quaternion::IDENTITY) |
FinitePlane * | createPlane (const String &name, Real width, Real height, const Vector3 &pos=Vector3::ZERO, const Quaternion &orientation=Quaternion::IDENTITY) |
Ball * | createBall (const String &name, Real radius, const Vector3 &pos=Vector3::ZERO, const Quaternion &orientation=Quaternion::IDENTITY) |
Box * | createBox (const String &name, Real width, Real height, Real depth, const Vector3 &pos=Vector3::ZERO, const Quaternion &orientation=Quaternion::IDENTITY) |
Character * | createCharacter (const String &name, const String &_meshName, const Vector3 &pos=Vector3::ZERO, const Quaternion &orientation=Quaternion::IDENTITY) |
NPC * | createNPC (const String &name, const String &_meshName, const Vector3 &pos=Vector3::ZERO, const Quaternion &orientation=Quaternion::IDENTITY) |
CollideCamera * | createCamera (const String &name, const Vector3 &pos=Vector3::ZERO, const Quaternion &orientation=Quaternion::IDENTITY) |
void | clear (void) |
void | _applyCollision (void) |
void | _applyDynamics (Real timeElapsed) |
void | _notifyDynamicsStateForObject (ApplicationObject *obj, bool dynamicsEnabled) |
void | setGravity (const Vector3 &vec) |
const Vector3 & | getGravity (void) |
Joint * | createJoint (const String &name, Joint::JointType jtype, ApplicationObject *obj1, ApplicationObject *obj2) |
void | setSimulationStepSize (Real step) |
Real | getSimulationStepSize (void) |
void | simulationStep (Real timeElapsed) |
Static Public Member Functions | |
static World & | getSingleton (void) |
static World * | getSingletonPtr (void) |
Protected Attributes | |
SceneManager * | mSceneMgr |
Pointer to OGRE's scene manager. | |
ObjectMap | mObjects |
Main list of objects. | |
ObjectSet | mDynamicsObjects |
Set of dynamics objects (those to perform physics on). | |
dJointGroup * | mOdeContactGroup |
Contact joint group. | |
Real | mSimulationStepSize |
The step size of the collision / physics simulation. | |
WorldType | mWorldType |
The type of world we're dealing with. |
OgreRefApp::World::World | ( | SceneManager * | sceneMgr, | |
WorldType | worldType = WT_REFAPP_GENERIC | |||
) |
Creates an instance of the world.
sceneMgr | Pointer to the scene manager which will manage the scene | |
worldType | The type of world being used |
OgreHead * OgreRefApp::World::createOgreHead | ( | const String & | name, | |
const Vector3 & | pos = Vector3::ZERO , |
|||
const Quaternion & | orientation = Quaternion::IDENTITY | |||
) |
Create an OGRE head object.
FinitePlane * OgreRefApp::World::createPlane | ( | const String & | name, | |
Real | width, | |||
Real | height, | |||
const Vector3 & | pos = Vector3::ZERO , |
|||
const Quaternion & | orientation = Quaternion::IDENTITY | |||
) |
Create a plane object.
Ball * OgreRefApp::World::createBall | ( | const String & | name, | |
Real | radius, | |||
const Vector3 & | pos = Vector3::ZERO , |
|||
const Quaternion & | orientation = Quaternion::IDENTITY | |||
) |
Create a ball object.
OgreRefApp::Box * OgreRefApp::World::createBox | ( | const String & | name, | |
Real | width, | |||
Real | height, | |||
Real | depth, | |||
const Vector3 & | pos = Vector3::ZERO , |
|||
const Quaternion & | orientation = Quaternion::IDENTITY | |||
) |
Create a box object.
Character * OgreRefApp::World::createCharacter | ( | const String & | name, | |
const String & | _meshName, | |||
const Vector3 & | pos = Vector3::ZERO , |
|||
const Quaternion & | orientation = Quaternion::IDENTITY | |||
) |
Create a character object.
NPC * OgreRefApp::World::createNPC | ( | const String & | name, | |
const String & | _meshName, | |||
const Vector3 & | pos = Vector3::ZERO , |
|||
const Quaternion & | orientation = Quaternion::IDENTITY | |||
) |
Create a NPC object.
CollideCamera * OgreRefApp::World::createCamera | ( | const String & | name, | |
const Vector3 & | pos = Vector3::ZERO , |
|||
const Quaternion & | orientation = Quaternion::IDENTITY | |||
) |
Create a camera which interacts with the world.
void OgreRefApp::World::clear | ( | void | ) |
Clears the scene.
void OgreRefApp::World::_applyCollision | ( | void | ) |
Detects all the collisions in the world and acts on them.
void OgreRefApp::World::_applyDynamics | ( | Real | timeElapsed | ) |
Updates the world simulation.
void OgreRefApp::World::_notifyDynamicsStateForObject | ( | ApplicationObject * | obj, | |
bool | dynamicsEnabled | |||
) |
Internal method for notifying the world of a change in the dynamics status of an object.
void OgreRefApp::World::setGravity | ( | const Vector3 & | vec | ) |
Sets the gravity vector, units are in m/s^2.
const Vector3 & OgreRefApp::World::getGravity | ( | void | ) |
Gets the gravity vector.
Joint * OgreRefApp::World::createJoint | ( | const String & | name, | |
Joint::JointType | jtype, | |||
ApplicationObject * | obj1, | |||
ApplicationObject * | obj2 | |||
) |
Creates a Joint object for linking objects together in the world.
name | The name of the Joint. | |
jtype | The type of joint, see Joint::JointType. | |
obj1 | The first object to attach, or NULL to attach to the static world. | |
obj2 | The second object to attach, or NULL to attach to the static world. |
void OgreRefApp::World::setSimulationStepSize | ( | Real | step | ) |
Sets the step size of the simulation.
Real OgreRefApp::World::getSimulationStepSize | ( | void | ) |
Returns the size of the simulation step.
void OgreRefApp::World::simulationStep | ( | Real | timeElapsed | ) |
Performs a simulation step, ie applies collision and physics.
OgreRefApp::World & OgreRefApp::World::getSingleton | ( | void | ) | [static] |
Override standard Singleton retrieval.
OgreRefApp::World * OgreRefApp::World::getSingletonPtr | ( | void | ) | [static] |
Override standard Singleton retrieval.