Joints


Functions

ODE_API dJointID dJointCreateBall (dWorldID, dJointGroupID)
 Create a new joint of the ball type.
ODE_API dJointID dJointCreateHinge (dWorldID, dJointGroupID)
 Create a new joint of the hinge type.
ODE_API dJointID dJointCreateSlider (dWorldID, dJointGroupID)
 Create a new joint of the slider type.
ODE_API dJointID dJointCreateContact (dWorldID, dJointGroupID, const dContact *)
 Create a new joint of the contact type.
ODE_API dJointID dJointCreateHinge2 (dWorldID, dJointGroupID)
 Create a new joint of the hinge2 type.
ODE_API dJointID dJointCreateUniversal (dWorldID, dJointGroupID)
 Create a new joint of the universal type.
ODE_API dJointID dJointCreatePR (dWorldID, dJointGroupID)
 Create a new joint of the PR (Prismatic and Rotoide) type.
ODE_API dJointID dJointCreatePU (dWorldID, dJointGroupID)
 Create a new joint of the PU (Prismatic and Universal) type.
ODE_API dJointID dJointCreatePiston (dWorldID, dJointGroupID)
 Create a new joint of the Piston type.
ODE_API dJointID dJointCreateFixed (dWorldID, dJointGroupID)
 Create a new joint of the fixed type.
ODE_API dJointID dJointCreateAMotor (dWorldID, dJointGroupID)
 Create a new joint of the A-motor type.
ODE_API dJointID dJointCreateLMotor (dWorldID, dJointGroupID)
 Create a new joint of the L-motor type.
ODE_API dJointID dJointCreatePlane2D (dWorldID, dJointGroupID)
 Create a new joint of the plane-2d type.
ODE_API void dJointDestroy (dJointID)
 Destroy a joint.

disconnects it from its attached bodies and removing it from the world. However, if the joint is a member of a group then this function has no effect - to destroy that joint the group must be emptied or destroyed.

ODE_API dJointGroupID dJointGroupCreate (int max_size)
 Create a joint group.
ODE_API void dJointGroupDestroy (dJointGroupID)
 Destroy a joint group.

All joints in the joint group will be destroyed.

ODE_API void dJointGroupEmpty (dJointGroupID)
 Empty a joint group.

All joints in the joint group will be destroyed, but the joint group itself will not be destroyed.

ODE_API int dJointGetNumBodies (dJointID)
 Return the number of bodies attached to the joint.
ODE_API void dJointAttach (dJointID, dBodyID body1, dBodyID body2)
 Attach the joint to some new bodies.

If the joint is already attached, it will be detached from the old bodies first. To attach this joint to only one body, set body1 or body2 to zero - a zero body refers to the static environment. Setting both bodies to zero puts the joint into "limbo", i.e. it will have no effect on the simulation.

ODE_API void dJointEnable (dJointID)
 Manually enable a joint.
ODE_API void dJointDisable (dJointID)
 Manually disable a joint.
ODE_API int dJointIsEnabled (dJointID)
 Check wether a joint is enabled.
ODE_API void dJointSetData (dJointID, void *data)
 Set the user-data pointer.
ODE_API void * dJointGetData (dJointID)
 Get the user-data pointer.
ODE_API dJointType dJointGetType (dJointID)
 Get the type of the joint.
ODE_API dBodyID dJointGetBody (dJointID, int index)
 Return the bodies that this joint connects.
ODE_API void dJointSetFeedback (dJointID, dJointFeedback *)
 Sets the datastructure that is to receive the feedback.
ODE_API dJointFeedback * dJointGetFeedback (dJointID)
 Gets the datastructure that is to receive the feedback.
ODE_API void dJointSetBallAnchor (dJointID, dReal x, dReal y, dReal z)
 Set the joint anchor point.

The joint will try to keep this point on each body together. The input is specified in world coordinates.

ODE_API void dJointSetBallAnchor2 (dJointID, dReal x, dReal y, dReal z)
 Set the joint anchor point.
ODE_API void dJointSetBallParam (dJointID, int parameter, dReal value)
 Param setting for Ball joints.
ODE_API void dJointSetHingeAnchor (dJointID, dReal x, dReal y, dReal z)
 Set hinge anchor parameter.
ODE_API void dJointSetHingeAxis (dJointID, dReal x, dReal y, dReal z)
 Set hinge axis.
ODE_API void dJointSetHingeAxisOffset (dJointID j, dReal x, dReal y, dReal z, dReal angle)
 Set the Hinge axis as if the 2 bodies were already at angle appart.

This function initialize the Axis and the relative orientation of each body as if body1 was rotated around the axis by the angle value. Ex:.

ODE_API void dJointSetHingeParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointAddHingeTorque (dJointID joint, dReal torque)
 Applies the torque about the hinge axis.
ODE_API void dJointSetSliderAxis (dJointID, dReal x, dReal y, dReal z)
 set the joint axis
ODE_API void dJointSetSliderAxisDelta (dJointID, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az)
ODE_API void dJointSetSliderParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointAddSliderForce (dJointID joint, dReal force)
 Applies the given force in the slider's direction.
ODE_API void dJointSetHinge2Anchor (dJointID, dReal x, dReal y, dReal z)
 set anchor
ODE_API void dJointSetHinge2Axis1 (dJointID, dReal x, dReal y, dReal z)
 set axis
ODE_API void dJointSetHinge2Axis2 (dJointID, dReal x, dReal y, dReal z)
 set axis
ODE_API void dJointSetHinge2Param (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointAddHinge2Torques (dJointID joint, dReal torque1, dReal torque2)
 Applies torque1 about the hinge2's axis 1, torque2 about the hinge2's axis 2.
ODE_API void dJointSetUniversalAnchor (dJointID, dReal x, dReal y, dReal z)
 set anchor
ODE_API void dJointSetUniversalAxis1 (dJointID, dReal x, dReal y, dReal z)
 set axis
ODE_API void dJointSetUniversalAxis1Offset (dJointID, dReal x, dReal y, dReal z, dReal offset1, dReal offset2)
 Set the Universal axis1 as if the 2 bodies were already at offset1 and offset2 appart with respect to axis1 and axis2.

This function initialize the axis1 and the relative orientation of each body as if body1 was rotated around the new axis1 by the offset1 value and as if body2 was rotated around the axis2 by offset2. Ex:.

ODE_API void dJointSetUniversalAxis2 (dJointID, dReal x, dReal y, dReal z)
 set axis
ODE_API void dJointSetUniversalAxis2Offset (dJointID, dReal x, dReal y, dReal z, dReal offset1, dReal offset2)
 Set the Universal axis2 as if the 2 bodies were already at offset1 and offset2 appart with respect to axis1 and axis2.

This function initialize the axis2 and the relative orientation of each body as if body1 was rotated around the axis1 by the offset1 value and as if body2 was rotated around the new axis2 by offset2. Ex:.

ODE_API void dJointSetUniversalParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointAddUniversalTorques (dJointID joint, dReal torque1, dReal torque2)
 Applies torque1 about the universal's axis 1, torque2 about the universal's axis 2.
ODE_API void dJointSetPRAnchor (dJointID, dReal x, dReal y, dReal z)
 set anchor
ODE_API void dJointSetPRAxis1 (dJointID, dReal x, dReal y, dReal z)
 set the axis for the prismatic articulation
ODE_API void dJointSetPRAxis2 (dJointID, dReal x, dReal y, dReal z)
 set the axis for the rotoide articulation
ODE_API void dJointSetPRParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointAddPRTorque (dJointID j, dReal torque)
 Applies the torque about the rotoide axis of the PR joint.
ODE_API void dJointSetPUAnchor (dJointID, dReal x, dReal y, dReal z)
 set anchor
ODE_API_DEPRECATED ODE_API void dJointSetPUAnchorDelta (dJointID, dReal x, dReal y, dReal z, dReal dx, dReal dy, dReal dz)
 set anchor
ODE_API void dJointSetPUAnchorOffset (dJointID, dReal x, dReal y, dReal z, dReal dx, dReal dy, dReal dz)
 Set the PU anchor as if the 2 bodies were already at [dx, dy, dz] appart.

This function initialize the anchor and the relative position of each body as if the position between body1 and body2 was already the projection of [dx, dy, dz] along the Piston axis. (i.e as if the body1 was at its current position - [dx,dy,dy] when the axis is set). Ex:.

ODE_API void dJointSetPUAxis1 (dJointID, dReal x, dReal y, dReal z)
 set the axis for the first axis or the universal articulation
ODE_API void dJointSetPUAxis2 (dJointID, dReal x, dReal y, dReal z)
 set the axis for the second axis or the universal articulation
ODE_API void dJointSetPUAxis3 (dJointID, dReal x, dReal y, dReal z)
 set the axis for the prismatic articulation
ODE_API void dJointSetPUAxisP (dJointID id, dReal x, dReal y, dReal z)
 set the axis for the prismatic articulation
ODE_API void dJointSetPUParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointAddPUTorque (dJointID j, dReal torque)
 Applies the torque about the rotoide axis of the PU joint.
ODE_API void dJointSetPistonAnchor (dJointID, dReal x, dReal y, dReal z)
 set the joint anchor
ODE_API void dJointSetPistonAnchorOffset (dJointID j, dReal x, dReal y, dReal z, dReal dx, dReal dy, dReal dz)
 Set the Piston anchor as if the 2 bodies were already at [dx,dy, dz] appart.

This function initialize the anchor and the relative position of each body as if the position between body1 and body2 was already the projection of [dx, dy, dz] along the Piston axis. (i.e as if the body1 was at its current position - [dx,dy,dy] when the axis is set). Ex:.

ODE_API void dJointSetPistonAxis (dJointID, dReal x, dReal y, dReal z)
 set the joint axis
ODE_API_DEPRECATED ODE_API void dJointSetPistonAxisDelta (dJointID j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az)
ODE_API void dJointSetPistonParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointAddPistonForce (dJointID joint, dReal force)
 Applies the given force in the slider's direction.
ODE_API void dJointSetFixed (dJointID)
 Call this on the fixed joint after it has been attached to remember the current desired relative offset and desired relative rotation between the bodies.
ODE_API void dJointSetAMotorNumAxes (dJointID, int num)
 set the nr of axes
ODE_API void dJointSetAMotorAxis (dJointID, int anum, int rel, dReal x, dReal y, dReal z)
 set axis
ODE_API void dJointSetAMotorAngle (dJointID, int anum, dReal angle)
 Tell the AMotor what the current angle is along axis anum.
ODE_API void dJointSetAMotorParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointSetAMotorMode (dJointID, int mode)
 set mode
ODE_API void dJointAddAMotorTorques (dJointID, dReal torque1, dReal torque2, dReal torque3)
 Applies torque0 about the AMotor's axis 0, torque1 about the AMotor's axis 1, and torque2 about the AMotor's axis 2.
ODE_API void dJointSetLMotorNumAxes (dJointID, int num)
 Set the number of axes that will be controlled by the LMotor.
ODE_API void dJointSetLMotorAxis (dJointID, int anum, int rel, dReal x, dReal y, dReal z)
 Set the AMotor axes.
ODE_API void dJointSetLMotorParam (dJointID, int parameter, dReal value)
 set joint parameter
ODE_API void dJointSetPlane2DXParam (dJointID, int parameter, dReal value)
ODE_API void dJointSetPlane2DYParam (dJointID, int parameter, dReal value)
ODE_API void dJointSetPlane2DAngleParam (dJointID, int parameter, dReal value)
ODE_API dReal dJointGetBallParam (dJointID, int parameter)
 get joint parameter
ODE_API void dJointGetHingeAnchor (dJointID, dVector3 result)
 Get the hinge anchor point, in world coordinates.
ODE_API void dJointGetHingeAnchor2 (dJointID, dVector3 result)
 Get the joint anchor point, in world coordinates.
ODE_API void dJointGetHingeAxis (dJointID, dVector3 result)
 get axis
ODE_API dReal dJointGetHingeParam (dJointID, int parameter)
 get joint parameter
ODE_API dReal dJointGetHingeAngle (dJointID)
 Get the hinge angle.
ODE_API dReal dJointGetHingeAngleRate (dJointID)
 Get the hinge angle time derivative.
ODE_API dReal dJointGetSliderPosition (dJointID)
 Get the slider linear position (i.e. the slider's extension).
ODE_API dReal dJointGetSliderPositionRate (dJointID)
 Get the slider linear position's time derivative.
ODE_API void dJointGetSliderAxis (dJointID, dVector3 result)
 Get the slider axis.
ODE_API dReal dJointGetSliderParam (dJointID, int parameter)
 get joint parameter
ODE_API void dJointGetHinge2Anchor (dJointID, dVector3 result)
 Get the joint anchor point, in world coordinates.
ODE_API void dJointGetHinge2Anchor2 (dJointID, dVector3 result)
 Get the joint anchor point, in world coordinates. This returns the point on body 2. If the joint is perfectly satisfied, this will return the same value as dJointGetHinge2Anchor. If not, this value will be slightly different. This can be used, for example, to see how far the joint has come apart.
ODE_API void dJointGetHinge2Axis1 (dJointID, dVector3 result)
 Get joint axis.
ODE_API void dJointGetHinge2Axis2 (dJointID, dVector3 result)
 Get joint axis.
ODE_API dReal dJointGetHinge2Param (dJointID, int parameter)
 get joint parameter
ODE_API dReal dJointGetHinge2Angle1 (dJointID)
 Get angle.
ODE_API dReal dJointGetHinge2Angle1Rate (dJointID)
 Get time derivative of angle.
ODE_API dReal dJointGetHinge2Angle2Rate (dJointID)
 Get time derivative of angle.
ODE_API void dJointGetUniversalAnchor (dJointID, dVector3 result)
 Get the joint anchor point, in world coordinates.
ODE_API void dJointGetUniversalAnchor2 (dJointID, dVector3 result)
 Get the joint anchor point, in world coordinates.
ODE_API void dJointGetUniversalAxis1 (dJointID, dVector3 result)
 Get axis.
ODE_API void dJointGetUniversalAxis2 (dJointID, dVector3 result)
 Get axis.
ODE_API dReal dJointGetUniversalParam (dJointID, int parameter)
 get joint parameter
ODE_API void dJointGetUniversalAngles (dJointID, dReal *angle1, dReal *angle2)
 Get both angles at the same time.
ODE_API dReal dJointGetUniversalAngle1 (dJointID)
 Get angle.
ODE_API dReal dJointGetUniversalAngle2 (dJointID)
 Get angle.
ODE_API dReal dJointGetUniversalAngle1Rate (dJointID)
 Get time derivative of angle.
ODE_API dReal dJointGetUniversalAngle2Rate (dJointID)
 Get time derivative of angle.
ODE_API void dJointGetPRAnchor (dJointID, dVector3 result)
 Get the joint anchor point, in world coordinates.
ODE_API dReal dJointGetPRPosition (dJointID)
 Get the PR linear position (i.e. the prismatic's extension).
ODE_API dReal dJointGetPRPositionRate (dJointID)
 Get the PR linear position's time derivative.
ODE_API dReal dJointGetPRAngle (dJointID)
 Get the PR angular position (i.e. the twist between the 2 bodies).
ODE_API dReal dJointGetPRAngleRate (dJointID)
 Get the PR angular position's time derivative.
ODE_API void dJointGetPRAxis1 (dJointID, dVector3 result)
 Get the prismatic axis.
ODE_API void dJointGetPRAxis2 (dJointID, dVector3 result)
 Get the Rotoide axis.
ODE_API dReal dJointGetPRParam (dJointID, int parameter)
 get joint parameter
ODE_API void dJointGetPUAnchor (dJointID, dVector3 result)
 Get the joint anchor point, in world coordinates.
ODE_API dReal dJointGetPUPosition (dJointID)
 Get the PU linear position (i.e. the prismatic's extension).
ODE_API dReal dJointGetPUPositionRate (dJointID)
 Get the PR linear position's time derivative.
ODE_API void dJointGetPUAxis1 (dJointID, dVector3 result)
 Get the first axis of the universal component of the joint.
ODE_API void dJointGetPUAxis2 (dJointID, dVector3 result)
 Get the second axis of the Universal component of the joint.
ODE_API void dJointGetPUAxis3 (dJointID, dVector3 result)
 Get the prismatic axis.
ODE_API void dJointGetPUAxisP (dJointID id, dVector3 result)
 Get the prismatic axis.
ODE_API void dJointGetPUAngles (dJointID, dReal *angle1, dReal *angle2)
 Get both angles at the same time.
ODE_API dReal dJointGetPUAngle1 (dJointID)
 Get angle.
ODE_API dReal dJointGetPUAngle1Rate (dJointID)
 *
ODE_API dReal dJointGetPUAngle2 (dJointID)
 Get angle.
ODE_API dReal dJointGetPUAngle2Rate (dJointID)
 *
ODE_API dReal dJointGetPUParam (dJointID, int parameter)
 get joint parameter
ODE_API dReal dJointGetPistonPosition (dJointID)
 Get the Piston linear position (i.e. the piston's extension).
ODE_API dReal dJointGetPistonPositionRate (dJointID)
 Get the piston linear position's time derivative.
ODE_API dReal dJointGetPistonAngle (dJointID)
 Get the Piston angular position (i.e. the twist between the 2 bodies).
ODE_API dReal dJointGetPistonAngleRate (dJointID)
 Get the piston angular position's time derivative.
ODE_API void dJointGetPistonAnchor (dJointID, dVector3 result)
 Get the joint anchor.
ODE_API void dJointGetPistonAnchor2 (dJointID, dVector3 result)
 Get the joint anchor w.r.t. body 2.
ODE_API void dJointGetPistonAxis (dJointID, dVector3 result)
 Get the prismatic axis (This is also the rotoide axis.
ODE_API dReal dJointGetPistonParam (dJointID, int parameter)
 get joint parameter
ODE_API int dJointGetAMotorNumAxes (dJointID)
 Get the number of angular axes that will be controlled by the AMotor.
ODE_API void dJointGetAMotorAxis (dJointID, int anum, dVector3 result)
 Get the AMotor axes.
ODE_API int dJointGetAMotorAxisRel (dJointID, int anum)
 Get axis.
ODE_API dReal dJointGetAMotorAngle (dJointID, int anum)
 Get the current angle for axis.
ODE_API dReal dJointGetAMotorAngleRate (dJointID, int anum)
 Get the current angle rate for axis anum.
ODE_API dReal dJointGetAMotorParam (dJointID, int parameter)
 get joint parameter
ODE_API int dJointGetAMotorMode (dJointID)
 Get the angular motor mode.
ODE_API int dJointGetLMotorNumAxes (dJointID)
 Get nr of axes.
ODE_API void dJointGetLMotorAxis (dJointID, int anum, dVector3 result)
 Get axis.
ODE_API dReal dJointGetLMotorParam (dJointID, int parameter)
 get joint parameter
ODE_API dReal dJointGetFixedParam (dJointID, int parameter)
 get joint parameter
ODE_API dJointID dConnectingJoint (dBodyID, dBodyID)
ODE_API int dConnectingJointList (dBodyID, dBodyID, dJointID *)
ODE_API int dAreConnected (dBodyID, dBodyID)
 Utility function.
ODE_API int dAreConnectedExcluding (dBodyID body1, dBodyID body2, int joint_type)
 Utility function.

Detailed Description

In real life a joint is something like a hinge, that is used to connect two objects. In ODE a joint is very similar: It is a relationship that is enforced between two bodies so that they can only have certain positions and orientations relative to each other. This relationship is called a constraint -- the words joint and constraint are often used interchangeably.

A joint has a set of parameters that can be set. These include:

If a particular parameter is not implemented by a given joint, setting it will have no effect. These parameter names can be optionally followed by a digit (2 or 3) to indicate the second or third set of parameters, e.g. for the second axis in a hinge-2 joint, or the third axis in an AMotor joint.

Function Documentation

ODE_API int dAreConnected ( dBodyID  ,
dBodyID   
)

Utility function.

Returns:
1 if the two bodies are connected together by a joint, otherwise return 0.

ODE_API int dAreConnectedExcluding ( dBodyID  body1,
dBodyID  body2,
int  joint_type 
)

Utility function.

Returns:
1 if the two bodies are connected together by a joint that does not have type
  • {joint_type}, otherwise return 0.
Parameters:
body1 A body to check.
body2 A body to check.
joint_type is a dJointTypeXXX constant. This is useful for deciding whether to add contact joints between two bodies: if they are already connected by non-contact joints then it may not be appropriate to add contacts, however it is okay to add more contact between- bodies that already have contacts.

ODE_API void dJointAddAMotorTorques ( dJointID  ,
dReal  torque1,
dReal  torque2,
dReal  torque3 
)

Applies torque0 about the AMotor's axis 0, torque1 about the AMotor's axis 1, and torque2 about the AMotor's axis 2.

Remarks:
If the motor has fewer than three axes, the higher torques are ignored. This function is just a wrapper for dBodyAddTorque().

ODE_API void dJointAddHinge2Torques ( dJointID  joint,
dReal  torque1,
dReal  torque2 
)

Applies torque1 about the hinge2's axis 1, torque2 about the hinge2's axis 2.

Remarks:
This function is just a wrapper for dBodyAddTorque().

ODE_API void dJointAddHingeTorque ( dJointID  joint,
dReal  torque 
)

Applies the torque about the hinge axis.

That is, it applies a torque with specified magnitude in the direction of the hinge axis, to body 1, and with the same magnitude but in opposite direction to body 2. This function is just a wrapper for dBodyAddTorque()}

ODE_API void dJointAddPistonForce ( dJointID  joint,
dReal  force 
)

Applies the given force in the slider's direction.

That is, it applies a force with specified magnitude, in the direction of prismatic's axis, to body1, and with the same magnitude but opposite direction to body2. This function is just a wrapper for dBodyAddForce().

ODE_API void dJointAddPRTorque ( dJointID  j,
dReal  torque 
)

Applies the torque about the rotoide axis of the PR joint.

That is, it applies a torque with specified magnitude in the direction of the rotoide axis, to body 1, and with the same magnitude but in opposite direction to body 2. This function is just a wrapper for dBodyAddTorque()}

ODE_API void dJointAddPUTorque ( dJointID  j,
dReal  torque 
)

Applies the torque about the rotoide axis of the PU joint.

That is, it applies a torque with specified magnitude in the direction of the rotoide axis, to body 1, and with the same magnitude but in opposite direction to body 2. This function is just a wrapper for dBodyAddTorque()}

ODE_API void dJointAddSliderForce ( dJointID  joint,
dReal  force 
)

Applies the given force in the slider's direction.

That is, it applies a force with specified magnitude, in the direction of slider's axis, to body1, and with the same magnitude but opposite direction to body2. This function is just a wrapper for dBodyAddForce().

ODE_API void dJointAddUniversalTorques ( dJointID  joint,
dReal  torque1,
dReal  torque2 
)

Applies torque1 about the universal's axis 1, torque2 about the universal's axis 2.

Remarks:
This function is just a wrapper for dBodyAddTorque().

ODE_API void dJointAttach ( dJointID  ,
dBodyID  body1,
dBodyID  body2 
)

Attach the joint to some new bodies.

If the joint is already attached, it will be detached from the old bodies first. To attach this joint to only one body, set body1 or body2 to zero - a zero body refers to the static environment. Setting both bodies to zero puts the joint into "limbo", i.e. it will have no effect on the simulation.

Remarks:
Some joints, like hinge-2 need to be attached to two bodies to work.

ODE_API dJointID dJointCreateAMotor ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the A-motor type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateBall ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the ball type.

Remarks:
The joint is initially in "limbo" (i.e. it has no effect on the simulation) because it does not connect to any bodies.
Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateContact ( dWorldID  ,
dJointGroupID  ,
const dContact *   
)

Create a new joint of the contact type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateFixed ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the fixed type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateHinge ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the hinge type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateHinge2 ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the hinge2 type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateLMotor ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the L-motor type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreatePiston ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the Piston type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreatePlane2D ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the plane-2d type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreatePR ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the PR (Prismatic and Rotoide) type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreatePU ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the PU (Prismatic and Universal) type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateSlider ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the slider type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API dJointID dJointCreateUniversal ( dWorldID  ,
dJointGroupID   
)

Create a new joint of the universal type.

Parameters:
dJointGroupID set to 0 to allocate the joint normally. If it is nonzero the joint is allocated in the given joint group.

ODE_API void dJointDisable ( dJointID   ) 

Manually disable a joint.

Remarks:
A disabled joint will not affect the simulation, but will maintain the anchors and axes so it can be enabled later.

ODE_API void dJointEnable ( dJointID   ) 

Manually enable a joint.

Parameters:
dJointID identification of joint.

ODE_API dReal dJointGetAMotorAngle ( dJointID  ,
int  anum 
)

Get the current angle for axis.

Remarks:
In dAMotorUser mode this is simply the value that was set with dJointSetAMotorAngle(). In dAMotorEuler mode this is the corresponding euler angle.

ODE_API dReal dJointGetAMotorAngleRate ( dJointID  ,
int  anum 
)

Get the current angle rate for axis anum.

Remarks:
In dAMotorUser mode this is always zero, as not enough information is available. In dAMotorEuler mode this is the corresponding euler angle rate.

ODE_API void dJointGetAMotorAxis ( dJointID  ,
int  anum,
dVector3  result 
)

Get the AMotor axes.

Parameters:
anum selects the axis to change (0,1 or 2).
rel Each axis can have one of three ``relative orientation'' modes.
  • 0: The axis is anchored to the global frame.
  • 1: The axis is anchored to the first body.
  • 2: The axis is anchored to the second body.

ODE_API int dJointGetAMotorAxisRel ( dJointID  ,
int  anum 
)

Get axis.

Remarks:
The axis vector is always specified in global coordinates regardless of the setting of rel. There are two GetAMotorAxis functions, one to return the axis and one to return the relative mode.
For dAMotorEuler mode:
  • Only axes 0 and 2 need to be set. Axis 1 will be determined automatically at each time step.
  • Axes 0 and 2 must be perpendicular to each other.
  • Axis 0 must be anchored to the first body, axis 2 must be anchored to the second body.

ODE_API int dJointGetAMotorMode ( dJointID   ) 

Get the angular motor mode.

Parameters:
mode must be one of the following constants:
  • dAMotorUser The AMotor axes and joint angle settings are entirely controlled by the user. This is the default mode.
  • dAMotorEuler Euler angles are automatically computed. The axis a1 is also automatically computed. The AMotor axes must be set correctly when in this mode, as described below. When this mode is initially set the current relative orientations of the bodies will correspond to all euler angles at zero.

ODE_API int dJointGetAMotorNumAxes ( dJointID   ) 

Get the number of angular axes that will be controlled by the AMotor.

Parameters:
num can range from 0 (which effectively deactivates the joint) to 3. This is automatically set to 3 in dAMotorEuler mode.

ODE_API dBodyID dJointGetBody ( dJointID  ,
int  index 
)

Return the bodies that this joint connects.

Parameters:
index return the first (0) or second (1) body.
Remarks:
If one of these returned body IDs is zero, the joint connects the other body to the static environment. If both body IDs are zero, the joint is in ``limbo'' and has no effect on the simulation.

ODE_API void dJointGetHinge2Anchor ( dJointID  ,
dVector3  result 
)

Get the joint anchor point, in world coordinates.

Returns:
the point on body 1. If the joint is perfectly satisfied, this will be the same as the point on body 2.

ODE_API void dJointGetHingeAnchor ( dJointID  ,
dVector3  result 
)

Get the hinge anchor point, in world coordinates.

This returns the point on body 1. If the joint is perfectly satisfied, this will be the same as the point on body 2.

ODE_API void dJointGetHingeAnchor2 ( dJointID  ,
dVector3  result 
)

Get the joint anchor point, in world coordinates.

Returns:
The point on body 2. If the joint is perfectly satisfied, this will return the same value as dJointGetHingeAnchor(). If not, this value will be slightly different. This can be used, for example, to see how far the joint has come apart.

ODE_API dReal dJointGetHingeAngle ( dJointID   ) 

Get the hinge angle.

The angle is measured between the two bodies, or between the body and the static environment. The angle will be between -pi..pi. Give the relative rotation with respect to the Hinge axis of Body 1 with respect to Body 2. When the hinge anchor or axis is set, the current position of the attached bodies is examined and that position will be the zero angle.

ODE_API void dJointGetPistonAnchor ( dJointID  ,
dVector3  result 
)

Get the joint anchor.

This returns the point on body 1. If the joint is perfectly satisfied, this will be the same as the point on body 2 in direction perpendicular to the prismatic axis.

ODE_API void dJointGetPistonAnchor2 ( dJointID  ,
dVector3  result 
)

Get the joint anchor w.r.t. body 2.

This returns the point on body 2. You can think of a Piston joint as trying to keep the result of dJointGetPistonAnchor() and dJointGetPistonAnchor2() the same in the direction perpendicular to the pirsmatic axis. If the joint is perfectly satisfied, this function will return the same value as dJointGetPistonAnchor() to within roundoff errors. dJointGetPistonAnchor2() can be used, along with dJointGetPistonAnchor(), to see how far the joint has come apart.

ODE_API dReal dJointGetPistonAngle ( dJointID   ) 

Get the Piston angular position (i.e. the twist between the 2 bodies).

When the axis is set, the current position of the attached bodies is examined and that position will be the zero position.

ODE_API dReal dJointGetPistonPosition ( dJointID   ) 

Get the Piston linear position (i.e. the piston's extension).

When the axis is set, the current position of the attached bodies is examined and that position will be the zero position.

ODE_API void dJointGetPRAnchor ( dJointID  ,
dVector3  result 
)

Get the joint anchor point, in world coordinates.

Returns:
the point on body 1. If the joint is perfectly satisfied, this will be the same as the point on body 2.

ODE_API dReal dJointGetPRAngle ( dJointID   ) 

Get the PR angular position (i.e. the twist between the 2 bodies).

When the axis is set, the current position of the attached bodies is examined and that position will be the zero position.

ODE_API dReal dJointGetPRPosition ( dJointID   ) 

Get the PR linear position (i.e. the prismatic's extension).

When the axis is set, the current position of the attached bodies is examined and that position will be the zero position.

The position is the "oriented" length between the position = (Prismatic axis) dot_product [(body1 + offset) - (body2 + anchor2)]

ODE_API void dJointGetPUAnchor ( dJointID  ,
dVector3  result 
)

Get the joint anchor point, in world coordinates.

Returns:
the point on body 1. If the joint is perfectly satisfied, this will be the same as the point on body 2.

ODE_API dReal dJointGetPUAngle1Rate ( dJointID   ) 

*

Get time derivative of angle1

ODE_API dReal dJointGetPUAngle2Rate ( dJointID   ) 

*

Get time derivative of angle2

ODE_API void dJointGetPUAngles ( dJointID  ,
dReal *  angle1,
dReal *  angle2 
)

Get both angles at the same time.

Parameters:
joint The Prismatic universal joint for which we want to calculate the angles
angle1 The angle between the body1 and the axis 1
angle2 The angle between the body2 and the axis 2
Note:
This function combine dJointGetPUAngle1 and dJointGetPUAngle2 together and try to avoid redundant calculation

ODE_API void dJointGetPUAxisP ( dJointID  id,
dVector3  result 
)

Get the prismatic axis.

Note:
This function was added for convenience it is the same as dJointGetPUAxis3

ODE_API dReal dJointGetPUPosition ( dJointID   ) 

Get the PU linear position (i.e. the prismatic's extension).

When the axis is set, the current position of the attached bodies is examined and that position will be the zero position.

The position is the "oriented" length between the position = (Prismatic axis) dot_product [(body1 + offset) - (body2 + anchor2)]

ODE_API dReal dJointGetSliderPosition ( dJointID   ) 

Get the slider linear position (i.e. the slider's extension).

When the axis is set, the current position of the attached bodies is examined and that position will be the zero position.

The position is the distance, with respect to the zero position, along the slider axis of body 1 with respect to body 2. (A NULL body is replaced by the world).

ODE_API dJointType dJointGetType ( dJointID   ) 

Get the type of the joint.

Returns:
the type, being one of these:
  • dJointTypeBall
  • dJointTypeHinge
  • dJointTypeSlider
  • dJointTypeContact
  • dJointTypeUniversal
  • dJointTypeHinge2
  • dJointTypeFixed
  • dJointTypeNull
  • dJointTypeAMotor
  • dJointTypeLMotor
  • dJointTypePlane2D
  • dJointTypePR
  • dJointTypePU
  • dJointTypePiston

ODE_API void dJointGetUniversalAnchor ( dJointID  ,
dVector3  result 
)

Get the joint anchor point, in world coordinates.

Returns:
the point on body 1. If the joint is perfectly satisfied, this will be the same as the point on body 2.

ODE_API void dJointGetUniversalAnchor2 ( dJointID  ,
dVector3  result 
)

Get the joint anchor point, in world coordinates.

Returns:
This returns the point on body 2.
Remarks:
You can think of the ball and socket part of a universal joint as trying to keep the result of dJointGetBallAnchor() and dJointGetBallAnchor2() the same. If the joint is perfectly satisfied, this function will return the same value as dJointGetUniversalAnchor() to within roundoff errors. dJointGetUniversalAnchor2() can be used, along with dJointGetUniversalAnchor(), to see how far the joint has come apart.

ODE_API void dJointGetUniversalAngles ( dJointID  ,
dReal *  angle1,
dReal *  angle2 
)

Get both angles at the same time.

Parameters:
joint The universal joint for which we want to calculate the angles
angle1 The angle between the body1 and the axis 1
angle2 The angle between the body2 and the axis 2
Note:
This function combine getUniversalAngle1 and getUniversalAngle2 together and try to avoid redundant calculation

ODE_API dJointGroupID dJointGroupCreate ( int  max_size  ) 

Create a joint group.

Parameters:
max_size deprecated. Set to 0.

ODE_API int dJointIsEnabled ( dJointID   ) 

Check wether a joint is enabled.

Returns:
1 if a joint is currently enabled or 0 if it is disabled.

ODE_API void dJointSetAMotorAngle ( dJointID  ,
int  anum,
dReal  angle 
)

Tell the AMotor what the current angle is along axis anum.

This function should only be called in dAMotorUser mode, because in this mode the AMotor has no other way of knowing the joint angles. The angle information is needed if stops have been set along the axis, but it is not needed for axis motors.

ODE_API void dJointSetAMotorNumAxes ( dJointID  ,
int  num 
)

set the nr of axes

Parameters:
num 0..3

ODE_API void dJointSetFeedback ( dJointID  ,
dJointFeedback *   
)

Sets the datastructure that is to receive the feedback.

The feedback can be used by the user, so that it is known how much force an individual joint exerts.

ODE_API void dJointSetHingeAxisOffset ( dJointID  j,
dReal  x,
dReal  y,
dReal  z,
dReal  angle 
)

Set the Hinge axis as if the 2 bodies were already at angle appart.

This function initialize the Axis and the relative orientation of each body as if body1 was rotated around the axis by the angle value. Ex:.

 dJointSetHingeAxis(jId, 1, 0, 0);
 // If you request the position you will have: dJointGetHingeAngle(jId) == 0
 dJointSetHingeAxisDelta(jId, 1, 0, 0, 0.23);
 // If you request the position you will have: dJointGetHingeAngle(jId) == 0.23
 

Parameters:
j The Hinge joint ID for which the axis will be set
x The X component of the axis in world frame
y The Y component of the axis in world frame
z The Z component of the axis in world frame
angle The angle for the offset of the relative orientation. As if body1 was rotated by angle when the Axis was set (see below). The rotation is around the new Hinge axis.
Note:
Usually the function dJointSetHingeAxis set the current position of body1 and body2 as the zero angle position. This function set the current position as the if the 2 bodies where angle appart.
Warning:
Calling dJointSetHingeAnchor or dJointSetHingeAxis will reset the "zero" angle position.

ODE_API void dJointSetLMotorAxis ( dJointID  ,
int  anum,
int  rel,
dReal  x,
dReal  y,
dReal  z 
)

Set the AMotor axes.

Parameters:
anum selects the axis to change (0,1 or 2).
rel Each axis can have one of three ``relative orientation'' modes
  • 0: The axis is anchored to the global frame.
  • 1: The axis is anchored to the first body.
  • 2: The axis is anchored to the second body.
Remarks:
The axis vector is always specified in global coordinates regardless of the setting of rel.

ODE_API void dJointSetLMotorNumAxes ( dJointID  ,
int  num 
)

Set the number of axes that will be controlled by the LMotor.

Parameters:
num can range from 0 (which effectively deactivates the joint) to 3.

ODE_API void dJointSetPistonAnchorOffset ( dJointID  j,
dReal  x,
dReal  y,
dReal  z,
dReal  dx,
dReal  dy,
dReal  dz 
)

Set the Piston anchor as if the 2 bodies were already at [dx,dy, dz] appart.

This function initialize the anchor and the relative position of each body as if the position between body1 and body2 was already the projection of [dx, dy, dz] along the Piston axis. (i.e as if the body1 was at its current position - [dx,dy,dy] when the axis is set). Ex:.

 dReal offset = 3;
 dVector3 axis;
 dJointGetPistonAxis(jId, axis);
 dJointSetPistonAnchor(jId, 0, 0, 0);
 // If you request the position you will have: dJointGetPistonPosition(jId) == 0
 dJointSetPistonAnchorOffset(jId, 0, 0, 0, axis[X]*offset, axis[Y]*offset, axis[Z]*offset);
 // If you request the position you will have: dJointGetPistonPosition(jId) == offset
 
Parameters:
j The Piston joint for which the anchor point will be set
x The X position of the anchor point in world frame
y The Y position of the anchor point in world frame
z The Z position of the anchor point in world frame
dx A delta to be substracted to the X position as if the anchor was set when body1 was at current_position[X] - dx
dx A delta to be substracted to the Y position as if the anchor was set when body1 was at current_position[Y] - dy
dx A delta to be substracted to the Z position as if the anchor was set when body1 was at current_position[Z] - dz

ODE_API_DEPRECATED ODE_API void dJointSetPistonAxisDelta ( dJointID  j,
dReal  x,
dReal  y,
dReal  z,
dReal  ax,
dReal  ay,
dReal  az 
)

This function set prismatic axis of the joint and also set the position of the joint.

Parameters:
j The joint affected by this function
x The x component of the axis
y The y component of the axis
z The z component of the axis
dx The Initial position of the prismatic join in the x direction
dy The Initial position of the prismatic join in the y direction
dz The Initial position of the prismatic join in the z direction

ODE_API void dJointSetPRParam ( dJointID  ,
int  parameter,
dReal  value 
)

set joint parameter

Note:
parameterX where X equal 2 refer to parameter for the rotoide articulation

ODE_API void dJointSetPUAnchorOffset ( dJointID  ,
dReal  x,
dReal  y,
dReal  z,
dReal  dx,
dReal  dy,
dReal  dz 
)

Set the PU anchor as if the 2 bodies were already at [dx, dy, dz] appart.

This function initialize the anchor and the relative position of each body as if the position between body1 and body2 was already the projection of [dx, dy, dz] along the Piston axis. (i.e as if the body1 was at its current position - [dx,dy,dy] when the axis is set). Ex:.

 dReal offset = 3;
 dVector3 axis;
 dJointGetPUAxis(jId, axis);
 dJointSetPUAnchor(jId, 0, 0, 0);
 // If you request the position you will have: dJointGetPUPosition(jId) == 0
 dJointSetPUAnchorOffset(jId, 0, 0, 0, axis[X]*offset, axis[Y]*offset, axis[Z]*offset);
 // If you request the position you will have: dJointGetPUPosition(jId) == offset
 
Parameters:
j The PU joint for which the anchor point will be set
x The X position of the anchor point in world frame
y The Y position of the anchor point in world frame
z The Z position of the anchor point in world frame
dx A delta to be substracted to the X position as if the anchor was set when body1 was at current_position[X] - dx
dx A delta to be substracted to the Y position as if the anchor was set when body1 was at current_position[Y] - dy
dx A delta to be substracted to the Z position as if the anchor was set when body1 was at current_position[Z] - dz

ODE_API void dJointSetPUAxisP ( dJointID  id,
dReal  x,
dReal  y,
dReal  z 
)

set the axis for the prismatic articulation

Note:
This function was added for convenience it is the same as dJointSetPUAxis3

ODE_API void dJointSetPUParam ( dJointID  ,
int  parameter,
dReal  value 
)

set joint parameter

Note:
parameterX where X equal 2 refer to parameter for second axis of the universal articulation

parameterX where X equal 3 refer to parameter for prismatic articulation

ODE_API void dJointSetUniversalAxis1Offset ( dJointID  ,
dReal  x,
dReal  y,
dReal  z,
dReal  offset1,
dReal  offset2 
)

Set the Universal axis1 as if the 2 bodies were already at offset1 and offset2 appart with respect to axis1 and axis2.

This function initialize the axis1 and the relative orientation of each body as if body1 was rotated around the new axis1 by the offset1 value and as if body2 was rotated around the axis2 by offset2. Ex:.

 dJointSetHuniversalAxis1(jId, 1, 0, 0);
 // If you request the position you will have: dJointGetUniversalAngle1(jId) == 0
 // If you request the position you will have: dJointGetUniversalAngle2(jId) == 0
 dJointSetHuniversalAxis1Offset(jId, 1, 0, 0, 0.2, 0.17);
 // If you request the position you will have: dJointGetUniversalAngle1(jId) == 0.2
 // If you request the position you will have: dJointGetUniversalAngle2(jId) == 0.17
 

Parameters:
j The Hinge joint ID for which the axis will be set
x The X component of the axis in world frame
y The Y component of the axis in world frame
z The Z component of the axis in world frame
angle The angle for the offset of the relative orientation. As if body1 was rotated by angle when the Axis was set (see below). The rotation is around the new Hinge axis.
Note:
Usually the function dJointSetHingeAxis set the current position of body1 and body2 as the zero angle position. This function set the current position as the if the 2 bodies where offsets appart.

Any previous offsets are erased.

Warning:
Calling dJointSetUniversalAnchor, dJointSetUnivesalAxis1, dJointSetUniversalAxis2, dJointSetUniversalAxis2Offset will reset the "zero" angle position.

ODE_API void dJointSetUniversalAxis2Offset ( dJointID  ,
dReal  x,
dReal  y,
dReal  z,
dReal  offset1,
dReal  offset2 
)

Set the Universal axis2 as if the 2 bodies were already at offset1 and offset2 appart with respect to axis1 and axis2.

This function initialize the axis2 and the relative orientation of each body as if body1 was rotated around the axis1 by the offset1 value and as if body2 was rotated around the new axis2 by offset2. Ex:.

 dJointSetHuniversalAxis2(jId, 0, 1, 0);
 // If you request the position you will have: dJointGetUniversalAngle1(jId) == 0
 // If you request the position you will have: dJointGetUniversalAngle2(jId) == 0
 dJointSetHuniversalAxis2Offset(jId, 0, 1, 0, 0.2, 0.17);
 // If you request the position you will have: dJointGetUniversalAngle1(jId) == 0.2
 // If you request the position you will have: dJointGetUniversalAngle2(jId) == 0.17
 

Parameters:
j The Hinge joint ID for which the axis will be set
x The X component of the axis in world frame
y The Y component of the axis in world frame
z The Z component of the axis in world frame
angle The angle for the offset of the relative orientation. As if body1 was rotated by angle when the Axis was set (see below). The rotation is around the new Hinge axis.
Note:
Usually the function dJointSetHingeAxis set the current position of body1 and body2 as the zero angle position. This function set the current position as the if the 2 bodies where offsets appart.

Any previous offsets are erased.

Warning:
Calling dJointSetUniversalAnchor, dJointSetUnivesalAxis1, dJointSetUniversalAxis2, dJointSetUniversalAxis2Offset will reset the "zero" angle position.


Generated on Sun May 10 15:42:27 2009 for Open Dynamics Engine by  doxygen 1.5.7