void TAC_CALL TA::Physics::CreateInstance
(
|
const AABB &
|
worldAABB,
|
|
const Vec3 &
|
v3Gravity = Vec3(0.0f, -9.81f, 0.0f) ,
|
|
u32
|
nFlags = FLAG_XZ_COLLISION_GRID ,
|
|
float
|
fMinSpacialDivision = 10.0f ,
|
|
int
|
nSpacialDivisionMemory = 0x40000
|
) |
[static]
|
|
|
- Deprecated:
- Use TA::Physics::CreateInstance() instead.
Call this function to create and initialise an instance of the class TA::Physics. TA::Physics::GetInstance() can then be used to access the created instance. TA::Physics::DestroyInstance() should be called when done. - See also:
- TA::Physics::DestroyInstance() and TA::Physics::GetInstance().
- Parameters:
-
| worldAABB |
| | An axis aligned bounding box representing the spacial bounds of the physics simulation. |
| v3Gravity |
| | Acceleration on all objects due to gravity. Gravity can be altered at any time by calling TA::Physics::SetGravity. |
| nFlags |
| | Either FLAG_XY_COLLISION_GRID, FLAG_XZ_COLLISION_GRID, FLAG_YZ_COLLISION_GRID or FLAG_DYNAMIC_OCTREE. This parameter specifies the type of spacial division that will be used to find potentially colliding dynamic objects.
- FLAG_XY_COLLISION_GRID
- FLAG_XZ_COLLISION_GRID
- FLAG_YZ_COLLISION_GRID
Specifies a collision grid and the plane it will lay in. See collision grid for more information. Is is most often best to use a horizontal collision grid. So if Y is up, FLAG_XZ_COLLISION_GRID, is probably best. - FLAG_DYNAMIC_OCTREE Specifies that a dynamic octree should be used. Dynamic octrees are more flexible than collision grids. Octrees better fit worlds that are highly 3D or are very unevenly distributed with objects. The octree implementation also better handles large size ranges in dynamic objects. Whether a collision grid or an octree is faster or better is dependant on the world being simulated.
|
| fMinSpacialDivision |
| | The minimum spacial division that will be used by the collision grid or octree. If a collision grid is used, no dynamic objects should be created that are bigger than this value. Such objects may not collide properly with other dynamic objects. Octrees do not suffer from this constraint. |
| nSpacialDivisionMemory |
| | The maximum amount of memory that will be used by the collision grid. The spacial division used by the collision grid will be increase from fMinSpacialDivision until the memory used is below this value. The memory used will always be greater than zero. |
| nSpacialDivisionMemory |
| | If a dynamic octree is used, than this will be in initial amount of memory allocated. If the octree needs more during use, it will be automatically allocated. |
|
|