CWorld Class Reference
The class used for physics emulation in a Bsp Scene Manager.
More...
#include <World.h>
List of all members.
|
Public Member Functions |
| CWorld (SceneManager *mgr) |
SceneManager * | GetSceneManager () |
| Returns the Bsp Scene Manager that the world works on.
|
float | GetGravity () |
| Returns the magnitude of gravity in the world.
|
void | SetGravity (float unitspersecond) |
Ogre::uint32 | GetQueryMask () |
| Returns the query mask used by the CWorld system. If there are entities with the same query mask then the world may not function properly.
|
void | SetQueryMask (Ogre::uint32 qf) |
| Sets the query mask used by the CWorld system. If there are entities with the same query mask then the world may not function properly. Use this function to resolve this problem.
|
void | Execute (float seconds) |
| ~CWorld () |
| Destructor. Call it before destroying the Bsp Scene Manager.
|
CBox * | CreateBox (float x, float y, float z) |
CSphere * | CreateSphere (float r) |
CSpirit * | CreateSpirit (float height=56.0f, float radius=12.0f, float climbheight=15.0f, float maxclimbslope=0.5f, float movespeed=50.0f, float airspeedratio=0.2f, float slidespeedratio=0.5f) |
void | RemoveThing (CThing *thing) |
| Removes a CThing from the system.
|
Detailed Description
The class used for physics emulation in a Bsp Scene Manager.
Constructor & Destructor Documentation
CWorld::CWorld |
( |
SceneManager * |
mgr |
) |
|
CWorld constructor.
- Parameters:
-
| mgr | The Bsp Scene Manager that the world physics system will work on. The map should be loaded. |
Member Function Documentation
void CWorld::SetGravity |
( |
float |
unitspersecond |
) |
|
Sets the gravity of the world.
- Parameters:
-
| unitspersecond | The magnitude of the gravity in units per square-seconds. The direction of gravity is -z. |
void CWorld::Execute |
( |
float |
seconds |
) |
|
Executes the physics system.
- Parameters:
-
| seconds | The time that the world is executed in seconds. |
CBox* CWorld::CreateBox |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z | |
|
) |
| | |
Creates a CBox.
- Parameters:
-
| x | Length of the X-side of the box. |
| y | Length of the Y-side of the box. |
| z | Length of the Z-side of the box. |
- Returns:
- The handle to the newly created box.
CSphere* CWorld::CreateSphere |
( |
float |
r |
) |
|
Creates a CSphere.
- Parameters:
-
- Returns:
- The handle to the newly created sphere.
CSpirit* CWorld::CreateSpirit |
( |
float |
height = 56.0f , |
|
|
float |
radius = 12.0f , |
|
|
float |
climbheight = 15.0f , |
|
|
float |
maxclimbslope = 0.5f , |
|
|
float |
movespeed = 50.0f , |
|
|
float |
airspeedratio = 0.2f , |
|
|
float |
slidespeedratio = 0.5f | |
|
) |
| | |
Creates a CSpirit.
- Parameters:
-
| height | Height of the cylinderic spirit.(length in z-axis.) |
| radius | Radius of the cylinderic spirit.(half of the length in x and y axes.) |
| climbheight | The maximum height of the block that this spirit may climb. |
| maxclimbslope | The maximum slope of the terrain that this spirit may move on without falling. |
| movespeed | The amount of speed added when the velocity of the spirit is increased by a factor of 1. See CSpirit::Move. |
| airspeedratio | The reduction in movement speed if the spirit is in air. |
| slidespeedratio | The reduction in movement speed if the spirit is not in air but on a steep surface so that it is falling. |
- Returns:
- The handle to the newly created spirit.
The documentation for this class was generated from the following file: