H3D API
2.4.1
|
This is a X3DSensorNode for reading values from a Razer hydra sensor. More...
#include <H3D/RazerHydraSensor.h>
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... | |
![]() | |
X3DSensorNode (Inst< SFBool > _enabled=0, Inst< SFNode > _metadata=0, Inst< SFBool > _isActive=0) | |
Constructor. | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (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. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
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 Field * | getField (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< SFVec3f > | c0Position |
c0Position is the position for controller c0. More... | |
H3DUniquePtr< SFRotation > | c0Orientation |
c0Orientation is the orientation for controller c0. More... | |
H3DUniquePtr< SFVec2f > | c0Joystick |
c0Joystick is the position of the (thumb) joystick for controller c0. More... | |
H3DUniquePtr< SFFloat > | c0Trigger |
c0Trigger is the status of the analog trigger for controller c0. More... | |
H3DUniquePtr< SFInt32 > | c0Buttons |
c0Buttons is a bit mask describing the state of each button for controller c0. More... | |
H3DUniquePtr< SFBool > | c0Connected |
c0Connected is true if controller c0 is connected. More... | |
H3DUniquePtr< SFBool > | c0Docked |
c0Docked is true if controller c0 is docked. More... | |
H3DUniquePtr< SFInt32 > | c0WhichHand |
c0WhichHand is 0 until controller c0 is docked. More... | |
H3DUniquePtr< SFBool > | c0HemiTrackingEnabled |
c0HemiTrackingEnabled is false until both controllers have been docked. More... | |
H3DUniquePtr< SFBool > | c0Button1 |
c0Button1 is true if button 1 of controller c0 has been pressed. More... | |
H3DUniquePtr< SFBool > | c0Button2 |
c0Button2 is true if button 2 of controller c0 has been pressed. More... | |
H3DUniquePtr< SFBool > | c0Button3 |
c0Button3 is true if button 3 of controller c0 has been pressed. More... | |
H3DUniquePtr< SFBool > | c0Button4 |
c0Button4 is true if button 4 of controller c0 has been pressed. More... | |
H3DUniquePtr< SFBool > | c0ButtonStart |
c0ButtonStart is true if start button of controller c0 has been pressed. More... | |
H3DUniquePtr< SFBool > | c0ButtonBumper |
c0ButtonBumper is true if bumper button of controller c0 has been pressed. More... | |
H3DUniquePtr< SFBool > | c0ButtonJoystick |
c0ButtonJoystick is true if joystick button of controller c0 has been pressed. More... | |
H3DUniquePtr< SFVec3f > | c1Position |
c1Position is the position for controller c1. More... | |
H3DUniquePtr< SFRotation > | c1Orientation |
c1Orientation is the orientation for controller c1. More... | |
H3DUniquePtr< SFVec2f > | c1Joystick |
c1Joystick is the position of the (thumb) joystick for controller c1. More... | |
H3DUniquePtr< SFFloat > | c1Trigger |
c1Trigger is the status of the analog trigger for controller c1. More... | |
H3DUniquePtr< SFInt32 > | c1Buttons |
c1Buttons is a bit mask describing the state of each button for controller c1. More... | |
H3DUniquePtr< SFBool > | c1Connected |
c1Connected is true if controller c1 is connected. More... | |
H3DUniquePtr< SFBool > | c1Docked |
c1Docked is true if controller c1 is docked. More... | |
H3DUniquePtr< SFInt32 > | c1WhichHand |
c1WhichHand is 0 until controller c1 is docked. More... | |
H3DUniquePtr< SFBool > | c1HemiTrackingEnabled |
c1HemiTrackingEnabled is false until both controllers have been docked. More... | |
H3DUniquePtr< SFBool > | c1Button1 |
c1Button1 is true if button 1 of controller c1 has been pressed. More... | |
H3DUniquePtr< SFBool > | c1Button2 |
c1Button2 is true if button 2 of controller c1 has been pressed. More... | |
H3DUniquePtr< SFBool > | c1Button3 |
c1Button3 is true if button 3 of controller c1 has been pressed. More... | |
H3DUniquePtr< SFBool > | c1Button4 |
c1Button4 is true if button 4 of controller c1 has been pressed. More... | |
H3DUniquePtr< SFBool > | c1ButtonStart |
c1ButtonStart is true if start button of controller c1 has been pressed. More... | |
H3DUniquePtr< SFBool > | c1ButtonBumper |
c1ButtonBumper is true if bumper button of controller c1 has been pressed. More... | |
H3DUniquePtr< SFBool > | c1ButtonJoystick |
c1ButtonJoystick is true if joystick button of controller c1 has been pressed. More... | |
![]() | |
H3DUniquePtr< SFBool > | enabled |
If enabled is true the sensor node is enabled otherwise it is disabled and will not generate any output. More... | |
H3DUniquePtr< SFBool > | isActive |
A sensor is active when some special conditions are fulfilled and it will then generate extra output. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
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. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
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:
|
virtual |
Update the fields if.
ti | The TraverseInfo object containing information about the traversal. |
Reimplemented from H3D::Node.
References c0Button1, c0Button2, c0Button3, c0Button4, c0ButtonBumper, c0ButtonJoystick, c0Buttons, c0ButtonStart, c0Connected, c0Docked, c0HemiTrackingEnabled, c0Joystick, c0Orientation, c0Position, c0Trigger, c0WhichHand, c1Button1, c1Button2, c1Button3, c1Button4, c1ButtonBumper, c1ButtonJoystick, c1Buttons, c1ButtonStart, c1Connected, c1Docked, c1HemiTrackingEnabled, c1Joystick, c1Orientation, c1Position, c1Trigger, c1WhichHand, H3D::X3DSensorNode::enabled, H3DUtil::RefCountedClass::getName(), H3D::X3DSensorNode::isActive, H3DUtil::MutexLock::lock(), H3D::Node::traverseSG(), and H3DUtil::MutexLock::unlock().
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().
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().
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().
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().
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().
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().
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().
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().
H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0Connected |
c0Connected is true if controller c0 is connected.
Access type: outputOnly
Referenced by RazerHydraSensor(), and traverseSG().
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().
H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c0HemiTrackingEnabled |
c0HemiTrackingEnabled is false until both controllers have been docked.
Access type: outputOnly
Referenced by RazerHydraSensor(), and traverseSG().
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().
H3DUniquePtr< SFRotation > H3D::RazerHydraSensor::c0Orientation |
c0Orientation is the orientation for controller c0.
Access type: outputOnly
Referenced by traverseSG().
H3DUniquePtr< SFVec3f > H3D::RazerHydraSensor::c0Position |
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1Connected |
c1Connected is true if controller c1 is connected.
Access type: outputOnly
Referenced by RazerHydraSensor(), and traverseSG().
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().
H3DUniquePtr< SFBool > H3D::RazerHydraSensor::c1HemiTrackingEnabled |
c1HemiTrackingEnabled is false until both controllers have been docked.
Access type: outputOnly
Referenced by RazerHydraSensor(), and traverseSG().
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().
H3DUniquePtr< SFRotation > H3D::RazerHydraSensor::c1Orientation |
c1Orientation is the orientation for controller c1.
Access type: outputOnly
Referenced by traverseSG().
H3DUniquePtr< SFVec3f > H3D::RazerHydraSensor::c1Position |
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().
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().