1 #ifndef HX_3D_WAND_BASE_H 2 #define HX_3D_WAND_BASE_H 4 #include <Inventor/SbLinear.h> 5 #include <mclib/McHandle.h> 6 #include <Inventor/nodes/SoSwitch.h> 7 #include <hxcore/api.h> 13 #pragma warning(disable:4251) 18 dynamic_cast<Hx3DWandBase*>((Hx3DWandBase*)(e)->trackerInfo().getData()) 54 void setGeometry(SoNode* wand,
const SbVec3f& hotSpot);
61 void setHighlightGeometry(SoNode* wand);
73 void setWandScale(
float scaleFactor);
92 virtual void setHighlight(
bool enable);
99 bool getButton(
int butIdx)
const;
113 bool wasButtonPressed(
int butIdx)
const;
120 bool wasButtonReleased(
int butIdx)
const;
131 const SbVec3f&
origin(
bool scene=
true)
const {
return scene ? m_sceneOrigin : m_vrOrigin; }
142 const SbVec3f&
top(
bool scene=
true)
const {
return scene ? m_sceneTop : m_vrTop; }
175 const SbRotation&
orientation(
bool scene=
true)
const {
return scene ? m_sceneOrientation : m_vrOrientation; }
182 float length(
bool scene=
true)
const {
return scene ? m_sceneLength : m_vrLength; }
195 const SbMatrix&
sceneXform()
const {
return *m_sceneToVRTransform; }
211 virtual void update(
const SbVec3f& pos,
const SbRotation& rot,
int butStat);
223 static SoSeparator* getDefaultWandGeometry();
232 virtual ~Hx3DWandBase();
239 static SoSeparator* createDefaultWand(
bool highlight);
SbVec3f m_hotSpot
The hot spot of the wand.
Definition: Hx3DWand.h:244
const SbVec3f & origin(bool scene=true) const
Returns the origin of the 3D wand.
Definition: Hx3DWand.h:131
float m_vrLength
The length in VR coordinates.
Definition: Hx3DWand.h:287
float getWandScale() const
Returns the scale factor of the wand.
Definition: Hx3DWand.h:82
SbVec3f m_vrTop
The top in VR coordinates.
Definition: Hx3DWand.h:292
Base class representing a 3D wand in XScreen.
Definition: Hx3DWand.h:42
int getButtonStatus() const
Returns the current combined state of all buttons of the VR input device.
Definition: Hx3DWand.h:105
SbVec3f m_sceneOrigin
The origin in scene coordinates.
Definition: Hx3DWand.h:277
const SbMatrix & sceneXformInverse() const
Returns the inverse of sceneXform().
Definition: Hx3DWand.h:203
McHandle< SoSwitch > m_highlightSwitch
The node for switching between highlight ON/OFF.
Definition: Hx3DWand.h:254
float m_wandScale
The scale factor of the wand.
Definition: Hx3DWand.h:249
const SbMatrix & sceneXform() const
Returns the matrix which transforms between scene coordinates and VR coordinates, i...
Definition: Hx3DWand.h:195
SbVec3f m_vrOrigin
The origin in VR coordinates.
Definition: Hx3DWand.h:297
const SbVec3f & top(bool scene=true) const
Returns the top of the 3D wand.
Definition: Hx3DWand.h:142
SbRotation m_sceneOrientation
The orientation in scene coordinates.
Definition: Hx3DWand.h:282
const SbMatrix * m_sceneToVRTransform
The scene to VR transform.
Definition: Hx3DWand.h:307
SbRotation m_vrOrientation
The orientation in VR coordinates.
Definition: Hx3DWand.h:302
WandGeom
Code for the two (highlighted and not) geometries.
Definition: Hx3DWand.h:259
float length(bool scene=true) const
Returns the length of the wand.
Definition: Hx3DWand.h:182
float m_sceneLength
The length in scene coordinates.
Definition: Hx3DWand.h:267
int m_buttonStatus
The buttons (all) combined status.
Definition: Hx3DWand.h:317
int m_lastButtonStatus
The buttons (all) combined status sampled during last scene graph traversal.
Definition: Hx3DWand.h:323
const SbMatrix * m_vrToSceneTransform
The inverse of scene to VR transform.
Definition: Hx3DWand.h:312
const SbVec3f & getHotSpot() const
Returns the HotSpot.
Definition: Hx3DWand.h:217
const SbRotation & orientation(bool scene=true) const
Returns the current orientation of the wand.
Definition: Hx3DWand.h:175
SbVec3f m_sceneTop
The top in scene coordinates.
Definition: Hx3DWand.h:272