MathEngine
Home Page       Structures       File List       Functions and Macros      

MdtLimit.h File Reference

MdtLimit and MdtSingleLimit API functions. More...

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

Functions

void MdtSingleLimitReset (const MdtSingleLimitID limit)
 Initialises the individual limit data and sets default values. More...

MeReal MdtSingleLimitGetStop ( const MdtSingleLimitID sl)
 Returns the minimum (for lower limit) or maximum (for upper limit) linear or angular separation of the attached bodies. More...

MeReal MdtSingleLimitGetStiffness ( const MdtSingleLimitID sl)
 Returns the spring constant (kp) used for restitution force when a limited joint reaches one of its stops. More...

MeReal MdtSingleLimitGetDamping ( const MdtSingleLimitID sl)
 Returns the damping term (kd) for this limit. More...

MeReal MdtSingleLimitGetRestitution ( const MdtSingleLimitID sl)
 Returns the restitution of this limit. More...

void MdtSingleLimitSetStop (const MdtSingleLimitID sl, const MeReal NewStop)
 Sets a limit on the linear or angular separation of the attached bodies. More...

void MdtSingleLimitSetStiffness (const MdtSingleLimitID sl, const MeReal NewStiffness)
 Sets the stiffness property of the limit. More...

void MdtSingleLimitSetDamping (const MdtSingleLimitID sl, const MeReal NewDamping)
 Sets the damping property of the limit. More...

void MdtSingleLimitSetRestitution (const MdtSingleLimitID sl, const MeReal NewRestitution)
 Sets the restitution property of the limit. More...

void MdtLimitReset (const MdtLimitID limit)
 Initialises the joint limit data and sets default values. More...

int MdtLimitIsActive (const MdtLimitID l)
 Returns non-zero if the prismatic joint has a limit imposed on it, and zero if it does not. More...

MdtSingleLimitID MdtLimitGetLowerLimit (const MdtLimitID l)
 Provides read/write access to the constraint's lower limit. More...

MdtSingleLimitID MdtLimitGetUpperLimit (const MdtLimitID l)
 Provides read/write access to the constraint's upper limit. More...

MeReal MdtLimitGetPosition (const MdtLimitID l)
 This service returns the relative position of the bodies attached to the joint. More...

MeReal MdtLimitGetOvershoot (const MdtLimitID l)
 This service returns the overshoot of the relative position of the attached bodies past one of the limits. More...

MeReal MdtLimitGetVelocity (const MdtLimitID l)
 This service returns the relative velocity of the bodies attached to the joint. More...

MeReal MdtLimitGetStiffnessThreshold ( const MdtLimitID l)
 Returns the limit stiffness threshold. More...

int MdtLimitIsMotorized (const MdtLimitID l)
 Returns non-zero if the limit is motorised, and zero if it is not. More...

MeReal MdtLimitGetMotorDesiredVelocity ( const MdtLimitID l)
 Returns the desired velocity of the motor. More...

MeReal MdtLimitGetMotorMaxForce ( const MdtLimitID l)
 Returns the maximum force that the motor is allowed to use to attain its desired velocity. More...

void MdtLimitSetLowerLimit (const MdtLimitID l, const MdtSingleLimitID sl)
 Sets the lower limit properties by copying the single limit data into the MdtBclLimit structure. More...

void MdtLimitSetUpperLimit (const MdtLimitID l, const MdtSingleLimitID sl)
 Sets the upper limit properties by copying the single limit data into the MdtBclLimit structure. More...

void MdtLimitActivateLimits (const MdtLimitID l, const int NewActivationState)
 Activates (if NewActivationState is non-zero) or deactivates (if zero) the limit, without changing any other limit property. More...

void MdtLimitSetStiffnessThreshold (const MdtLimitID l, const MeReal NewStiffnessThreshold)
 Sets the limit stiffness threshold. More...

void MdtLimitActivateMotor (const MdtLimitID l, const int NewActivationState)
 Activates (if NewActivationState is non-zero) or deactivates (if zero) the limited-force motor on this joint axis, without changing any other limit property. More...

void MdtLimitSetLimitedForceMotor (const MdtLimitID l, const MeReal desiredVelocity, const MeReal forceLimit)
 Sets the limited-force motor parameters, enforcing a non-negative value of forceLimit. More...


Detailed Description

MdtLimit and MdtSingleLimit API functions.


Function Documentation

void MdtLimitActivateLimits ( MdtLimitID l,
int NewActivationState )

Activates (if NewActivationState is non-zero) or deactivates (if zero) the limit, without changing any other limit property.

void MdtLimitActivateMotor ( MdtLimitID l,
int NewActivationState )

Activates (if NewActivationState is non-zero) or deactivates (if zero) the limited-force motor on this joint axis, without changing any other limit property.

MdtSingleLimitID MdtLimitGetLowerLimit ( MdtLimitID l )

Provides read/write access to the constraint's lower limit.

MeReal MdtLimitGetMotorDesiredVelocity ( MdtLimitID l )

Returns the desired velocity of the motor.

A lower limiting velocity may be achieved if the attached bodies are subject to velocity or angular velocity damping.

MeReal MdtLimitGetMotorMaxForce ( MdtLimitID l )

Returns the maximum force that the motor is allowed to use to attain its desired velocity.

MeReal MdtLimitGetOvershoot ( MdtLimitID l )

This service returns the overshoot of the relative position of the attached bodies past one of the limits.

This value is positive if the upper limit has been passed, negative if the lower limit has been passed, and zero if neither limit has been passed.

MeReal MdtLimitGetPosition ( MdtLimitID l )

This service returns the relative position of the bodies attached to the joint.

MeReal MdtLimitGetStiffnessThreshold ( MdtLimitID l )

Returns the limit stiffness threshold.

See comment on MdtLimitSetStiffnessThreshold service.

MdtSingleLimitID MdtLimitGetUpperLimit ( MdtLimitID l )

Provides read/write access to the constraint's upper limit.

MeReal MdtLimitGetVelocity ( MdtLimitID l )

This service returns the relative velocity of the bodies attached to the joint.

int MdtLimitIsActive ( MdtLimitID l )

Returns non-zero if the prismatic joint has a limit imposed on it, and zero if it does not.

Joint limits are active by default, but will not affect the attached bodies until non-zero stiffness and/or damping properties are set.

int MdtLimitIsMotorized ( MdtLimitID l )

Returns non-zero if the limit is motorised, and zero if it is not.

Joint limits are unmotorised by default.

void MdtLimitReset ( MdtLimitID limit )

Initialises the joint limit data and sets default values.

A 'limit' containts two 'single limits', a bottom and a top stop. This function initialises both of these to their default values as well.

Default values:

See also:
MdtSingleLimitReset()

void MdtLimitSetLimitedForceMotor ( MdtLimitID l,
MeReal desiredVelocity,
MeReal forceLimit )

Sets the limited-force motor parameters, enforcing a non-negative value of forceLimit.

If the latter is zero, this service deactivates the motor: otherwise, the motor is activated. This service does *not* wake attached disabled bodies.

void MdtLimitSetLowerLimit ( MdtLimitID l,
MdtSingleLimitID sl )

Sets the lower limit properties by copying the single limit data into the MdtBclLimit structure.

If the lower limit stop is higher than the current upper limit stop, the later is also reset to the new stop value.

void MdtLimitSetStiffnessThreshold ( MdtLimitID l,
MeReal NewStiffnessThreshold )

Sets the limit stiffness threshold.

When a limit stiffness exceeds this value, damping is ignored and only the restitution property is used.

When the limit stiffness is at or below this threshold, restitution is ignored, and the stiffness and damping terms are used to simulate a damped spring.

The stiffness threshold is enforced to be non-negative: the initial value is MEINFINITY.

void MdtLimitSetUpperLimit ( MdtLimitID l,
MdtSingleLimitID sl )

Sets the upper limit properties by copying the single limit data into the MdtBclLimit structure.

If the upper limit stop is higher than the current lower limit stop, the later is also reset to the new stop value.

MeReal MdtSingleLimitGetDamping ( MdtSingleLimitID sl )

Returns the damping term (kd) for this limit.

MeReal MdtSingleLimitGetRestitution ( MdtSingleLimitID sl )

Returns the restitution of this limit.

MeReal MdtSingleLimitGetStiffness ( MdtSingleLimitID sl )

Returns the spring constant (kp) used for restitution force when a limited joint reaches one of its stops.

MeReal MdtSingleLimitGetStop ( MdtSingleLimitID sl )

Returns the minimum (for lower limit) or maximum (for upper limit) linear or angular separation of the attached bodies.

void MdtSingleLimitReset ( MdtSingleLimitID limit )

Initialises the individual limit data and sets default values.

Default values:

void MdtSingleLimitSetDamping ( MdtSingleLimitID sl,
MeReal NewDamping )

Sets the damping property of the limit.

Damping is enforced to be non-negative: the initial value is zero.

void MdtSingleLimitSetRestitution ( MdtSingleLimitID sl,
MeReal NewRestitution )

Sets the restitution property of the limit.

Restitution is enforced to be in the range zero to one inclusive: the initial value is one.

void MdtSingleLimitSetStiffness ( MdtSingleLimitID sl,
MeReal NewStiffness )

Sets the stiffness property of the limit.

Stiffness is enforced to be non-negative: the initial value is MEINFINITY.

void MdtSingleLimitSetStop ( MdtSingleLimitID sl,
MeReal NewStop )

Sets a limit on the linear or angular separation of the attached bodies.


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

Copyright MathEngine PLC 2000, all rights reserved.