H3D API
2.4.1
|
The NavigationInfo node contains information describing the physical characteristics of the viewer's avatar and viewing model. More...
#include <H3D/NavigationInfo.h>
Public Member Functions | |
NavigationInfo (Inst< SFSetBind > _set_bind=0, Inst< SFNode > _metadata=0, Inst< SFTime > _bindTime=0, Inst< SFBool > _isBound=0, Inst< MFFloat > _avatarSize=0, Inst< SFBool > _headlight=0, Inst< SFFloat > _speed=0, Inst< SFTime > _transitionTime=0, Inst< MFString > _transitionType=0, Inst< MFString > _type=0, Inst< SFFloat > _visibilityLimit=0, Inst< SFBool > _transitionComplete=0, Inst< SFBool > _headlightShadows=0, Inst< SFFloat > _nearVisibilityLimit=0) | |
Constructor. | |
![]() | |
X3DBindableNode (const string &_bindable_stack_name, Inst< SFSetBind > _set_bind=0, Inst< SFNode > _metadata=0, Inst< SFTime > _bindTime=0, Inst< SFBool > _isBound=0) | |
Constructor. | |
virtual | ~X3DBindableNode () |
Destructor. | |
virtual void | initialize () |
Initialize this bindable stack, toStackTop is done. | |
virtual void | toStackTop () |
Move this instance to the stack top. | |
virtual void | removeFromStack () |
Remove the bindable node from the stack. | |
bool | isStackTop () |
Is this node at the top of the stack. | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL) |
Returns a new instance of this node type with the same state as this one. More... | |
virtual | ~Node () |
Destructor. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More... | |
void | setProtoInstanceParent (X3DPrototypeInstance *p) |
Set the X3DPrototypeInstance this node is the the root node if applicaple. | |
virtual void | render () |
the render() function is used for the depth-first rendering traversal of the scene-graph. More... | |
virtual void | traverseSG (TraverseInfo &ti) |
traverseSG is called once per scenegraph loop on the scene in order to traverse the scenegraph. More... | |
virtual bool | lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result) |
Detect intersection between a line segment and the Node. More... | |
virtual void | closestPoint (const Vec3f &p, NodeIntersectResult &result) |
Find closest point on Node to p. More... | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the Node. More... | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
virtual Field * | getField (const string &_name) const |
return a pointer to the field specified by name within this instance | |
int | addDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
int | removeDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
Static Public Member Functions | |
static NavigationInfo * | getActive () |
Convenience function to get the top of the NavigationInfo stack. | |
![]() | |
static X3DBindableNode * | getActive (const string &bindable_stack_name) |
Returns the active bindable instance, i.e. More... | |
static const StackType & | getStack (const string &bindable_stack_name) |
Get the stack for a given name. | |
static const StackMapType & | getStackMap () |
Return the map of all bindable nodes available. | |
![]() | |
static unsigned int | nrNodesAlive () |
Returns the nr of nodes currently alive, i.e. nodes created but not destructed. | |
static int | nrNodesCreated () |
Returns the number of nodes created in total since the start of the program. | |
Public Attributes | |
H3DUniquePtr< MFFloat > | avatarSize |
The avatarSize field specifies the user's physical dimensions in the world for the purpose of collision detection and terrain following. More... | |
H3DUniquePtr< SFBool > | headlight |
The headlight field specifies whether a headlight should be turned on. More... | |
H3DUniquePtr< SFFloat > | speed |
The speed field specifies the rate at which the viewer travels through a scene in metres per second. More... | |
H3DUniquePtr< SFTime > | transitionTime |
The transitionTime field specifies the duration of any viewpoint transition. More... | |
H3DUniquePtr< MFString > | transitionType |
The transitionType field specifies an ordered list of paradigms that determine the manner in which the browser moves the viewer when a new Viewpoint node is bound. More... | |
H3DUniquePtr< MFString > | type |
The type field specifies an ordered list of navigation paradigms that specify a combination of navigation types and the initial navigation type. More... | |
H3DUniquePtr< SFFloat > | visibilityLimit |
Geometry beyond the visibilityLimit may not be rendered. More... | |
H3DUniquePtr< SFFloat > | nearVisibilityLimit |
Geometry closer than the nearVisibilityLimit may not be rendered. More... | |
H3DUniquePtr< SFBool > | transitionComplete |
When a transition completes, a transitionComplete event is signaled. More... | |
H3DUniquePtr< SFBool > | headlightShadows |
Determines if the headlight should be used in shadow calculations or not. More... | |
![]() | |
H3DUniquePtr< SFSetBind > | set_bind |
Input field to bind or unbind the node. More... | |
H3DUniquePtr< SFTime > | bindTime |
The bindTime field is the time at which the Viewpoint node is bound or unbound. More... | |
H3DUniquePtr< SFBool > | isBound |
Output field telling if this node is bound or not. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodedatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
![]() | |
static StackMapType | stack |
The bindable stack. | |
The NavigationInfo node contains information describing the physical characteristics of the viewer's avatar and viewing model.
NavigationInfo node is a bindable node. The range field specifies the ideal distances (termed level distances) at which to switch between the levels. If forceTransitions is TRUE, browsers shall switch levels at the level distances specified. If forceTransistions is FALSE, browsers may disregard level distances in order to provide better performance. Whenever the current Viewpoint nodes changes, the current NavigationInfo node shall be re-parented to it by the browser. Whenever the current NavigationInfo node changes, the new NavigationInfo node shall be re-parented to the current Viewpoint node by the browser.
If a TRUE value is sent to the set_bind field of a NavigationInfo node, the node is pushed onto the top of the NavigationInfo node stack. When a NavigationInfo node is bound, the browser uses the fields of the NavigationInfo node to set the navigation controls of its user interface and the NavigationInfo node is conceptually re-parented under the currently bound Viewpoint node. All subsequent scaling changes to the current Viewpoint node's coordinate system automatically change aspects (see below) of the NavigationInfo node values used in the browser (e.g., scale changes to any ancestors' transformations). A FALSE value sent to set_bind pops the NavigationInfo node from the stack, results in an isBound FALSE event, and pops to the next entry in the stack which shall be re-parented to the current Viewpoint node. 7.2.2 Bindable children nodes has more details on binding stacks.
The type field specifies an ordered list of navigation paradigms that specify a combination of navigation types and the initial navigation type. The navigation type of the currently bound NavigationInfo node determines the user interface capabilities of the browser. For example, if the currently bound NavigationInfo node's type is "WALK", the browser shall present a WALK navigation user interface paradigm (see below for description of WALK). Browsers shall recognize at least the following navigation types: "ANY", "WALK", "EXAMINE", "FLY", "LOOKAT", and "NONE" and with support as specified in Table 23.2.
If "ANY" does not appear in the type field list of the currently bound NavigationInfo, the browser's navigation user interface shall be restricted to the recognized navigation types specified in the list. In this case, browsers shall not present a user interface that allows the navigation type to be changed to a type not specified in the list. However, if any one of the values in the type field are "ANY", the browser may provide any type of navigation interface, and allow the user to change the navigation type dynamically. Furthermore, the first recognized type in the list shall be the initial navigation type presented by the browser's user interface.
ANY navigation specifies that the browser may choose the navigation paradigm that best suits the content and provide a user interface to allow the user to change the navigation paradigm dynamically. The results are undefined if the currently bound NavigationInfo's type value is "ANY" and Viewpoint transitions are triggered by the Anchor node or the loadURL() scripting method (neither is implemented yet in H3DAPI).
WALK navigation is used for exploring a virtual world on foot or in a vehicle that rests on or hovers above the ground. It is strongly recommended that WALK navigation define the up vector in the +Y direction and provide some form of terrain following and gravity in order to produce a walking or driving experience. If the bound NavigationInfo's type is "WALK", the browser shall strictly support collision detection.
FLY navigation is similar to WALK except that terrain following and gravity may be disabled or ignored. There shall still be some notion of "up" however. If the bound NavigationInfo's type is "FLY", the browser shall strictly support collision detection.
LOOKAT navigation is used to explore a scene by navigating to a particular object. Selecting an object with LOOKAT:
EXAMINE navigation is used for viewing individual objects. EXAMINE shall provide the ability to orbit or spin the user's eyepoint about the center of rotation in response to user actions. The center of rotation for moving the viewpoint around the object and determining the viewpoint orientation is specified in the currently bound Viewpoint node. The browser shall strictly support collision detection (see Collision) and shall trigger exit and enter events throughout EXAMINE operations.
LOOKAT navigation in combination with EXAMINE is used to explore a scene by navigating to a particular object, then being able to conveniently navigate in order to examine the object from different orientations. If content specifies both LOOKAT and EXAMINE types, any LOOKAT operations shall change the center of rotation for subsequent EXAMINE operations.
NONE navigation disables and removes all browser-specific navigation user interface forcing the user to navigate using only mechanisms provided in the scene, such as Anchor nodes or scripts that include loadURL(). NONE has an effect only when it is the first supported navigation type. If NONE is not the first supported navigation type, it has no effect.
If the NavigationInfo type is "WALK", "FLY", "EXAMINE", or "NONE" or a combination of these types (i.e., "ANY" is not in the list), Viewpoint transitions triggered by the Anchor node or the loadURL()scripting method shall be implemented as a jump from the old Viewpoint to the new Viewpoint with transition effects that shall not trigger events besides the exit and enter events caused by the jump.
Browsers may create browser-specific navigation type extensions. It is recommended that extended type names include a unique suffix (e.g., HELICOPTER_mydomain.com) to prevent conflicts. Viewpoint transitions triggered by the Anchor node or the loadURL()scripting method are undefined for extended navigation types. If none of the types are recognized by the browser, the default "ANY" is used. These strings values are case sensitive ("any" is not equal to "ANY").
The transitionType field specifies an ordered list of paradigms that determine the manner in which the browser moves the viewer when a new Viewpoint node is bound. Browsers shall recognize and support at least the following transition types: "TELEPORT", "LINEAR", and "ANIMATE". For value "TELEPORT", the transition shall be immediate without any intervening positions. For value "LINEAR", the browser shall perform a linear interpolation of the position and orientation values. For value "ANIMATE", the browser shall perform a browser-specific animation effect. If all values are unrecognized or the field is empty, the default value of "LINEAR" shall be used. This field applies to any transitions between positions and orientations including Viewpoint bindings and LOOKAT navigation type.
The transitionTime field specifies the duration of any viewpoint transition. The transition starts when the next Viewpoint node is bound. The duration of the transition depends on the value of the transitionType field. If transitionType is "TELEPORT", the transition is instantaneous and completes at the same time it starts. A transition type of "LINEAR" indicates that the transition lasts the number of seconds specified by the first value in the transitionTime field. If transitionType is "ANIMATE", transitionTime provides browser-dependent parameters to the browsers viewpoint animation engine. When a transition completes, a transitionComplete event is signaled.
The speed field specifies the rate at which the viewer travels through a scene in metres per second. Since browsers may provide mechanisms to travel faster or slower, this field specifies the default, average speed of the viewer when the NavigationInfo node is bound. If the NavigationInfo type is EXAMINE, speed shall not affect the viewer's rotational speed. Scaling in the transformation hierarchy of the currently bound Viewpoint node (see above) scales the speed; parent translation and rotation transformations have no effect on speed. Speed shall be non-negative. Zero speed indicates that the avatar's position is stationary, but its orientation and field of view may still change. If the navigation type is "NONE", the speed field has no effect.
The avatarSize field specifies the user's physical dimensions in the world for the purpose of collision detection and terrain following. It is a multi-value field allowing several dimensions to be specified. The first value shall be the allowable distance between the user's position and any collision geometry (as specified by a Collision node ) before a collision is detected. The second shall be the height above the terrain at which the browser shall maintain the viewer. The third shall be the height of the tallest object over which the viewer can move. This allows staircases to be built with dimensions that can be ascended by viewers in all browsers. The transformation hierarchy of the currently bound Viewpoint node scales the avatarSize. Translations and rotations have no effect on avatarSize.
In H3DAPI only the first entry of avatarSize is considered.
For purposes of terrain following, the browser maintains a notion of the down direction (down vector), since gravity is applied in the direction of the down vector. This down vector shall be along the negative Y-axis in the local coordinate system of the currently bound Viewpoint node (i.e., the accumulation of the Viewpoint node's ancestors' transformations, not including the Viewpoint node's orientation field).
Geometry beyond the visibilityLimit may not be rendered. A value of 0.0 indicates an infinite visibility limit. The visibilityLimit field is restricted to be greater than or equal to zero.
The speed, avatarSize and visibilityLimit values are all scaled by the transformation being applied to the currently bound Viewpoint node. If there is no currently bound Viewpoint node, the values are interpreted in the world coordinate system. This allows these values to be automatically adjusted when binding to a Viewpoint node that has a scaling transformation applied to it without requiring a new NavigationInfo node to be bound as well. The results are undefined if the scale applied to the Viewpoint node is non-uniform.
The headlight field specifies whether a browser shall turn on a headlight. A headlight is a directional light that always points in the direction the user is looking. Setting this field to TRUE allows the browser to provide a headlight, possibly with user interface controls to turn it on and off. Scenes that enlist precomputed lighting (EXAMPLE radiosity solutions) can turn the headlight off. The headlight shall have intensity = 1, color = (1 1 1), ambientIntensity = 0.0, and direction = (0 0 ?1).
It is recommended that the near clipping plane be set to one-half of the collision radius as specified in the avatarSize field (setting the near plane to this value prevents excessive clipping of objects just above the collision volume, and also provides a region inside the collision volume for content authors to include geometry intended to remain fixed relative to the viewer). Such geometry shall not be occluded by geometry outside of the collision volume.
Examples:
H3DUniquePtr< MFFloat > H3D::NavigationInfo::avatarSize |
The avatarSize field specifies the user's physical dimensions in the world for the purpose of collision detection and terrain following.
Only the first number in avatarSize is supported by H3DAPI.
Access type: inputOutput
Default value: [0.25 1.6 0.75]
Referenced by NavigationInfo(), and H3D::H3DWindowNode::render().
H3DUniquePtr< SFBool > H3D::NavigationInfo::headlight |
The headlight field specifies whether a headlight should be turned on.
A headlight is a directional light that always points in the direction the user is looking.
Access type: inputOutput
Default value: TRUE
Referenced by H3D::Scene::idle(), NavigationInfo(), H3D::H3DWindowNode::render(), H3D::Appearance::traverseSG(), and H3D::PhongShader::traverseSG().
H3DUniquePtr< SFBool > H3D::NavigationInfo::headlightShadows |
Determines if the headlight should be used in shadow calculations or not.
If FALSE no shadows will be cast using the head light.
Access type: inputOutput
Default value: FALSE
Referenced by H3D::Scene::idle(), and NavigationInfo().
H3DUniquePtr< SFFloat > H3D::NavigationInfo::nearVisibilityLimit |
Geometry closer than the nearVisibilityLimit may not be rendered.
This basically specifies the near clipping plane. A value of 0.0 indicates that the near clipping plane will be automatically calculated from the geometry in the scene. nearVisibilityLimit must always be less than visibilityLimit (with exception from the special case of 0.0).
Access type: inputOutput
Default value: 0
Default value: 0, [0.0,inf)
Referenced by NavigationInfo(), H3D::FrameBufferTextureGenerator::render(), and H3D::H3DWindowNode::render().
H3DUniquePtr< SFFloat > H3D::NavigationInfo::speed |
The speed field specifies the rate at which the viewer travels through a scene in metres per second.
Access type: inputOutput
Default value: 1.0
Referenced by NavigationInfo(), and H3D::H3DWindowNode::render().
H3DUniquePtr< SFBool > H3D::NavigationInfo::transitionComplete |
When a transition completes, a transitionComplete event is signaled.
Access type: outputOnly
H3DUniquePtr< SFTime > H3D::NavigationInfo::transitionTime |
The transitionTime field specifies the duration of any viewpoint transition.
Access type: inputOutput
Default value: 1.0
Valid Range: [0, Inf)
Referenced by NavigationInfo(), and H3D::H3DWindowNode::render().
H3DUniquePtr< MFString > H3D::NavigationInfo::transitionType |
The transitionType field specifies an ordered list of paradigms that determine the manner in which the browser moves the viewer when a new Viewpoint node is bound.
Not supported by H3D API.
Access type: inputOutput
Default value: ["LINEAR"]:
Valid values: "TELEPORT", "LINEAR", "ANIMATE"
Referenced by NavigationInfo(), and H3D::H3DWindowNode::render().
H3DUniquePtr< MFString > H3D::NavigationInfo::type |
The type field specifies an ordered list of navigation paradigms that specify a combination of navigation types and the initial navigation type.
Access type: inputOutput
Default value: ["EXAMINE", "ANY"]
Referenced by NavigationInfo(), and H3D::ProximitySensor::traverseSG().
H3DUniquePtr< SFFloat > H3D::NavigationInfo::visibilityLimit |
Geometry beyond the visibilityLimit may not be rendered.
A value of 0.0 indicates an infinite visibility limit. The visibilityLimit field is restricted to be greater than or equal to zero. This basically specifies the far clipping plane.
Access type: inputOutput
Default value: 0.0
Valid values: [0.0,inf)
Referenced by NavigationInfo(), H3D::FrameBufferTextureGenerator::render(), and H3D::H3DWindowNode::render().