#include <Physics_Joint.h>
Inherits DigitalSpaces::DIObjectBase.
Physics joints are used to link together two bodies, and limit the ways in which the bodies can move in relation to each other. The joint types (as specified to DIPhysicsBase::BeginSetup(const char*) ) are:
Not all the functions included in this interface are appropriate for all joint types. When not appropriate, the function should just be silently ignored.
The joint types and the values that are accepted through the Set functions (name, type, default value):
Public Member Functions | |
| void | SetAngularLimits (float fLow, float fHigh, unsigned char cAxis) |
| Limit the degree of motion around the specified axis of the joint. | |
| void | SetLinearLimits (float fLow, float fHigh, unsigned char cAxis) |
| Limit the range of motion along the specified axis of the joint. | |
| float | GetAngularLowLimit (unsigned char axis) |
| Retreive the lower angular limit. | |
| float | GetAngularHighLimit (unsigned char axis) |
| Retreive the higher angular limit. | |
| float | GetLinearLowLimit (unsigned char axis) |
| Retreive the lower linear limit. | |
| float | GetLinearHighLimit (unsigned char axis) |
| Retreive the higher linear limit. | |
| float | GetAngle (unsigned char cAxis) |
| Return the joints rotation, around the specified axis. | |
| float | GetPosition (unsigned char cAxis) |
| Returns the joints position, along the spcified axis. | |
| float | GetAngularVelocity (unsigned char cAxis) |
| Returns the joints rotational velocity (change in orientation) around the specified axis. | |
| float | GetLinearVelocity (unsigned char cAxis) |
| Returns the joints linear velocity (change in position) along the specified axis. | |
| void | SetMotorParameters (float fVelocity, float fForce, unsigned int motor) |
| Set the target speed and maximum force to be used by the physics simulation, to simulate a motorized joint. | |
| float | GetMotorVelocity (unsigned int motor) |
| Return the motor velocity setting, as set via SetMotorParameters. | |
| float | GetMotorForce (unsigned int motor) |
| Return the motor force setting, as set via SetMotorParameters. | |
| void | ApplyForce (float fForce, unsigned char cAxis) |
| Apply a linear force along the specified axis of the joint. | |
| void | ApplyTorque (float fTorque, unsigned char cAxis) |
| Apply a rotational force around the specified axis of the joint. | |
| DIPhysicsBody * | GetBody () |
| Returns one of the bodies this joint is attached to. | |
| DIPhysicsBody * | GetOtherBody () |
| Returns the other body this joint is attached to. | |
| void DigitalSpaces::DIPhysicsJoint::SetAngularLimits | ( | float | fLow, | |
| float | fHigh, | |||
| unsigned char | cAxis | |||
| ) |
Limit the degree of motion around the specified axis of the joint.
Setting fLow equal to fHigh will result in a limit being placed, however it is often not stable.
| fLow | The lower limit, between pi and -pi, measured in radians from the joints default position. | |
| fHigh | The upper limit, between pi and -pi, measured in radians from the joints default position. | |
| cAxis | Zero based index of which axis to limit, used for multi-axis joints. |
| void DigitalSpaces::DIPhysicsJoint::SetLinearLimits | ( | float | fLow, | |
| float | fHigh, | |||
| unsigned char | cAxis | |||
| ) |
Limit the range of motion along the specified axis of the joint.
Setting fLow equal to fHigh will result in a limit being placed, however it is often not stable.
| fLow | The lower limit, measured in meters from the joints default position. | |
| fHigh | The upper limit, measured in meters from the joints default position. | |
| cAxis | Zero based index of which axis to limit, used for multi-axis joints. |
| float DigitalSpaces::DIPhysicsJoint::GetAngularLowLimit | ( | unsigned char | axis | ) |
Retreive the lower angular limit.
| axis | Zero based index of which axis to limit, used for multi-axis joints. |
| float DigitalSpaces::DIPhysicsJoint::GetAngularHighLimit | ( | unsigned char | axis | ) |
Retreive the higher angular limit.
| axis | Zero based index of which axis to limit, used for multi-axis joints. |
| float DigitalSpaces::DIPhysicsJoint::GetLinearLowLimit | ( | unsigned char | axis | ) |
Retreive the lower linear limit.
| axis | Zero based index of which axis to limit, used for multi-axis joints. |
| float DigitalSpaces::DIPhysicsJoint::GetLinearHighLimit | ( | unsigned char | axis | ) |
Retreive the higher linear limit.
| axis | Zero based index of which axis to limit, used for multi-axis joints. |
| float DigitalSpaces::DIPhysicsJoint::GetAngle | ( | unsigned char | cAxis | ) |
Return the joints rotation, around the specified axis.
| cAxis | Zero based index of which axis to limit, used for multi-axis joints. |
| float DigitalSpaces::DIPhysicsJoint::GetPosition | ( | unsigned char | cAxis | ) |
Returns the joints position, along the spcified axis.
| cAxis | Zero based index of which axis to limit, used for multi-axis joints. |
| float DigitalSpaces::DIPhysicsJoint::GetAngularVelocity | ( | unsigned char | cAxis | ) |
Returns the joints rotational velocity (change in orientation) around the specified axis.
| cAxis | Zero based index of which axis to return value for. |
| float DigitalSpaces::DIPhysicsJoint::GetLinearVelocity | ( | unsigned char | cAxis | ) |
Returns the joints linear velocity (change in position) along the specified axis.
| cAxis | Zero based index of which axis to return value for. |
| void DigitalSpaces::DIPhysicsJoint::SetMotorParameters | ( | float | fVelocity, | |
| float | fForce, | |||
| unsigned int | motor | |||
| ) |
Set the target speed and maximum force to be used by the physics simulation, to simulate a motorized joint.
| fVelocity | Target velocity of the joint. Depending on the joint type, this is measured in radians per second (hinge, hinge2) or meters per second (slider). | |
| fForce | Maximum for usable by the simulation to accelerate the joint to the specified velocity, and to keep it there. Setting this to zero disables the motor. | |
| motor | Specifies which axis of a multi axis joint should be motorized. This is only applicable for hinge2, where 0 motorizes the "wheel" joint, and 1 motorizes the "steering" joint. |
| float DigitalSpaces::DIPhysicsJoint::GetMotorVelocity | ( | unsigned int | motor | ) |
Return the motor velocity setting, as set via SetMotorParameters.
| motor | Specifies which axis of a multi axis joint to return the value for. |
| float DigitalSpaces::DIPhysicsJoint::GetMotorForce | ( | unsigned int | motor | ) |
Return the motor force setting, as set via SetMotorParameters.
| motor | Specifies which axis of a multi axis joint to return the value for. |
| void DigitalSpaces::DIPhysicsJoint::ApplyForce | ( | float | fForce, | |
| unsigned char | cAxis | |||
| ) |
Apply a linear force along the specified axis of the joint.
This will effectively apply the force to each of the jointed bodies, in opposite directions.
| fForce | Force to apply, measured in newtons (I think). | |
| cAxis | Zero based index of which axis to apply the force along. |
| void DigitalSpaces::DIPhysicsJoint::ApplyTorque | ( | float | fTorque, | |
| unsigned char | cAxis | |||
| ) |
Apply a rotational force around the specified axis of the joint.
This will effectively apply the torque to each of the jointed bodies, in opposite directions.
| fTorque | Torque to apply, measured in newtonmeters (I think). | |
| cAxis | Zero based index of which axis to apply the torque around. |
| DIPhysicsBody* DigitalSpaces::DIPhysicsJoint::GetBody | ( | ) |
Returns one of the bodies this joint is attached to.
| DIPhysicsBody* DigitalSpaces::DIPhysicsJoint::GetOtherBody | ( | ) |
Returns the other body this joint is attached to.
1.5.6