SoJointHinge2 Class Reference
[libipsa classesJoint Classes]

Defines a hinge-2 joint (combines two hinge joints which intersect in an anchor point). More...

#include <SoJointHinge2.h>

Inheritance diagram for SoJointHinge2:

Inheritance graph
[legend]
Collaboration diagram for SoJointHinge2:

Collaboration graph
[legend]

List of all members.

Public Member Functions

SoSFFloat getAngle ()
SoSFFloat getAngleRate ()
virtual void setParams ()
virtual void setTorque (dReal torque1=0.0f, dReal torque2=0.0f, dReal torque3=0.0f)
 SoJointHinge2 (const SbString &BodyOne="", const SbString &BodyTwo="", const SbString &nodeName="")

Static Public Member Functions

static void initClass ()

Public Attributes

SoSFFloat Bounce
SoSFFloat Bounce2
SoSFFloat CFM
SoSFFloat CFM2
SoSFFloat FudgeFactor
SoSFFloat FudgeFactor2
SoSFFloat HiStop
SoSFFloat HiStop2
SoSFFloat LoStop
SoSFFloat LoStop2
SoSFFloat MaxForce
SoSFFloat MaxForce2
SoSFVec3f soAnchor
SoSFVec3f soAxis1
SoSFVec3f soAxis2
SoSFVec2f soTorque
SoSFFloat StopCFM
SoSFFloat StopCFM2
SoSFFloat StopERP
SoSFFloat StopERP2
SoSFFloat SuspensionCFM
SoSFFloat SuspensionCFM2
SoSFFloat SuspensionERP
SoSFFloat SuspensionERP2
SoSFFloat Velocity
SoSFFloat Velocity2

Protected Member Functions

virtual void createOdeJoint (const dWorldID soWorldId)
virtual SoNode * createVisualisation ()
virtual void updateOdeJointProperties (const SbMatrix &modelMatrix)

Protected Attributes

float initMaxForce [2]
float initVelocity [2]

Private Member Functions

 SO_KIT_HEADER (SoJointHinge2)


Detailed Description

Defines a hinge-2 joint (combines two hinge joints which intersect in an anchor point).

The hinge-2 joint is the same as two hinges connected in series, with different hinge axes.
An example, shown in the picture is the steering wheel of a car,
where one axis allows the wheel to be steered and the other axis allows the wheel to rotate.

hinge2.jpg

A hinge2 joint

Definition at line 34 of file SoJointHinge2.h.


Constructor & Destructor Documentation

SoJointHinge2::SoJointHinge2 ( const SbString &  BodyOne = "",
const SbString &  BodyTwo = "",
const SbString &  nodeName = "" 
)

The parameterized constructor of SoJointHinge2.

Parameters:
BodyOne name of the first body to connect with (default = "")
BodyTwo name of the second body to connect with (default = "")
nodeName name of the node in the Inventor scenegraph

Definition at line 218 of file SoJointHinge2.cpp.

References Bounce, Bounce2, CFM, CFM2, FudgeFactor, FudgeFactor2, HiStop, HiStop2, SoJoint::INIT_CFM, SoJoint::INIT_ERP, LoStop, LoStop2, MaxForce, MaxForce2, soAnchor, soAxis1, soAxis2, soTorque, StopCFM, StopCFM2, StopERP, StopERP2, SuspensionCFM, SuspensionCFM2, SuspensionERP, SuspensionERP2, SoJoint::updateOdeParametersTrigger, Velocity, and Velocity2.


Member Function Documentation

void SoJointHinge2::createOdeJoint ( const dWorldID  soWorldId  )  [protected, virtual]

This method creates a hinge2 joint using the soWorldId and stores initial values.

Parameters:
soWorldId the ODE world ID used for creating the joint

Reimplemented from SoJoint.

Definition at line 300 of file SoJointHinge2.cpp.

References initMaxForce, initVelocity, MaxForce, MaxForce2, SoJoint::soJointGroupId, SoJoint::soJointId, Velocity, and Velocity2.

SoNode * SoJointHinge2::createVisualisation (  )  [protected, virtual]

This method must be overridden by any subclass of SoJoint to return a visualisation matching the joint type.

Reimplemented from SoJoint.

Definition at line 343 of file SoJointHinge2.cpp.

References SoJoint::GenerateCylinderAlignmentRotation(), soAnchor, soAxis1, and soAxis2.

SoSFFloat SoJointHinge2::getAngle (  ) 

Definition at line 415 of file SoJointHinge2.cpp.

References SoJoint::soJointId.

Referenced by GetJointAngle::vExecute().

SoSFFloat SoJointHinge2::getAngleRate (  ) 

Definition at line 422 of file SoJointHinge2.cpp.

References SoJoint::soJointId.

Referenced by GetJointAngleRate::vExecute().

void SoJointHinge2::initClass (  )  [static]

Initialises the class and it's type id variables.

Reimplemented from SoJoint.

Definition at line 206 of file SoJointHinge2.cpp.

void SoJointHinge2::setParams (  )  [virtual]

This method must be overridden by any subclass of SoJoint to set the ODE parameters of the object.

Reimplemented from SoJoint.

Definition at line 388 of file SoJointHinge2.cpp.

References Bounce, Bounce2, CFM, CFM2, FudgeFactor, FudgeFactor2, HiStop, HiStop2, LoStop, LoStop2, MaxForce, MaxForce2, SoJoint::soJointId, StopCFM, StopCFM2, StopERP, StopERP2, SuspensionCFM, SuspensionCFM2, SuspensionERP, SuspensionERP2, Velocity, and Velocity2.

void SoJointHinge2::setTorque ( dReal  torque1 = 0.0f,
dReal  torque2 = 0.0f,
dReal  torque3 = 0.0f 
) [virtual]

This method uses torque1 and torque2 to set torques on the hinge2 joint.

Parameters:
torque1 applied to axis1
torque2 applied to axis2
torque3 UNUSED

Reimplemented from SoJoint.

Definition at line 289 of file SoJointHinge2.cpp.

References SoJoint::soJointId.

SoJointHinge2::SO_KIT_HEADER ( SoJointHinge2   )  [private]

void SoJointHinge2::updateOdeJointProperties ( const SbMatrix &  modelMatrix  )  [protected, virtual]

This method updates the anchor and the axis of the hinge2 joint using the modelMatrix as reference.

Parameters:
modelMatrix model matrix taken from Coin

Reimplemented from SoJoint.

Definition at line 318 of file SoJointHinge2.cpp.

References initMaxForce, initVelocity, MaxForce, MaxForce2, soAnchor, soAxis1, soAxis2, SoJoint::soJointId, Velocity, and Velocity2.


Member Data Documentation

The bouncyness of the stops of axis 1 (default = 0.0). This is a restitution parameter in the range 0..1. 0 means the stops are not bouncy at all, 1 means maximum bouncyness.

Definition at line 60 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

The bouncyness of the stops of axis 2 (default = 0.0). This is a restitution parameter in the range 0..1. 0 means the stops are not bouncy at all, 1 means maximum bouncyness.

Definition at line 72 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

The constraint force mixing (CFM) value used for axis 1 when not at a stop (default = SoJoint::INIT_CFM).

Definition at line 61 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

The constraint force mixing (CFM) value used for axis 2 when not at a stop (default = SoJoint::INIT_CFM).

Definition at line 73 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

(default = 1.0)
The current (ODE) joint stop/motor implementation has a small problem: when the joint is at one stop and the motor is set to move it away from the stop, too much force may be applied for one time step, causing a ``jumping'' motion. This fudge factor is used to scale this excess force. It should have a value between zero and one (the default value). If the jumping motion is too visible in a joint, the value can be reduced. Making this value too small can prevent the motor from being able to move the joint away from a stop.

Definition at line 59 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

(default = 1.0)
The current (ODE) joint stop/motor implementation has a small problem: when the joint is at one stop and the motor is set to move it away from the stop, too much force may be applied for one time step, causing a ``jumping'' motion. This fudge factor is used to scale this excess force. It should have a value between zero and one (the default value). If the jumping motion is too visible in a joint, the value can be reduced. Making this value too small can prevent the motor from being able to move the joint away from a stop.

Definition at line 71 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

High stop for the angle of axis 1 (default = dInfinity). Setting this to dInfinity turns off the high stop. For rotational joints, this stop must be less than pi to be effective.

Warning:
If SoJointHinge2::HiStop is less than SoJointHinge2::LowStop then both stops will be ineffective.

Definition at line 56 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

High stop for the angle of axis 2 (default = dInfinity). Setting this to dInfinity turns off the high stop. For rotational joints, this stop must be less than pi to be effective.

Warning:
If SoJointHinge2::HiStop is less than SoJointHinge2::LowStop then both stops will be ineffective.

Definition at line 68 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

float SoJointHinge2::initMaxForce[2] [protected]

Definition at line 85 of file SoJointHinge2.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

float SoJointHinge2::initVelocity[2] [protected]

Definition at line 84 of file SoJointHinge2.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

Low stop for the angle of axis 1 (default = -dInfinity). Setting this to -dInfinity turns off the low stop. For rotational joints, this stop must be greater than - pi to be effective.

Definition at line 55 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

Low stop for the angle of axis 2 (default = -dInfinity). Setting this to -dInfinity turns off the low stop. For rotational joints, this stop must be greater than - pi to be effective.

Definition at line 67 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

The maximum force or torque that the motor of axis 1 will use to achieve the desired velocity (default = 0.0). This must always be greater than or equal to zero. Setting this to zero turns off the motor.

Definition at line 58 of file SoJointHinge2.h.

Referenced by createOdeJoint(), setParams(), SoJointHinge2(), updateOdeJointProperties(), and SetJointMaxForce::vExecute().

The maximum force or torque that the motor of axis 2 will use to achieve the desired velocity (default = 0.0). This must always be greater than or equal to zero. Setting this to zero turns off the motor.

Definition at line 70 of file SoJointHinge2.h.

Referenced by createOdeJoint(), setParams(), SoJointHinge2(), updateOdeJointProperties(), and SetJointMaxForce2::vExecute().

The anchor for the hinge2 joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 50 of file SoJointHinge2.h.

Referenced by createVisualisation(), SoJointHinge2(), and updateOdeJointProperties().

The first axis for the hinge2 joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 51 of file SoJointHinge2.h.

Referenced by createVisualisation(), SoJointHinge2(), and updateOdeJointProperties().

The second axis for the hinge2 joint (default = {0.0f, 0.0f, 0.0f}).

Definition at line 52 of file SoJointHinge2.h.

Referenced by createVisualisation(), SoJointHinge2(), and updateOdeJointProperties().

The torque for the hinge2 joint (default = {0.0f, 0.0f}).

Definition at line 53 of file SoJointHinge2.h.

Referenced by SoJointHinge2().

The constraint force mixing (CFM) value used by the stops of axis 1 (default = SoJoint::INIT_CFM). Together with the ERP value this can be used to get spongy or soft stops.

Warning:
Note that this is intended for unpowered joints, it does not really work as expected when a powered joint reaches its limit.

Definition at line 63 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

The constraint force mixing (CFM) value used by the stops of axis 2 (default = SoJoint::INIT_CFM). Together with the ERP value this can be used to get spongy or soft stops.

Warning:
Note that this is intended for unpowered joints, it does not really work as expected when a powered joint reaches its limit.

Definition at line 75 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

The error reduction parameter (ERP) used by the stops of axis 1 (default = SoJoint::INIT_ERP).

Definition at line 62 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

The error reduction parameter (ERP) used by the stops of axis 2 (default = SoJoint::INIT_ERP).

Definition at line 74 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

Suspension constraint force mixing (CFM) value for axis 1(default = SoJoint::INIT_CFM). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 65 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

Suspension constraint force mixing (CFM) value for axis 2(default = SoJoint::INIT_CFM). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 77 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

Suspension error reduction parameter (ERP) for axis 1 (default = SoJoint::INIT_ERP). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 64 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

Suspension error reduction parameter (ERP) for axis 2 (default = SoJoint::INIT_ERP). Currently this is only implemented on the hinge-2 joint in ODE.

Definition at line 76 of file SoJointHinge2.h.

Referenced by setParams(), and SoJointHinge2().

Desired angular or linear velocity of the motor of axis 1 (default = 0.0).

Definition at line 57 of file SoJointHinge2.h.

Referenced by createOdeJoint(), setParams(), SoJointHinge2(), updateOdeJointProperties(), and SetJointSpeed::vExecute().

Desired angular or linear velocity of the motor of axis 2 (default = 0.0).

Definition at line 69 of file SoJointHinge2.h.

Referenced by createOdeJoint(), setParams(), SoJointHinge2(), updateOdeJointProperties(), and SetJointSpeed2::vExecute().


The documentation for this class was generated from the following files:

Get IPSA - Inventor Physics Simulation API at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Sat Mar 10 20:00:21 2012 for IPSA by  doxygen 1.5.8