H3D API  2.4.1
Viewpoint.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 __VIEWPOINT_H__
30 #define __VIEWPOINT_H__
31 
32 #include <H3D/X3DViewpointNode.h>
33 #include <H3D/FieldTemplates.h>
34 #include <H3DUtil/Exception.h>
35 
36 namespace H3D {
64  class H3DAPI_API Viewpoint : public X3DViewpointNode {
65  public:
67  Viewpoint(
68  Inst< SFSetBind > _set_bind = 0,
69  Inst< SFVec3f > _centerOfRotation = 0,
70  Inst< SFString > _description = 0,
71  Inst< SFFloat > _fieldOfView = 0,
72  Inst< SFBool > _jump = 0,
73  Inst< SFNode > _metadata = 0,
74  Inst< SFOrientation> _orientation = 0,
75  Inst< SFPosition > _position = 0,
76  Inst< SFBool > _retainUserOffsets = 0,
77  Inst< SFTime > _bindTime = 0,
78  Inst< SFBool > _isBound = 0,
79  Inst< SFMatrix4f > _accForwardMatrix = 0,
80  Inst< SFMatrix4f > _accInverseMatrix = 0 );
81 
82 
83  // calculate the horizontal and vertical field of view components
84  // as defined by the X3D spec for Viewpoint.
85  virtual bool windowFromfieldOfView( H3DFloat width, H3DFloat height,
86  H3DFloat clip_near,
87  H3DFloat &top, H3DFloat &bottom,
88  H3DFloat &right, H3DFloat &left );
89 
92  virtual void setupProjection( EyeMode eye_mode,
93  H3DFloat width, H3DFloat height,
94  H3DFloat clip_near, H3DFloat clip_far,
95  StereoInfo * stereo_info = 0,
96  bool update_stereo_proj_shift = false );
97 
104  H3DUniquePtr< SFFloat > fieldOfView;
105 
106  static H3DNodeDatabase database;
107  };
108 }
109 
110 #endif
Contains different templates to modify field behaviour.
Header file for X3DViewpointNode, X3D scene-graph node.
The StereoInfo nis a bindable node that contains information used when rendering the scene in stereo.
Definition: StereoInfo.h:51
The Viewpoint node defines a viewpoint that provides a perspective view of the scene.
Definition: Viewpoint.h:64
H3DUniquePtr< SFFloat > fieldOfView
The fieldOfView field specifies a preferred minimum viewing angle from this viewpoint in radians.
Definition: Viewpoint.h:104
The X3DViewpointNode node defines a specific location in the local coordinate system from which the u...
Definition: X3DViewpointNode.h:239
EyeMode
Used with setupProjection function to indicate for which eye the frustum should be calculated.
Definition: X3DViewpointNode.h:244
float H3DFloat
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