MathEngine
Home Page       Structures       File List       Functions and Macros      

MdtContact.h File Reference

MdtContact API functions. More...

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

Functions

MdtContactID MdtContactCreate (const MdtWorldID w, const MdtBodyID b1, const MdtBodyID b2)
 Creates a new contact and sets default parameters. More...

void MdtContactReset (const MdtContactID c)
 Sets a contact to its default values. More...

void MdtContactDestroy (const MdtContactID c)
 Destroys a constraint. More...

void MdtContactLog (const MdtContactID c)
 Debug function - output constraint using MeMessage. More...

MdtConstraintID MdtContactQuaConstraint (const MdtContactID c)
 Gets an MdtConstraintID from a specific constraint for performing functions common to all constraints. More...

void MdtContactGetPosition (const MdtContactID c, MeVector3 v)
 Returns the contact position in v, in the world reference frame. More...

void MdtContactGetNormal (const MdtContactID c, MeVector3 v)
 Returns the contact normal in v, in the world reference frame. More...

MeReal MdtContactGetPenetration (const MdtContactID c)
 Returns the current penetration at this contact. More...

void MdtContactGetDirection (const MdtContactID c, MeVector3 v)
 The contacts primary direction is returned in v, in the world reference frame. More...

MdtContactParamsID MdtContactGetParams (const MdtContactID c)
 Returns a pointer to the contacts parameters of this contact. More...

MdtContactID MdtContactGetNext (const MdtContactID c)
 Returns the pointer to the next contact associated with this body pair if it was set in collision. More...

void MdtContactSetPosition (const MdtContactID c, const MeReal x, const MeReal y, const MeReal z)
 Sets the contact position. More...

void MdtContactSetNormal (const MdtContactID c, const MeReal x, const MeReal y, const MeReal z)
 Sets the contact normal. More...

void MdtContactSetPenetration (const MdtContactID c, const MeReal p)
 Sets the amount of penetration at the contact. More...

void MdtContactSetDirection (const MdtContactID c, const MeReal x, const MeReal y, const MeReal z)
 Sets the primary direction for this contact. More...

void MdtContactSetParams (const MdtContactID c, const MdtContactParamsID p)
 Utility for setting all contact parameters. More...

void MdtContactSetNext (const MdtContactID c, const MdtContactID nc)
 Sets the pointer to the next contact. More...


Variables

const MdtContactID MdtContactInvalidID = 0
 Invalid ContactID indicating end of MdtContact linked list. More...


Detailed Description

MdtContact API functions.


Define Documentation

#define MdtContactDisable( c )

Initializer:

\
                            MdtConstraintDisable(MdtContactQuaConstraint(c))

#define MdtContactEnable( c )

Initializer:

\
                            MdtConstraintEnable(MdtContactQuaConstraint(c))

#define MdtContactGetBody( c, bodyindex )

Initializer:

\
                            MdtConstraintGetBody(MdtContactQuaConstraint(c), bodyindex)

#define MdtContactGetForce( c, bodyindex, f )

Initializer:

\
                            MdtConstraintGetForce(MdtContactQuaConstraint(c), bodyindex, f)

#define MdtContactGetTorque( c, bodyindex, t )

Initializer:

\
                            MdtConstraintGetTorque(MdtContactQuaConstraint(c), bodyindex, t)

#define MdtContactGetUserData( c )

Initializer:

\
                            MdtConstraintGetUserData(MdtContactQuaConstraint(c))

#define MdtContactGetWorld( c )

Initializer:

\
                            MdtConstraintGetWorld(MdtContactQuaConstraint(c))

#define MdtContactIsEnabled( c )

Initializer:

\
                            MdtConstraintIsEnabled(MdtContactQuaConstraint(c))

#define MdtContactSetBodies( c, b1, b2 )

Initializer:

\
                            MdtConstraintSetBodies(MdtContactQuaConstraint(c), b1, b2)

#define MdtContactSetUserData( c, d )

Initializer:

\
                            MdtConstraintSetUserData(MdtContactQuaConstraint(c), d)

Function Documentation

MdtContactID MdtContactCreate ( MdtWorldID w,
MdtBodyID b1,
MdtBodyID b2 )

Creates a new contact and sets default parameters.

A contact's bodies may not be known on creation because a pool might have been created and the bodies set when needed. Therefore it is okay to set both bodies to zero here. If however something other than zero is specified for either body then that body will be tested to see if it is valid.

See also:
MdtContactReset()

void MdtContactDestroy ( MdtContactID c )

Destroys a constraint.

void MdtContactGetDirection ( MdtContactID c,
MeVector3 v )

The contacts primary direction is returned in v, in the world reference frame.

MdtContactID MdtContactGetNext ( MdtContactID c )

Returns the pointer to the next contact associated with this body pair if it was set in collision.

If the return value is equal to MdtContactInvalidID then no next contact exists.

void MdtContactGetNormal ( MdtContactID c,
MeVector3 v )

Returns the contact normal in v, in the world reference frame.

MdtContactParamsID MdtContactGetParams ( MdtContactID c )

Returns a pointer to the contacts parameters of this contact.

MeReal MdtContactGetPenetration ( MdtContactID c )

Returns the current penetration at this contact.

void MdtContactGetPosition ( MdtContactID c,
MeVector3 v )

Returns the contact position in v, in the world reference frame.

void MdtContactLog ( MdtContactID c )

Debug function - output constraint using MeMessage.

MdtConstraintID MdtContactQuaConstraint ( MdtContactID c )

Gets an MdtConstraintID from a specific constraint for performing functions common to all constraints.

void MdtContactReset ( MdtContactID c )

Sets a contact to its default values.

Note that the contact's bodies are not reset.

Default values:

Parameters:
c   contact ID
See also:
MdtContactParamsReset()

void MdtContactSetDirection ( MdtContactID c,
MeReal x,
MeReal y,
MeReal z )

Sets the primary direction for this contact.

This is only necessary if you wish to define surface properties to vary depending on the direction. For isotropic (the same in all direction) contacts, this function should not be called, and the primary and secondary parameters should be set to the same value.

The direction should always be perpendicular to the given normal, and the secondary direction is perpendicular to the primary direction.

void MdtContactSetNext ( MdtContactID c,
MdtContactID nc )

Sets the pointer to the next contact.

Used by Mcd collision.

void MdtContactSetNormal ( MdtContactID c,
MeReal x,
MeReal y,
MeReal z )

Sets the contact normal.

void MdtContactSetParams ( MdtContactID c,
MdtContactParamsID p )

Utility for setting all contact parameters.

Allows the user to set all values in the MdtBclContactParams structure in one go.

void MdtContactSetPenetration ( MdtContactID c,
MeReal p )

Sets the amount of penetration at the contact.

void MdtContactSetPosition ( MdtContactID c,
MeReal x,
MeReal y,
MeReal z )

Sets the contact position.


Variable Documentation

const MdtContactID MdtContactInvalidID = 0

Invalid ContactID indicating end of MdtContact linked list.


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

Copyright MathEngine PLC 2000, all rights reserved.