#include <H3DNetworkingUtils/GrabableDynamic.h>
Public Member Functions | |
GrabableDynamic (H3D::Inst< AddChildren > _addChildren=0, H3D::Inst< RemoveChildren > _removeChildren=0, H3D::Inst< MFChild > _children=0, H3D::Inst< H3D::SFNode > _metadata=0, H3D::Inst< SFBound > _bound=0, H3D::Inst< H3D::SFVec3f > _bboxCenter=0, H3D::Inst< H3D::SFVec3f > _bboxSize=0, H3D::Inst< SFTransformedBound > _transformedBound=0, H3D::Inst< SFMatrix4f > _matrix=0, H3D::Inst< SFMatrix4f > _accumulatedForward=0, H3D::Inst< SFMatrix4f > _accumulatedInverse=0, H3D::Inst< H3D::SFVec3f > _position=0, H3D::Inst< H3D::SFRotation > _orientation=0, H3D::Inst< SFVelocity > _velocity=0, H3D::Inst< H3D::SFVec3f > _momentum=0, H3D::Inst< H3D::SFVec3f > _force=0, H3D::Inst< SFAngularVelocity > _angularVelocity=0, H3D::Inst< H3D::SFVec3f > _angularMomentum=0, H3D::Inst< SFSpin > _spin=0, H3D::Inst< H3D::SFVec3f > _torque=0, H3D::Inst< H3D::SFFloat > _mass=0, H3D::Inst< H3D::SFMatrix3f > _inertiaTensor=0, H3D::Inst< SFMotion > _motion=0, H3D::Inst< H3D::MFVec3f > _contactForces=0, H3D::Inst< H3D::MFVec3f > _contactTorques=0, H3D::Inst< SumMFVec3f > _totalContactForce=0, H3D::Inst< CalcTorque > _totalContactTorque=0, H3D::Inst< SumForces > _externalForces=0, H3D::Inst< SumTorques > _externalTorques=0, H3D::Inst< H3D::SFVec3f > _freedom=0, H3D::Inst< H3D::SFVec3f > _angularFreedom=0, H3D::Inst< H3D::SFFloat > _linearDamping=0, H3D::Inst< H3D::SFFloat > _rotationalDamping=0, H3D::Inst< MFCollidableGeometry > _collisionSpheres=0, H3D::Inst< H3D::SFFloat > _collisionStiffness=0, H3D::Inst< H3D::SFFloat > _collisionResolution=0, H3D::Inst< H3D::SFBool > _grabbed=0, H3D::Inst< H3D::SFVec3f > _grabPoint=0, H3D::Inst< H3D::SFFloat > _grabStrength=0, H3D::Inst< H3D::SFFloat > _grabSlackRadius=0, H3D::Inst< GrabSpring > _grabForce=0, H3D::Inst< NegVec3f > _grabReactionForce=0, H3D::Inst< MovedPos > _grabSpringAnchorPt=0, H3D::Inst< GrabTorque > _grabTorque=0, H3D::Inst< H3D::SFInt32 > _grabSmoothing=0, H3D::Inst< H3D::SFFloat > _grabDamping=0, H3D::Inst< SlaveSwitch > _slaveMode=0, H3D::Inst< DiffVec3f > _appliedForce=0, H3D::Inst< DiffVec3f > _appliedTorque=0) | |
Constructor. | |
virtual void | initialize () |
Initialize. | |
Public Attributes | |
auto_ptr< H3D::SFBool > | grabbed |
Set this to true to set a spring in place between the initial grabPoint (grabSpringAnchorPt) and subsequent grabPoint values access type: inputOutput basic type: SFBool default value: FALSE. | |
auto_ptr< H3D::SFVec3f > | grabPoint |
When grabbed turns true, a spring is set in place between the grabPoint value when it turns true and the current grabPoint as it moves around access type: inputOutput basic type: SFVec3f default value: 0 0 0. | |
auto_ptr< H3D::SFFloat > | grabStrength |
The strength factor of the grabbing spring access type: inputOutput basic type: SFFloat default value: 60.0. | |
auto_ptr< H3D::SFFloat > | grabDamping |
The damping factor of the grabbing spring access type: inputOutput basic type: SFFloat default value: 0.01. | |
auto_ptr< H3D::SFFloat > | grabSlackRadius |
To stop oscillations there is a dead zone around the grabPoint If the current grabPoint is less than this amount from the original, the grabbing force is set to zero access type: inputOutput basic type: SFFloat default value: 0.004. | |
auto_ptr< GrabSpring > | grabForce |
The force currently being applied to the dynamic access type: outputOnly basic type: SFVec3f default value: 0 0 0. | |
auto_ptr< NegVec3f > | grabReactionForce |
The reactive force available to be applied to the haptic tool - the inverse of the grabForce access type: outputOnly basic type: SFVec3f default value: 0 0 0. | |
auto_ptr< MovedPos > | grabSpringAnchorPt |
The point on the dynamic that a grab spring is anchored This is set to the grabPoint value when grabbed becomes true As the object moves, this grabSpringAnchorPt moves and rotates with it access type: outputOnly basic type: SFVec3f default value: 0 0 0. | |
auto_ptr< GrabTorque > | grabTorque |
The torque currently being applied to the dynamic access type: outputOnly basic type: SFVec3f default value: 0 0 0. | |
auto_ptr< H3D::SFInt32 > | grabSmoothing |
The smoothing iterations on the grab force access type: initializeOnly basic type: SFInt32 default value: 0 (off by default). | |
auto_ptr< SlaveSwitch > | slaveMode |
When slaveMode is true, the node has no dynamic behaviour itself, it only reports the user's forces on it via the fields: appliedForce and appiedTorque the intention of slaveMode is to allow it to be linked to another GrabableDynamic (master) across a network and let the master do the dynamic calculations In this mode, you should remoteRoute the appled force and appliedTorqu to the master and route it position and orientation back The slaveMode mechanism is supplied as a replacement for the SlaveDynamic node in earlier versions for two reasons: 1. | |
auto_ptr< DiffVec3f > | appliedForce |
The force applied to the object by user actions This can be routed (via a remote route) to the externalForces field of a Dynamic access type: outputOnly basic type: SFVec3f default value: 0 0 0. | |
auto_ptr< DiffVec3f > | appliedTorque |
The torque applied to the object by user actions This can be routed (via a remote route) to the externalTorques field of a Dynamic access type: outputOnly basic type: SFVec3f default value: 0 0 0. | |
Classes | |
struct | DiffVec3f |
Subtracts 2 SFVec3fs. More... | |
class | GrabSpring |
The GrabSpring class generates a grabbing force /n 0th input is grabbed, /n 1st input is grabSpringAnchorPoint, /n 2nd is grabPoint (where the grabbing tool is), /n 3rd is grabStrength, /n 4th is springSlackLength. More... | |
struct | GrabTorque |
GrabTorque calculates the torque from the grab position and grab force input[0] is enabled input[1] is current grab position, /n input[2] is orig grab point, input[3] is force vector causing torque, input[4] is slackRadius /n. More... | |
struct | MovedPos |
MovedPos provides the position of the current (perhaps moved) position of the initial point on the object that was grabbed in global coords input 1 is a 'grabbed' boolean, input 2 is the current grabPoint, /n input 3 is the position of the object, input 4 is the orientation of the object. More... | |
struct | NegVec3f |
negates a vec3f and adds damping input[0] is grabForce, /n input[1] is grabDamping, /n input[2] is time /n More... |
The separation of the the current tool position and the dynamic's (moved) grab point is returned in a forceOutput that can be applied as a haptic force on the tool
This node can also act as a slave to a master GrabableDynamic on another machine by setting slaveMode to TRUE Typical usage:
<ForceField DEF="grab_reaction_force"/> <ROUTE fromNode='HDEV' fromField='mainButton' toNode='dyn' toField='grabbed'\> <ROUTE fromNode='HDEV' fromField='proxyPosition' toNode='dyn' toField='grabPoint'\> <ROUTE fromNode='dyn' fromField='grabReactionForce' toNode='grab_reaction_force' toField='force'\>
auto_ptr<SlaveSwitch> H3DNetworkingUtils::GrabableDynamic::slaveMode |
When slaveMode is true, the node has no dynamic behaviour itself, it only reports the
user's forces on it via the fields: appliedForce and appiedTorque
the intention of slaveMode is to allow it to be linked to another GrabableDynamic (master) across a network
and let the master do the dynamic calculations In this mode, you should remoteRoute the appled force and appliedTorqu to the master and route it position and orientation back The slaveMode mechanism is supplied as a replacement for the SlaveDynamic node in earlier versions for two reasons:
1.
A GrabableDynamic can be switch to be a slave at run time 2. Other nodes can inherit from GrabableDynamic and add features that also can be used when acting as a slave. access type: inputOutput
basic type: SFBool
default value: FALSE