SoJointHinge Class Reference
[libipsa classesJoint Classes]

Defines a hinge joint which allows flexion and extension in one plane (just like a door hinge). More...

#include <SoJointHinge.h>

Inheritance diagram for SoJointHinge:

Inheritance graph
[legend]
Collaboration diagram for SoJointHinge:

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)
 SoJointHinge (const SbString &BodyOne="", const SbString &BodyTwo="", const SbString &nodeName="")

Static Public Member Functions

static void initClass ()

Public Attributes

SoSFFloat AngleOffset
SoSFFloat Bounce
SoSFFloat CFM
SoSFFloat FudgeFactor
SoSFFloat HiStop
SoSFFloat LoStop
SoSFFloat MaxForce
SoSFVec3f soAnchor
SoSFVec3f soAxis
SoSFFloat soTorque
SoSFFloat StopCFM
SoSFFloat StopERP
SoSFFloat SuspensionCFM
SoSFFloat SuspensionERP
SoSFFloat Velocity

Protected Member Functions

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

Protected Attributes

float initMaxForce
float initVelocity

Private Member Functions

 SO_KIT_HEADER (SoJointHinge)


Detailed Description

Defines a hinge joint which allows flexion and extension in one plane (just like a door hinge).

hinge.jpg

A hinge joint.

Definition at line 35 of file SoJointHinge.h.


Constructor & Destructor Documentation

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

The parameterized constructor of SoJointHinge.

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 140 of file SoJointHinge.cpp.

References AngleOffset, Bounce, CFM, FudgeFactor, HiStop, SoJoint::INIT_CFM, SoJoint::INIT_ERP, LoStop, MaxForce, soAnchor, soAxis, StopCFM, StopERP, SuspensionCFM, SuspensionERP, SoJoint::updateOdeParametersTrigger, and Velocity.


Member Function Documentation

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

This method creates a hinge 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 198 of file SoJointHinge.cpp.

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

SoNode * SoJointHinge::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 234 of file SoJointHinge.cpp.

References SoJoint::GenerateCylinderAlignmentRotation(), soAnchor, soAxis, and SoJoint::VisualisationScale.

SoSFFloat SoJointHinge::getAngle (  ) 

Definition at line 273 of file SoJointHinge.cpp.

References AngleOffset, and SoJoint::soJointId.

Referenced by GetJointAngle::vExecute().

SoSFFloat SoJointHinge::getAngleRate (  ) 

Definition at line 281 of file SoJointHinge.cpp.

References SoJoint::soJointId.

Referenced by GetJointAngleRate::vExecute().

void SoJointHinge::initClass (  )  [static]

Initialises the class and it's type id variables.

Reimplemented from SoJoint.

Definition at line 128 of file SoJointHinge.cpp.

void SoJointHinge::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 257 of file SoJointHinge.cpp.

References AngleOffset, Bounce, CFM, FudgeFactor, HiStop, LoStop, MaxForce, SoJoint::soJointId, StopCFM, StopERP, SuspensionCFM, SuspensionERP, and Velocity.

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

This method uses torque1 to set a torque on the hinge joint.

Parameters:
torque1 applied to axis1
torque2 UNUSED
torque3 UNUSED

Reimplemented from SoJoint.

Definition at line 187 of file SoJointHinge.cpp.

References SoJoint::soJointId.

SoJointHinge::SO_KIT_HEADER ( SoJointHinge   )  [private]

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

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

Parameters:
modelMatrix model matrix taken from Coin

Reimplemented from SoJoint.

Definition at line 214 of file SoJointHinge.cpp.

References initMaxForce, initVelocity, MaxForce, soAnchor, soAxis, SoJoint::soJointId, and Velocity.


Member Data Documentation

Definition at line 55 of file SoJointHinge.h.

Referenced by getAngle(), setParams(), and SoJointHinge().

The bouncyness of the stops (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 61 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

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

Definition at line 62 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

(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 60 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

High stop for the jointangle (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 SoJointHinge::HiStop is less than SoJointHinge::LowStop then both stops will be ineffective.

Definition at line 57 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

float SoJointHinge::initMaxForce [protected]

Definition at line 74 of file SoJointHinge.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

float SoJointHinge::initVelocity [protected]

Definition at line 73 of file SoJointHinge.h.

Referenced by createOdeJoint(), and updateOdeJointProperties().

Low stop for the jointangle (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 56 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

The maximum force or torque that the motor 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 59 of file SoJointHinge.h.

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

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

Definition at line 51 of file SoJointHinge.h.

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

The axis for the hinge joint (default = {1.0, 0.0, 0.0}).

Definition at line 52 of file SoJointHinge.h.

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

The torque for the hinge joint.

Definition at line 53 of file SoJointHinge.h.

The constraint force mixing (CFM) value used by the stops (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 64 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

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

Definition at line 63 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

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

Definition at line 66 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

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

Definition at line 65 of file SoJointHinge.h.

Referenced by setParams(), and SoJointHinge().

Desired motor angular or linear velocity (default = 0.0).

Definition at line 58 of file SoJointHinge.h.

Referenced by createOdeJoint(), setParams(), SoJointHinge(), updateOdeJointProperties(), and SetJointSpeed::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