H3D API  2.4.1
StereoInfo.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __STEREOINFO_H__
30 #define __STEREOINFO_H__
31 
32 #include <H3D/X3DBindableNode.h>
33 #include <H3D/SFFloat.h>
34 #include <H3D/SFRotation.h>
35 
36 namespace H3D {
51  class H3DAPI_API StereoInfo : public X3DBindableNode {
52  public:
54  StereoInfo( Inst< SFSetBind > _set_bind = 0,
55  Inst< SFNode > _metadata = 0,
56  Inst< SFTime > _bindTime = 0,
57  Inst< SFBool > _isBound = 0,
58  Inst< SFFloat > _interocularDistance = 0,
59  Inst< SFFloat > _focalDistance = 0,
60  Inst< SFRotation > _headTilt = 0,
61  Inst< SFFloat > _matrixViewShift = 0,
62  Inst< SFFloat > _matrixProjShift = 0,
63  Inst< SFBool > _swapEyes = 0 );
64 
66  static inline StereoInfo *getActive() {
67  return static_cast< StereoInfo * >( X3DBindableNode::getActive( "StereoInfo" ) );
68  }
69 
75  H3DUniquePtr< SFFloat > interocularDistance;
76 
82  H3DUniquePtr< SFFloat > focalDistance;
83 
91  H3DUniquePtr< SFRotation > headTilt;
92 
97  H3DUniquePtr< SFFloat > matrixViewShift;
98 
103  H3DUniquePtr< SFFloat > matrixProjShift;
104 
111  H3DUniquePtr< SFBool > swapEyes;
112 
114  void updateViewShift( float _matrixViewShift );
116  void updateProjShift( float _matrixProjShift );
117 
120  };
121 }
122 
123 #endif
Contains the SFFloat field class.
Contains the SFRotation field class.
Header file for X3DBindableNode, X3D scene-graph node.
The StereoInfo nis a bindable node that contains information used when rendering the scene in stereo.
Definition: StereoInfo.h:51
H3DUniquePtr< SFFloat > matrixProjShift
The matrixViewShift field specifies the projection matrix stereo shift.
Definition: StereoInfo.h:103
static StereoInfo * getActive()
Convenience function to get the top of the StereoInfo stack.
Definition: StereoInfo.h:66
H3DUniquePtr< SFRotation > headTilt
The headTilt field specifies how the head is oriented in relation to to the current X3DViewpointNode ...
Definition: StereoInfo.h:91
H3DUniquePtr< SFBool > swapEyes
The swapEyes field specifies if the eyes should be swapped in the current stereo mode.
Definition: StereoInfo.h:111
H3DUniquePtr< SFFloat > interocularDistance
The interocularDistance field specifies eye separation distance in metres, e.g.
Definition: StereoInfo.h:75
H3DUniquePtr< SFFloat > focalDistance
The focalDistance field specifies the distance in meters at which objects in the scene will appear to...
Definition: StereoInfo.h:82
H3DUniquePtr< SFFloat > matrixViewShift
The matrixViewShift field specifies the view matrix stereo shift.
Definition: StereoInfo.h:97
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: StereoInfo.h:119
X3DBindableNode is the abstract base type for all bindable children nodes, including Background,...
Definition: X3DBindableNode.h:108
static X3DBindableNode * getActive(const string &bindable_stack_name)
Returns the active bindable instance, i.e.
Definition: X3DBindableNode.h:149
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