29 #ifndef __X3DX3DViewpointNodeNODE_H__
30 #define __X3DX3DViewpointNodeNODE_H__
260 virtual void setValue(
const Vec3f &v,
int _id = 0 ) {
264 temp_owner->
relPos->setValue( Vec3f() );
273 temp_owner->
relPos->setValue( Vec3f() );
278 friend class SFPosition;
286 virtual void setValue(
const Rotation &v,
int _id = 0 ) {
290 temp_owner->
relPos->setValue( Vec3f() );
299 temp_owner->
relPos->setValue( Vec3f() );
304 friend class SFOrientation;
309 public TypedField< SFVec3f, Types< SFPosition, SFVec3f > > {
318 friend class SFSumVec3f;
323 Types< SFOrientation, SFRotation > > {
329 temp_rot.axis.normalizeSafe();
335 friend class SFSumRotation;
340 Inst< SFVec3f > _centerOfRotation = 0,
341 Inst< SFString > _description = 0,
342 Inst< SFBool > _jump = 0,
343 Inst< SFNode > _metadata = 0,
344 Inst< SFOrientation > _orientation = 0,
345 Inst< SFPosition > _position = 0,
346 Inst< SFBool > _retainUserOffsets = 0,
347 Inst< SFTime > _bindTime = 0,
348 Inst< SFBool > _isBound = 0,
349 Inst< SFMatrix4f > _accForwardMatrix = 0,
350 Inst< SFMatrix4f > _accInverseMatrix = 0,
351 Inst< SFSumVec3f > _totalPosition = 0,
352 Inst< SFSumRotation > _totalOrientation = 0 );
357 viewpoints.remove(
this );
358 viewpoints_changed =
true;
388 #ifndef H3D_GENERATE_DOTROUTE_FILES
395 virtual void toStackTop();
398 virtual void removeFromStack();
406 virtual void rotateAround(
Rotation rotation,
bool collision,
407 Vec3f rotation_center );
411 virtual void rotateAroundSelf(
Rotation rotation );
422 virtual void translate( Vec3f direction,
bool collision,
423 const vector< H3DFloat > &avatar_size,
428 virtual void moveTo( Vec3f new_pos );
431 virtual bool detectCollision(
const vector< H3DFloat > &avatar_size,
434 typedef list< X3DViewpointNode * > ViewpointList;
444 bool status = viewpoints_changed;
445 viewpoints_changed =
false;
464 bool update_stereo_proj_shift =
false )
465 #ifndef H3D_GENERATE_DOTROUTE_FILES
473 virtual Matrix4f getProjectionMatrix( EyeMode eye_mode,
477 bool mirrored_in_y =
false );
486 virtual void setupViewMatrix( EyeMode eye_mode,
488 bool update_stereo_view_shift =
false );
493 virtual Matrix4f getViewMatrix( EyeMode eye_mode,
503 return in_scene_graph;
608 static ViewpointList viewpoints;
609 static bool viewpoints_changed;
620 void getProjectionDimensions(
EyeMode eye_mode,
629 bool update_stereo_proj_shift =
false );
Contains different templates to modify field behaviour.
Contains the SFFloat field class.
Contains the SFMatrix4f field class.
Contains the SFRotation field class.
Contains the SFString field class.
Contains the SFVec3f field class.
Header file for StereoInfo, X3D scene-graph node.
Header file for X3DBindableNode, X3D scene-graph node.
The SFRotation field contains one arbitrary Rotation.
Definition: SFRotation.h:41
The SFVec3f field contains a Vec3f.
Definition: SFVec3f.h:41
virtual void setValue(const Vec3f &v, int id=0)
Set the value of the field.
Definition: SField.h:215
virtual void update()
Make the field up to date given that an event has occured.
Definition: SField.h:181
The StereoInfo nis a bindable node that contains information used when rendering the scene in stereo.
Definition: StereoInfo.h:51
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
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
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
This field is used for the orientation field in order to reset the internal variables rel_pos and rel...
Definition: X3DViewpointNode.h:284
virtual void update()
Make the field up to date given that an event has occured.
Definition: X3DViewpointNode.h:295
This field is used for the position field in order to reset the internal variables rel_pos and rel_or...
Definition: X3DViewpointNode.h:258
virtual void update()
Make the field up to date given that an event has occured.
Definition: X3DViewpointNode.h:269
This field sums the value of the two SFRotation routed to it.
Definition: X3DViewpointNode.h:323
virtual void update()
Make the field up to date given that an event has occured.
Definition: X3DViewpointNode.h:325
This field sums the value of the two SFVec3f routed to it.
Definition: X3DViewpointNode.h:309
virtual void update()
Make the field up to date given that an event has occured.
Definition: X3DViewpointNode.h:311
The X3DViewpointNode node defines a specific location in the local coordinate system from which the u...
Definition: X3DViewpointNode.h:239
static bool viewpointsChanged()
True on any addition/deletion/in_scene_graph status change of viewpoints, reset once inquired.
Definition: X3DViewpointNode.h:443
bool inSceneGraph()
True if this viewpoint node exists in scene graph.
Definition: X3DViewpointNode.h:502
bool is_top_level
True if the viewpooint exists outside a ViewpointGroup.
Definition: X3DViewpointNode.h:612
static const ViewpointList & getAllViewpoints()
Returns a list of all current X3DViewpointNode instances.
Definition: X3DViewpointNode.h:437
bool in_scene_graph
True is the viewpoint exists in scene graph.
Definition: X3DViewpointNode.h:615
H3DUniquePtr< SFSumRotation > totalOrientation
Returns the sum of the field orientation and the internal field relOrn used for navigation.
Definition: X3DViewpointNode.h:593
virtual bool windowFromfieldOfView(H3DFloat width, H3DFloat height, H3DFloat clip_near, H3DFloat &top, H3DFloat &bottom, H3DFloat &right, H3DFloat &left)=0
Calculates the top, bottom, right and left clipping values for the view frustum at the near plane.
bool isTopLevel()
True if this viewpoint node exists outside a ViewpointGroup.
Definition: X3DViewpointNode.h:497
H3DUniquePtr< SFSumVec3f > totalPosition
Returns the sum of the field position and the internal field relPos used for navigation.
Definition: X3DViewpointNode.h:585
virtual ~X3DViewpointNode()
Destructor.
Definition: X3DViewpointNode.h:355
H3DUniquePtr< SFMatrix4f > accInverseMatrix
The matrix from global space to the local space the X3DViewpointNode resides in.
Definition: X3DViewpointNode.h:577
virtual void setupProjection(EyeMode eye_mode, H3DFloat width, H3DFloat height, H3DFloat clip_near, H3DFloat clip_far, StereoInfo *stereo_info=0, bool update_stereo_proj_shift=false)=0
Adds a projection matrix to the current OpenGL matrix based on the viewpoint values.
H3DUniquePtr< SFPosition > position
Specifies the position of the X3DViewpointNode the local coordinate system.
Definition: X3DViewpointNode.h:552
H3DUniquePtr< SFString > description
The description field specifies a textual description of the X3DViewpointNode node.
Definition: X3DViewpointNode.h:522
H3DUniquePtr< SFVec3f > relPos
Internal field that stores the relative offset from the position set by the user.
Definition: X3DViewpointNode.h:600
H3DUniquePtr< SFOrientation > orientation
Specifies the orientation of the X3DViewpointNode relative to the default orientation.
Definition: X3DViewpointNode.h:543
static X3DViewpointNode * getActive()
Convenience function to get the top of the X3DViewpointNode stack.
Definition: X3DViewpointNode.h:369
H3DUniquePtr< SFRotation > relOrn
Internal field that stores the relative offset from the orientation set by the user.
Definition: X3DViewpointNode.h:605
EyeMode
Used with setupProjection function to indicate for which eye the frustum should be calculated.
Definition: X3DViewpointNode.h:244
H3DUniquePtr< SFBool > retainUserOffsets
The retainUserOffsets field indicates whether a viewpoint needs to retain (TRUE) or reset to zero (FA...
Definition: X3DViewpointNode.h:562
H3DUniquePtr< SFVec3f > centerOfRotation
The centerOfRotation field specifies a center about which to rotate the user's eyepoint when in EXAMI...
Definition: X3DViewpointNode.h:513
H3DUniquePtr< SFBool > jump
The jump field specifies whether the user's view "jumps" to the position and orientation of a bound X...
Definition: X3DViewpointNode.h:532
H3DUniquePtr< SFMatrix4f > accForwardMatrix
The matrix from local space to global space.
Definition: X3DViewpointNode.h:569
Type getValue(const char *s, const char *&rest)
Function that reads characters from a char * and converts them to a given type.
Definition: X3DFieldConversion.h:134
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