org.ode4j.ode
Interface DUniversalJoint

All Superinterfaces:
DJoint

public interface DUniversalJoint
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 addTorques(double torque1, double torque2)
          Applies torque1 about the universal's axis 1, torque2 about the universal's axis 2.
 void getAnchor(DVector3 result)
          Get the joint anchor point, in world coordinates.
 void getAnchor2(DVector3 result)
          Get the joint anchor point, in world coordinates.
 double getAngle1()
          Get angle between body the 1 and the axis 1.
 double getAngle1Rate()
          Get time derivative of angle.
 double getAngle2()
          Get angle between body the 2 and the axis 2.
 double getAngle2Rate()
          Get time derivative of angle.
 void getAxis1(DVector3 result)
          Get axis.
 void getAxis2(DVector3 result)
          Get axis.
 double getParam(DJoint.PARAM_N parameter)
          Get joint parameter.
 void setAnchor(double x, double y, double z)
          Set anchor.
 void setAnchor(DVector3C a)
          Set anchor.
 void setAxis1(double x, double y, double z)
          Set axis.
 void setAxis1(DVector3C a)
          Set axis.
 void setAxis1Offset(double x, double y, double z, double offset1, double offset2)
          Set the Universal axis1 as if the 2 bodies were already at offset1 and offset2 appart with respect to axis1 and axis2.
 void setAxis2(double x, double y, double z)
          Set axis.
 void setAxis2(DVector3C a)
          Set axis.
 void setAxis2Offset(double x, double y, double z, double offset1, double offset2)
          Set the Universal axis2 as if the 2 bodies were already at offset1 and offset2 appart with respect to axis1 and axis2.
 void setParam(DJoint.PARAM_N parameter, double value)
          Set joint parameter.
 
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 anchor.


setAnchor

void setAnchor(DVector3C a)
Set anchor.


setAxis1

void setAxis1(double x,
              double y,
              double z)
Set axis.


setAxis1

void setAxis1(DVector3C a)
Set axis.


setAxis2

void setAxis2(double x,
              double y,
              double z)
Set axis.


setAxis2

void setAxis2(DVector3C a)
Set axis.


getAnchor

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

Remark:
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.

getAxis1

void getAxis1(DVector3 result)
Get axis.


getAxis2

void getAxis2(DVector3 result)
Get axis.


getAngle1

double getAngle1()
Get angle between body the 1 and the axis 1.


getAngle2

double getAngle2()
Get angle between body the 2 and the axis 2.


getAngle1Rate

double getAngle1Rate()
Get time derivative of angle.


getAngle2Rate

double getAngle2Rate()
Get time derivative of angle.


addTorques

void addTorques(double torque1,
                double torque2)
Applies torque1 about the universal's axis 1, torque2 about the universal's axis 2.

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

setAxis1Offset

void setAxis1Offset(double x,
                    double y,
                    double z,
                    double offset1,
                    double 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:
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
offset1 - 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.
offset2 -
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 offsets appart., Any previous offsets are erased.
Warning:
Calling dJointSetUniversalAnchor, dJointSetUnivesalAxis1, dJointSetUniversalAxis2, dJointSetUniversalAxis2Offset will reset the "zero" angle position.

setAxis2Offset

void setAxis2Offset(double x,
                    double y,
                    double z,
                    double offset1,
                    double 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:
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
offset1 - 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.
offset2 -
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 offsets apart., Any previous offsets are erased.
Warning:
Calling dJointSetUniversalAnchor, dJointSetUnivesalAxis1, dJointSetUniversalAxis2, dJointSetUniversalAxis2Offset will reset the "zero" angle position.

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