org.ode4j.ode
Interface DHingeJoint

All Superinterfaces:
DJoint

public interface DHingeJoint
extends DJoint


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ode4j.ode.DJoint
DJoint.DJointFeedback, DJoint.PARAM, DJoint.PARAM_GROUPS, DJoint.PARAM_N
 
Field Summary
 
Fields inherited from interface org.ode4j.ode.DJoint
P_OFS_1, P_OFS_2, P_OFS_3
 
Method Summary
 void addTorque(double torque)
          Applies the torque about the hinge axis.
 void getAnchor(DVector3 result)
          Get the hinge anchor point, in world coordinates.
 void getAnchor2(DVector3 result)
          Get the joint anchor point, in world coordinates.
 double getAngle()
          Get the hinge angle.
 double getAngleRate()
          Get the hinge angle time derivative.
 void getAxis(DVector3 result)
          Get axis.
 double getParam(DJoint.PARAM_N parameter)
          Get joint parameter.
 void setAnchor(double x, double y, double z)
          Set hinge anchor parameter.
 void setAnchor(DVector3C a)
          Set hinge anchor parameter.
 void setAxis(double x, double y, double z)
          Set hinge axis.
 void setAxis(DVector3C a)
          Set hinge axis.
 void setAxisOffset(double x, double y, double z, double angle)
          Set the Hinge axis as if the 2 bodies were already at angle apart.
 void setParam(DJoint.PARAM_N parameter, double value)
          Set joint parameter.
 void setParamBounce(double d)
           
 void setParamFMax(double d)
           
 void setParamHiStop(double d)
           
 void setParamLoStop(double d)
           
 void setParamVel(double cos)
           
 
Methods inherited from interface org.ode4j.ode.DJoint
attach, DESTRUCTOR, disable, enable, getBody, getData, getFeedback, getNumBodies, isEnabled, setData, setFeedback
 

Method Detail

setAnchor

void setAnchor(double x,
               double y,
               double z)
Set hinge anchor parameter.


setAnchor

void setAnchor(DVector3C a)
Set hinge anchor parameter.


getAnchor

void getAnchor(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.


getAnchor2

void getAnchor2(DVector3 result)
Get the joint anchor point, in world coordinates. Return 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.


setAxis

void setAxis(double x,
             double y,
             double z)
Set hinge axis.


setAxis

void setAxis(DVector3C a)
Set hinge axis.


getAxis

void getAxis(DVector3 result)
Get axis.


setAxisOffset

void setAxisOffset(double x,
                   double y,
                   double z,
                   double angle)
Set the Hinge axis as if the 2 bodies were already at angle apart.

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:
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 \b angle apart.
Warning:
Calling dJointSetHingeAnchor or dJointSetHingeAxis will reset the "zero" angle position.

getAngle

double getAngle()
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.


getAngleRate

double getAngleRate()
Get the hinge angle time derivative.


addTorque

void addTorque(double 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()}


setParamFMax

void setParamFMax(double d)

setParamVel

void setParamVel(double cos)

setParamLoStop

void setParamLoStop(double d)

setParamHiStop

void setParamHiStop(double d)

setParamBounce

void setParamBounce(double d)

setParam

void setParam(DJoint.PARAM_N parameter,
              double value)
Set joint parameter.

Specified by:
setParam in interface DJoint

getParam

double getParam(DJoint.PARAM_N parameter)
Get joint parameter.

Specified by:
getParam in interface DJoint