00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00027
00029 #ifndef __VIEWPOINT_H__
00030 #define __VIEWPOINT_H__
00031
00032 #include "X3DBindableNode.h"
00033 #include "FieldTemplates.h"
00034 #include "Exception.h"
00035 #include "SFVec3f.h"
00036 #include "SFString.h"
00037 #include "SFFloat.h"
00038 #include "SFRotation.h"
00039 #include "SFMatrix4f.h"
00040
00041 namespace H3D {
00226 class H3DAPI_API Viewpoint : public X3DBindableNode {
00227 public:
00229 Viewpoint(
00230 Inst< SFSetBind > _set_bind = 0,
00231 Inst< SFVec3f > _centerOfRotation = 0,
00232 Inst< SFString > _description = 0,
00233 Inst< SFFloat > _fieldOfView = 0,
00234 Inst< SFBool > _jump = 0,
00235 Inst< SFNode > _metadata = 0,
00236 Inst< SFRotation> _orientation = 0,
00237 Inst< SFVec3f > _position = 0,
00238 Inst< SFTime > _bindTime = 0,
00239 Inst< SFBool > _isBound = 0,
00240 Inst< SFMatrix4f > _accForwardMatrix = 0,
00241 Inst< SFMatrix4f > _accInverseMatrix = 0 );
00242
00243 #ifdef USE_HAPTICS
00247 virtual void traverseSG( TraverseInfo &ti ) {
00248 accInverseMatrix->setValue( ti.getAccInverseMatrix(), id );
00249 accForwardMatrix->setValue( ti.getAccForwardMatrix(), id );
00250 }
00251 #endif
00252
00254 static inline Viewpoint *getActive() {
00255 return static_cast< Viewpoint * >( X3DBindableNode::getActive( "Viewpoint" ) );
00256 }
00257
00263 auto_ptr< SFVec3f > centerOfRotation;
00264
00270 auto_ptr< SFString > description;
00271
00279 auto_ptr< SFFloat > fieldOfView;
00280
00287 auto_ptr< SFBool > jump;
00288
00296 auto_ptr< SFRotation > orientation;
00297
00302 auto_ptr< SFVec3f > position;
00303
00307 auto_ptr< SFMatrix4f > accForwardMatrix;
00308
00313 auto_ptr< SFMatrix4f > accInverseMatrix;
00314
00315 static H3DNodeDatabase database;
00316 };
00317 }
00318
00319 #endif