MathEngine
Home Page       Structures       File List       Functions and Macros      

MdtWorld.h File Reference

MdtWorld API functions. More...

#include "MePrecision.h"
#include "MdtTypes.h"

Functions

MdtWorldID MdtWorldCreate (const int maxBodies, const int maxConstraints, void *const m, const int size)
 Allocates memory for a new MdtWorld, and resets to default values. More...

void MdtWorldReset (const MdtWorldID w)
 Initialises a world and sets default values. More...

void MdtWorldReCreate (const MdtWorldID w)
 Completely reset a world and destroys all bodies and constraints. More...

void MdtWorldDestroy (const MdtWorldID w)
 Destroys an MdtWorld and all bodies, constraints etc. More...

void MdtWorldStep (const MdtWorldID w, const MeReal stepSize)
 Evolves the Kea world. More...

void MdtWorldLog (const MdtWorldID w)
 Logs contents of the MdtWorld structure. More...

void MdtWorldLogAll (const MdtWorldID w)
 Logs contents of the body and constraint structures before they are evolved by Kea. More...

int MdtWorldGetTotalBodies (const MdtWorldID w)
 Returns the total number of bodies in the world regardless of whether they are enabled or not. More...

int MdtWorldGetEnabledBodies (const MdtWorldID w)
 Returns the number of enabled bodies in the world. More...

int MdtWorldGetTotalConstraints (const MdtWorldID w)
 Returns the number of constraints in the world regardless of whether they are enabled or not. More...

int MdtWorldGetEnabledConstraints (const MdtWorldID w)
 Returns the number of enabled constraints in the world. More...

MeReal MdtWorldGetEpsilon (const MdtWorldID w)
 Returns the amount of allowed constraint violation. More...

MeReal MdtWorldGetGamma (const MdtWorldID w)
 Returns the amount to restore violated constraints. More...

void MdtWorldGetGravity (const MdtWorldID w, MeVector3 g)
 Returns the gravity vector, in world reference frame. More...

MdtDEMMode MdtWorldGetDEMMode (const MdtWorldID w)
 Returns the DEM event manager mode. More...

MeReal MdtWorldGetDEMVelocityThreshold (const MdtWorldID w)
 Returns the minimum velocity before auto-disabling objects. More...

MeReal MdtWorldGetDEMAngularVelocityThreshold ( const MdtWorldID w)
 Returns the minimum angular velocity before auto-disabling objects. More...

MeReal MdtWorldGetDEMAccelerationThreshold (const MdtWorldID w)
 Returns the minimum acceleration before auto-disabling objects. More...

MeReal MdtWorldGetDEMAngularAccelerationThreshold ( const MdtWorldID w)
 Returns the minimum angular acceleration before auto-disabling objects. More...

int MdtWorldGetDEMAliveWindow (const MdtWorldID w)
 Returns the minimum number of evolves before auto-disabling and object once enabled. More...

void* MdtWorldGetMemoryPool (const MdtWorldID w)
 Returns the memory pool currently being used by the solver each step. More...

int MdtWorldGetMemoryPoolSize (const MdtWorldID w)
 Returns the size of the memory pool currently being used by the solver each step. More...

int MdtWorldGetMaxMemoryPoolUsed (const MdtWorldID w)
 Returns the maximum amount of the Kea memory pool that has been used on any solve so far. More...

MdtMemoryPoolOverflowCB MdtWorldGetMemoryPoolOverflowCB (const MdtWorldID w)
 Returns the currently set (optional) memory pool overflow callback. More...

void MdtWorldSetEpsilon (const MdtWorldID w, const MeReal e)
 Sets epsilon for a world. More...

void MdtWorldSetGamma (const MdtWorldID w, const MeReal g)
 Sets gamma for a world. More...

void MdtWorldSetGravity (const MdtWorldID w, const MeReal gx, const MeReal gy, const MeReal gz)
 Sets the gravity for the world in the world reference frame. More...

void MdtWorldSetDEMMode (const MdtWorldID w, const MdtDEMMode m)
 Sets the Dynamic Event Mangager's mode of operation. More...

void MdtWorldSetDEMVelocityThreshold (const MdtWorldID w, const MeReal vt)
 Sets the velocity threshold below which an object will be auto-disabled. More...

void MdtWorldSetDEMAngularVelocityThreshold (const MdtWorldID w, const MeReal avt)
 Sets the angular velocity threshold below which an object will be auto-disabled. More...

void MdtWorldSetDEMAccelerationThreshold (const MdtWorldID w, const MeReal at)
 Sets the acceleration threshold below which an object will be auto-disabled. More...

void MdtWorldSetDEMAngularAccelerationThreshold ( const MdtWorldID w,const MeReal aat)
 Sets the angular acceleration threshold below which an object will be auto-disabled. More...

void MdtWorldSetDEMAliveWindow (const MdtWorldID w, const int aw)
 Sets the minimum number of evolves before auto-disabling and object once enabled. More...

void MdtWorldSetMemoryPool (const MdtWorldID w, void *const m, const int size)
 Changes the memory pool used by Kea to solve the system each step. More...

void MdtWorldSetMemoryPoolOverflowCB (const MdtWorldID w, const MdtMemoryPoolOverflowCB cb)
 Sets an optional memory pool overflow callback. More...


Detailed Description

MdtWorld API functions.


Function Documentation

MdtWorldID MdtWorldCreate ( int maxBodies,
int maxConstraints,
void * const m,
int size )

Allocates memory for a new MdtWorld, and resets to default values.

Parameters:
maxBodies   Maximum number of bodies in this world.
maxConstraints   Maximum number of constraints in this world.
m   Kea's workspace memory.
size   Size of Kea's workspace.

void MdtWorldDestroy ( MdtWorldID w )

Destroys an MdtWorld and all bodies, constraints etc.

MeReal MdtWorldGetDEMAccelerationThreshold ( MdtWorldID w )

Returns the minimum acceleration before auto-disabling objects.

int MdtWorldGetDEMAliveWindow ( MdtWorldID w )

Returns the minimum number of evolves before auto-disabling and object once enabled.

MeReal MdtWorldGetDEMAngularAccelerationThreshold ( MdtWorldID w )

Returns the minimum angular acceleration before auto-disabling objects.

MeReal MdtWorldGetDEMAngularVelocityThreshold ( MdtWorldID w )

Returns the minimum angular velocity before auto-disabling objects.

MdtDEMMode MdtWorldGetDEMMode ( MdtWorldID w )

Returns the DEM event manager mode.

See also:
MdtDEMMode

MeReal MdtWorldGetDEMVelocityThreshold ( MdtWorldID w )

Returns the minimum velocity before auto-disabling objects.

int MdtWorldGetEnabledBodies ( MdtWorldID w )

Returns the number of enabled bodies in the world.

int MdtWorldGetEnabledConstraints ( MdtWorldID w )

Returns the number of enabled constraints in the world.

MeReal MdtWorldGetEpsilon ( MdtWorldID w )

Returns the amount of allowed constraint violation.

MeReal MdtWorldGetGamma ( MdtWorldID w )

Returns the amount to restore violated constraints.

void MdtWorldGetGravity ( MdtWorldID w,
MeVector3 g )

Returns the gravity vector, in world reference frame.

int MdtWorldGetMaxMemoryPoolUsed ( MdtWorldID w )

Returns the maximum amount of the Kea memory pool that has been used on any solve so far.

void * MdtWorldGetMemoryPool ( MdtWorldID w )

Returns the memory pool currently being used by the solver each step.

See also:
MdtWorldSetMemoryPool()

MdtMemoryPoolOverflowCB MdtWorldGetMemoryPoolOverflowCB ( MdtWorldID w )

Returns the currently set (optional) memory pool overflow callback.

int MdtWorldGetMemoryPoolSize ( MdtWorldID w )

Returns the size of the memory pool currently being used by the solver each step.

See also:
MdtWorldSetMemoryPool()

int MdtWorldGetTotalBodies ( MdtWorldID w )

Returns the total number of bodies in the world regardless of whether they are enabled or not.

int MdtWorldGetTotalConstraints ( MdtWorldID w )

Returns the number of constraints in the world regardless of whether they are enabled or not.

void MdtWorldLog ( MdtWorldID w )

Logs contents of the MdtWorld structure.

To redirect output redefine the MeInfo handler (see MeMessage.c)

Note that logging only works in the debug build of Mdt (when _MEDEBUG is defined).

void MdtWorldLogAll ( MdtWorldID w )

Logs contents of the body and constraint structures before they are evolved by Kea.

Only logs one timestep's worth of data.

void MdtWorldReCreate ( MdtWorldID w )

Completely reset a world and destroys all bodies and constraints.

This function is equivalent to calling MdtWorldDestroy and MdtWorldCreate, but keeps maxBodies and maxConstraints the same and re-uses the memory pool created. This makes it much faster.

void MdtWorldReset ( MdtWorldID w )

Initialises a world and sets default values.

Default values:

See also:
struct MdtWorld

void MdtWorldSetDEMAccelerationThreshold ( MdtWorldID w,
MeReal at )

Sets the acceleration threshold below which an object will be auto-disabled.

The value represents the sum of the squared elements of the objects acceleration. Unused unless the MdtDEMMode is set to MdtDEMModePartitionAutoDisable.

void MdtWorldSetDEMAliveWindow ( MdtWorldID w,
int aw )

Sets the minimum number of evolves before auto-disabling and object once enabled.

Unused unless the MdtDEMMode is set to MdtDEMModePartitionAutoDisable.

void MdtWorldSetDEMAngularAccelerationThreshold ( MdtWorldID w,
MeReal aat )

Sets the angular acceleration threshold below which an object will be auto-disabled.

The value represents the sum of the squared elements of the objects angular acceleration. Unused unless the MdtDEMMode is set to MdtDEMModePartitionAutoDisable.

void MdtWorldSetDEMAngularVelocityThreshold ( MdtWorldID w,
MeReal avt )

Sets the angular velocity threshold below which an object will be auto-disabled.

The value represents the sum of the squared elements of the objects angular velocity. Unused unless the MdtDEMMode is set to MdtDEMModePartitionAutoDisable.

void MdtWorldSetDEMMode ( MdtWorldID w,
MdtDEMMode m )

Sets the Dynamic Event Mangager's mode of operation.

The default is MdtDEMModePartitionNoAutoDisable.

See also:
MdtDEMMode

void MdtWorldSetDEMVelocityThreshold ( MdtWorldID w,
MeReal vt )

Sets the velocity threshold below which an object will be auto-disabled.

The value represents the sum of the squared elements of the objects velocity. Unused unless the MdtDEMMode is set to MdtDEMModePartitionAutoDisable.

void MdtWorldSetEpsilon ( MdtWorldID w,
MeReal e )

Sets epsilon for a world.

void MdtWorldSetGamma ( MdtWorldID w,
MeReal g )

Sets gamma for a world.

Gamma is the relaxation rate of constraints.

void MdtWorldSetGravity ( MdtWorldID w,
MeReal gx,
MeReal gy,
MeReal gz )

Sets the gravity for the world in the world reference frame.

void MdtWorldSetMemoryPool ( MdtWorldID w,
void * const m,
int size )

Changes the memory pool used by Kea to solve the system each step.

This pool is only used during MdtWorldStep.

See also:
MdtWorldGetMaxMemoryPoolUsed()

void MdtWorldSetMemoryPoolOverflowCB ( MdtWorldID w,
MdtMemoryPoolOverflowCB cb )

Sets an optional memory pool overflow callback.

This is a callback functions that will be called in the event of the memory pool used during MdtWorldStep being to small to solve a particular system, and allows to the user to change the size of the pool to allow simulation to continue. This callback should call no other functionality in Mdt apart from MdtWorldSetMemoryPool.

void MdtWorldStep ( MdtWorldID w,
MeReal stepSize )

Evolves the Kea world.

This function will use the current MdtDEMMode to divide up the the world into partitions if necessary, and will use the Kea solver to evolve all the bodies in the world.

Parameters:
w   MdtWorld to simulate.
stepSize   Amount of time to evolve world by.

MathEngine Dynamics Toolkit - Version 0.0.5 Alpha - Reference Manual generated using doxygen at Wed Oct 11 00:34:49 2000

Copyright MathEngine PLC 2000, all rights reserved.