H3D API  2.4.1
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
H3D::RazerHydraSensor Class Reference

This is a X3DSensorNode for reading values from a Razer hydra sensor. More...

#include <H3D/RazerHydraSensor.h>

Inheritance diagram for H3D::RazerHydraSensor:
Inheritance graph

Public Member Functions

 RazerHydraSensor (Inst< EnableHydraSensor > _enabled=0, Inst< SFNode > _metadata=0, Inst< SFBool > _isActive=0, Inst< SFVec3f > _c0Position=0, Inst< SFRotation > _c0Orientation=0, Inst< SFVec2f > _c0Joystick=0, Inst< SFFloat > _c0Trigger=0, Inst< SFInt32 > _c0Buttons=0, Inst< SFBool > _c0Connected=0, Inst< SFBool > _c0Docked=0, Inst< SFInt32 > _c0WhichHand=0, Inst< SFBool > _c0HemiTrackingEnabled=0, Inst< SFBool > _c0Button1=0, Inst< SFBool > _c0Button2=0, Inst< SFBool > _c0Button3=0, Inst< SFBool > _c0Button4=0, Inst< SFBool > _c0ButtonStart=0, Inst< SFBool > _c0ButtonBumper=0, Inst< SFBool > _c0ButtonJoystick=0, Inst< SFVec3f > _c1Position=0, Inst< SFRotation > _c1Orientation=0, Inst< SFVec2f > _c1Joystick=0, Inst< SFFloat > _c1Trigger=0, Inst< SFInt32 > _c1Buttons=0, Inst< SFBool > _c1Connected=0, Inst< SFBool > _c1Docked=0, Inst< SFInt32 > _c1WhichHand=0, Inst< SFBool > _c1HemiTrackingEnabled=0, Inst< SFBool > _c1Button1=0, Inst< SFBool > _c1Button2=0, Inst< SFBool > _c1Button3=0, Inst< SFBool > _c1Button4=0, Inst< SFBool > _c1ButtonStart=0, Inst< SFBool > _c1ButtonBumper=0, Inst< SFBool > _c1ButtonJoystick=0)
 Constructor.
 
 ~RazerHydraSensor ()
 Destructor.
 
virtual void traverseSG (TraverseInfo &ti)
 Update the fields if. More...
 
- Public Member Functions inherited from H3D::X3DSensorNode
 X3DSensorNode (Inst< SFBool > _enabled=0, Inst< SFNode > _metadata=0, Inst< SFBool > _isActive=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DChildNode
 X3DChildNode (Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual void render ()
 the render() function is used for the depth-first rendering traversal of the scene-graph. More...
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 

Public Attributes

H3DUniquePtr< SFVec3fc0Position
 c0Position is the position for controller c0. More...
 
H3DUniquePtr< SFRotationc0Orientation
 c0Orientation is the orientation for controller c0. More...
 
H3DUniquePtr< SFVec2fc0Joystick
 c0Joystick is the position of the (thumb) joystick for controller c0. More...
 
H3DUniquePtr< SFFloatc0Trigger
 c0Trigger is the status of the analog trigger for controller c0. More...
 
H3DUniquePtr< SFInt32c0Buttons
 c0Buttons is a bit mask describing the state of each button for controller c0. More...
 
H3DUniquePtr< SFBoolc0Connected
 c0Connected is true if controller c0 is connected. More...
 
H3DUniquePtr< SFBoolc0Docked
 c0Docked is true if controller c0 is docked. More...
 
H3DUniquePtr< SFInt32c0WhichHand
 c0WhichHand is 0 until controller c0 is docked. More...
 
H3DUniquePtr< SFBoolc0HemiTrackingEnabled
 c0HemiTrackingEnabled is false until both controllers have been docked. More...
 
H3DUniquePtr< SFBoolc0Button1
 c0Button1 is true if button 1 of controller c0 has been pressed. More...
 
H3DUniquePtr< SFBoolc0Button2
 c0Button2 is true if button 2 of controller c0 has been pressed. More...
 
H3DUniquePtr< SFBoolc0Button3
 c0Button3 is true if button 3 of controller c0 has been pressed. More...
 
H3DUniquePtr< SFBoolc0Button4
 c0Button4 is true if button 4 of controller c0 has been pressed. More...
 
H3DUniquePtr< SFBoolc0ButtonStart
 c0ButtonStart is true if start button of controller c0 has been pressed. More...
 
H3DUniquePtr< SFBoolc0ButtonBumper
 c0ButtonBumper is true if bumper button of controller c0 has been pressed. More...
 
H3DUniquePtr< SFBoolc0ButtonJoystick
 c0ButtonJoystick is true if joystick button of controller c0 has been pressed. More...
 
H3DUniquePtr< SFVec3fc1Position
 c1Position is the position for controller c1. More...
 
H3DUniquePtr< SFRotationc1Orientation
 c1Orientation is the orientation for controller c1. More...
 
H3DUniquePtr< SFVec2fc1Joystick
 c1Joystick is the position of the (thumb) joystick for controller c1. More...
 
H3DUniquePtr< SFFloatc1Trigger
 c1Trigger is the status of the analog trigger for controller c1. More...
 
H3DUniquePtr< SFInt32c1Buttons
 c1Buttons is a bit mask describing the state of each button for controller c1. More...
 
H3DUniquePtr< SFBoolc1Connected
 c1Connected is true if controller c1 is connected. More...
 
H3DUniquePtr< SFBoolc1Docked
 c1Docked is true if controller c1 is docked. More...
 
H3DUniquePtr< SFInt32c1WhichHand
 c1WhichHand is 0 until controller c1 is docked. More...
 
H3DUniquePtr< SFBoolc1HemiTrackingEnabled
 c1HemiTrackingEnabled is false until both controllers have been docked. More...
 
H3DUniquePtr< SFBoolc1Button1
 c1Button1 is true if button 1 of controller c1 has been pressed. More...
 
H3DUniquePtr< SFBoolc1Button2
 c1Button2 is true if button 2 of controller c1 has been pressed. More...
 
H3DUniquePtr< SFBoolc1Button3
 c1Button3 is true if button 3 of controller c1 has been pressed. More...
 
H3DUniquePtr< SFBoolc1Button4
 c1Button4 is true if button 4 of controller c1 has been pressed. More...
 
H3DUniquePtr< SFBoolc1ButtonStart
 c1ButtonStart is true if start button of controller c1 has been pressed. More...
 
H3DUniquePtr< SFBoolc1ButtonBumper
 c1ButtonBumper is true if bumper button of controller c1 has been pressed. More...
 
H3DUniquePtr< SFBoolc1ButtonJoystick
 c1ButtonJoystick is true if joystick button of controller c1 has been pressed. More...
 
- Public Attributes inherited from H3D::X3DSensorNode
H3DUniquePtr< SFBoolenabled
 If enabled is true the sensor node is enabled otherwise it is disabled and will not generate any output. More...
 
H3DUniquePtr< SFBoolisActive
 A sensor is active when some special conditions are fulfilled and it will then generate extra output. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DSensorNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Additional Inherited Members

- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 

Detailed Description

This is a X3DSensorNode for reading values from a Razer hydra sensor.

All fields that start with c0 belong to one controller. All fields that start with c1 belongs to the other controller.

Examples:

Internal routes:

Member Function Documentation

◆ traverseSG()

void RazerHydraSensor::traverseSG ( TraverseInfo ti)
virtual

Member Data Documentation

◆ c0Button1

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0Button1

c0Button1 is true if button 1 of controller c0 has been pressed.

Button 1 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_1.

Access type: outputOnly

Referenced by traverseSG().

◆ c0Button2

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0Button2

c0Button2 is true if button 2 of controller c0 has been pressed.

Button 2 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_2.

Access type: outputOnly

Referenced by traverseSG().

◆ c0Button3

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0Button3

c0Button3 is true if button 3 of controller c0 has been pressed.

Button 3 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_3.

Access type: outputOnly

Referenced by traverseSG().

◆ c0Button4

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0Button4

c0Button4 is true if button 4 of controller c0 has been pressed.

Button 4 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_4.

Access type: outputOnly

Referenced by traverseSG().

◆ c0ButtonBumper

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0ButtonBumper

c0ButtonBumper is true if bumper button of controller c0 has been pressed.

Bumper button is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_BUMPER.

Access type: outputOnly

Referenced by traverseSG().

◆ c0ButtonJoystick

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0ButtonJoystick

c0ButtonJoystick is true if joystick button of controller c0 has been pressed.

joystick button is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_JOYSTICK.

Access type: outputOnly

Referenced by traverseSG().

◆ c0Buttons

H3DUniquePtr< SFInt32 > H3D::RazerHydraSensor::c0Buttons

c0Buttons is a bit mask describing the state of each button for controller c0.

If any bit is 1 it means a button is pressed. Last time this documentation was updated the bits in Sixense API were defined to mean this: (0x01<<0) - SIXENSE_BUTTON_START - H3D field c0buttonStart (0x01<<3) - SIXENSE_BUTTON_3 - H3D field c0Button3 (0x01<<4) - SIXENSE_BUTTON_4 - H3D field c0Button4 (0x01<<5) - SIXENSE_BUTTON_1 - H3D field c0Button1 (0x01<<6) - SIXENSE_BUTTON_2 - H3D field c0Button2 (0x01<<7) - SIXENSE_BUTTON_BUMPER - H3D field c0ButtonBumper (0x01<<8) - SIXENSE_BUTTON_JOYSTICK - H3D field c0ButtonJoystick

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c0ButtonStart

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0ButtonStart

c0ButtonStart is true if start button of controller c0 has been pressed.

Start button is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_START.

Access type: outputOnly

Referenced by traverseSG().

◆ c0Connected

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0Connected

c0Connected is true if controller c0 is connected.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c0Docked

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0Docked

c0Docked is true if controller c0 is docked.

A docked controller can be expected to not be in use.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c0HemiTrackingEnabled

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0HemiTrackingEnabled

c0HemiTrackingEnabled is false until both controllers have been docked.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c0Joystick

H3DUniquePtr< SFVec2f > H3D::RazerHydraSensor::c0Joystick

c0Joystick is the position of the (thumb) joystick for controller c0.

x is the horizontal position and y is the vertical position. -1 is full left/down, 0 is centered and 1 is full right/up.

Access type: outputOnly
Valid range: [-1,1]

Referenced by traverseSG().

◆ c0Orientation

H3DUniquePtr< SFRotation > H3D::RazerHydraSensor::c0Orientation

c0Orientation is the orientation for controller c0.

Access type: outputOnly

Referenced by traverseSG().

◆ c0Position

H3DUniquePtr< SFVec3f > H3D::RazerHydraSensor::c0Position

c0Position is the position for controller c0.

Access type: outputOnly

Referenced by traverseSG().

◆ c0Trigger

H3DUniquePtr< SFFloat > H3D::RazerHydraSensor::c0Trigger

c0Trigger is the status of the analog trigger for controller c0.

0 is unpressed, 1 is fully pressed.

Access type: outputOnly
Valid range: [0,1]

Referenced by RazerHydraSensor(), and traverseSG().

◆ c0WhichHand

H3DUniquePtr< SFInt32 > H3D::RazerHydraSensor::c0WhichHand

c0WhichHand is 0 until controller c0 is docked.

If placed on the left side of the dock this field will be set to 1. If placed on the right side this field will be set to 2.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c1Button1

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1Button1

c1Button1 is true if button 1 of controller c1 has been pressed.

Button 1 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_1.

Access type: outputOnly

Referenced by traverseSG().

◆ c1Button2

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1Button2

c1Button2 is true if button 2 of controller c1 has been pressed.

Button 2 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_2.

Access type: outputOnly

Referenced by traverseSG().

◆ c1Button3

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1Button3

c1Button3 is true if button 3 of controller c1 has been pressed.

Button 3 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_3.

Access type: outputOnly

Referenced by traverseSG().

◆ c1Button4

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1Button4

c1Button4 is true if button 4 of controller c1 has been pressed.

Button 4 is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_4.

Access type: outputOnly

Referenced by traverseSG().

◆ c1ButtonBumper

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1ButtonBumper

c1ButtonBumper is true if bumper button of controller c1 has been pressed.

Bumper button is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_BUMPER.

Access type: outputOnly

Referenced by traverseSG().

◆ c1ButtonJoystick

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1ButtonJoystick

c1ButtonJoystick is true if joystick button of controller c1 has been pressed.

joystick button is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_JOYSTICK.

Access type: outputOnly

Referenced by traverseSG().

◆ c1Buttons

H3DUniquePtr< SFInt32 > H3D::RazerHydraSensor::c1Buttons

c1Buttons is a bit mask describing the state of each button for controller c1.

If any bit is 1 it means a button is pressed. Last time this documentation was updated the bits in Sixense API were defined to mean this: (0x01<<0) - SIXENSE_BUTTON_START - H3D field c1buttonStart (0x01<<3) - SIXENSE_BUTTON_3 - H3D field c1Button3 (0x01<<4) - SIXENSE_BUTTON_4 - H3D field c1Button4 (0x01<<5) - SIXENSE_BUTTON_1 - H3D field c1Button1 (0x01<<6) - SIXENSE_BUTTON_2 - H3D field c1Button2 (0x01<<7) - SIXENSE_BUTTON_BUMPER - H3D field c1ButtonBumper (0x01<<8) - SIXENSE_BUTTON_JOYSTICK - H3D field c1ButtonJoystick

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c1ButtonStart

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1ButtonStart

c1ButtonStart is true if start button of controller c1 has been pressed.

Start button is the button which corresponds to Sixense SDKs value SIXENSE_BUTTON_START.

Access type: outputOnly

Referenced by traverseSG().

◆ c1Connected

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1Connected

c1Connected is true if controller c1 is connected.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c1Docked

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1Docked

c1Docked is true if controller c1 is docked.

A docked controller can be expected to not be in use.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c1HemiTrackingEnabled

H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1HemiTrackingEnabled

c1HemiTrackingEnabled is false until both controllers have been docked.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().

◆ c1Joystick

H3DUniquePtr< SFVec2f > H3D::RazerHydraSensor::c1Joystick

c1Joystick is the position of the (thumb) joystick for controller c1.

x is the horizontal position and y is the vertical position. -1 is full left/down, 0 is centered and 1 is full right/up.

Access type: outputOnly
Valid range: [-1,1]

Referenced by traverseSG().

◆ c1Orientation

H3DUniquePtr< SFRotation > H3D::RazerHydraSensor::c1Orientation

c1Orientation is the orientation for controller c1.

Access type: outputOnly

Referenced by traverseSG().

◆ c1Position

H3DUniquePtr< SFVec3f > H3D::RazerHydraSensor::c1Position

c1Position is the position for controller c1.

Access type: outputOnly

Referenced by traverseSG().

◆ c1Trigger

H3DUniquePtr< SFFloat > H3D::RazerHydraSensor::c1Trigger

c1Trigger is the status of the analog trigger for controller c1.

0 is unpressed, 1 is fully pressed.

Access type: outputOnly
Valid range: [0,1]

Referenced by RazerHydraSensor(), and traverseSG().

◆ c1WhichHand

H3DUniquePtr< SFInt32 > H3D::RazerHydraSensor::c1WhichHand

c1WhichHand is 0 until controller c1 is docked.

If placed on the left side of the dock this field will be set to 1. If placed on the right side this field will be set to 2.

Access type: outputOnly

Referenced by RazerHydraSensor(), and traverseSG().


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