29 #ifndef __HUMANHANDH3D_H__
30 #define __HUMANHANDH3D_H__
37 #ifdef HAVE_VIRTUAL_HAND_SDK
39 #include <vhandtk/vhtHumanHand.h>
40 #include <vhandtk/vhtOglDrawer.h>
106 Types< SFCyberGloveSensor,
107 SFFloat, SFVec3f > > {
113 Vec3f scene_graph_scale =
119 if( scene_graph_scale.length() > Constants::f_epsilon ) {
122 b = Vec3f( 35, 35, 35 ) * scale_field;
123 b.x *= 1/scene_graph_scale.x;
124 b.y *= 1/scene_graph_scale.y;
125 b.z *= 1/scene_graph_scale.z;
129 bb->
size->setValue( b );
136 Inst< SFBound > _bound = 0,
137 Inst< DisplayList > _displayList = 0,
138 Inst< SFCyberGloveSensor > _cyberGlove = 0,
139 Inst< SFString > _gloveHandedness = 0,
140 Inst< SFFloat > _scale = 0 );
147 #ifdef HAVE_VIRTUAL_HAND_SDK
156 virtual void initialize();
159 virtual void render();
230 #ifdef HAVE_VIRTUAL_HAND_SDK
232 H3DUniquePtr< vhtHumanHand > hand;
233 H3DUniquePtr< vhtOglDrawer > drawer;
234 vhtTransform3D * cameraXForm;
Header file for CyberGloveSensor.
Contains the DependentSFNode and DependentMFNode template classes.
Header file for X3DGeometryNode, X3D scene-graph node.
The BoxBound is a Bound class that specifies the bound using an axis-aligned bounding box.
Definition: Bound.h:144
H3DUniquePtr< SFVec3f > size
The size of the bounding box.
Definition: Bound.h:287
Connects to a CyberGlove through the Virtual HandSDK.
Definition: CyberGloveSensor.h:51
H3DUniquePtr< MFDouble > ring
Outputs the angles for the joints on the ring finger.
Definition: CyberGloveSensor.h:112
H3DUniquePtr< MFDouble > index
Outputs the angles for the joints on the index finger.
Definition: CyberGloveSensor.h:98
H3DUniquePtr< MFDouble > pinky
Outputs the angles for the joints on the pinky.
Definition: CyberGloveSensor.h:119
H3DUniquePtr< MFDouble > middle
Outputs the angles for the joints on the middle finger.
Definition: CyberGloveSensor.h:105
H3DUniquePtr< MFDouble > thumb
Outputs the angles for the joints on the thumb.
Definition: CyberGloveSensor.h:91
H3DUniquePtr< DisplayList > displayList
The DisplayList instance handling the OpenGL caching of this object.
Definition: H3DDisplayListObject.h:256
Update geometric bounds of the HumanHand.
Definition: HumanHand.h:107
virtual void update()
Update the bound from the size field.
Definition: HumanHand.h:110
Field class used to check if a CyberGloveSensor is used and then set up routes from fields in the Cyb...
Definition: HumanHand.h:72
virtual void onRemove(Node *node)
This function will be called when the value of RefCountSField changes.
Definition: HumanHand.h:87
virtual void onAdd(Node *node)
We check that the type of the Node is of the correct type.
Definition: HumanHand.h:74
This is a X3DGeometryNode which renders a hand using the Virtual Hand SDK.
Definition: HumanHand.h:66
virtual int nrTriangles()
The number of triangles renderered in this geometry.
Definition: HumanHand.h:167
~HumanHand()
Destructor.
Definition: HumanHand.h:143
virtual bool lineIntersect(const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
Detect intersection between a line segment and the HumanHands bounding box.
Definition: HumanHand.h:178
virtual void closestPoint(const Vec3f &p, NodeIntersectResult &result)
Find closest point on the HumanHands bounding box to point p.
Definition: HumanHand.h:187
H3DUniquePtr< SFVec3f > sceneGraphScaling
Internal C++ field used to modify the bound.
Definition: HumanHand.h:240
H3DUniquePtr< SFString > gloveHandedness
Decides whether the CyberGlove is a left or right hand.
Definition: HumanHand.h:215
H3DUniquePtr< SFCyberGloveSensor > cyberGlove
An instance of the cyberGlove.
Definition: HumanHand.h:208
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: HumanHand.h:227
H3DUniquePtr< SFFloat > scale
The default hand geometrys units in the Virtual Hand SDK seems to be in centimeters.
Definition: HumanHand.h:224
virtual bool movingSphereIntersect(H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
Detect collision between a moving sphere and the HumanHands bounding box.
Definition: HumanHand.h:198
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
virtual void onRemove(Node *n)
This function will be called when the value of RefCountSField changes.
Definition: RefCountSField.h:176
The SFFloat field contains one single-precision floating point number.
Definition: SFFloat.h:41
The SFVec3f field contains a Vec3f.
Definition: SFVec3f.h:41
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
virtual void onAdd(Node *n)
We check that the type of the Node is of the correct type.
Definition: SFNode.h:108
void resetGlove()
Reset glove to 0, needed in cleanup phase to not accidently try to delete instance of vhtGlove twice.
Definition: VirtualHandGloveSensor.h:101
This is the base node type for all geometry in X3D.
Definition: X3DGeometryNode.h:61
Type getValue(const char *s, const char *&rest)
Function that reads characters from a char * and converts them to a given type.
Definition: X3DFieldConversion.h:134
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194
Used as input to lineIntersect functions.
Definition: Node.h:224
Used as input to intersection functions.
Definition: Node.h:114