H3D API  2.4.1
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
H3D::Background Class Reference

A background node that uses six static images to compose the backdrop. More...

#include <H3D/Background.h>

Inheritance diagram for H3D::Background:
Inheritance graph

Public Member Functions

 Background (Inst< SFSetBind > _set_bind=0, Inst< SFNode > _metadata=0, Inst< SFTime > _bindTime=0, Inst< SFBool > _isBound=0, Inst< DisplayList > _displayList=0, Inst< MFFloat > _groundAngle=0, Inst< MFColor > _groundColor=0, Inst< MFFloat > _skyAngle=0, Inst< MFColor > _skyColor=0, Inst< MFString > _backUrl=0, Inst< MFString > _frontUrl=0, Inst< MFString > _leftUrl=0, Inst< MFString > _rightUrl=0, Inst< MFString > _topUrl=0, Inst< MFString > _bottomUrl=0, Inst< SFFloat > _transparency=0)
 Constructor.
 
virtual void render ()
 Renders the background with OpenGL.
 
- Public Member Functions inherited from H3D::X3DBackgroundNode
 X3DBackgroundNode (Inst< SFSetBind > _set_bind=0, Inst< SFNode > _metadata=0, Inst< SFTime > _bindTime=0, Inst< SFBool > _isBound=0, Inst< DisplayList > _displayList=0, Inst< MFFloat > _groundAngle=0, Inst< MFColor > _groundColor=0, Inst< MFFloat > _skyAngle=0, Inst< MFColor > _skyColor=0, Inst< SFFloat > _transparency=0)
 Constructor.
 
virtual void traverseSG (TraverseInfo &ti)
 Saves the accForwardMatrix for use in the render function.
 
virtual void renderBackground ()
 Renders the background with OpenGL. More...
 
virtual RGBA glClearColor ()
 Returns the color that OpenGL should clear the buffer with before starting to render to it. More...
 
- Public Member Functions inherited from H3D::X3DBindableNode
 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.
 
- Public Member Functions inherited from H3D::X3DChildNode
 X3DChildNode (Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 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...
 
- Public Member Functions inherited from H3D::Node
 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 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...
 

Public Attributes

H3DUniquePtr< MFString > backUrl
 The url of the texture to use on the back face of the cube. More...
 
H3DUniquePtr< MFString > frontUrl
 The url of the texture to use on the front face of the cube. More...
 
H3DUniquePtr< MFString > leftUrl
 The url of the texture to use on the left face of the cube. More...
 
H3DUniquePtr< MFString > rightUrl
 The url of the texture to use on the right face of the cube. More...
 
H3DUniquePtr< MFString > topUrl
 The url of the texture to use on the top face of the cube. More...
 
H3DUniquePtr< MFString > bottomUrl
 The url of the texture to use on the bottom face of the cube. More...
 
- Public Attributes inherited from H3D::X3DBackgroundNode
H3DUniquePtr< DisplayList > displayList
 The DisplayList instance handling the OpenGL caching of this object.
 
H3DUniquePtr< MFFloat > groundAngle
 The groundAngle field specifies the angles from the nadir that the concentric circles of colour appear. More...
 
H3DUniquePtr< MFColor > groundColor
 The groundColor field specifies the colour of the ground at the various angles on the ground partial sphere. More...
 
H3DUniquePtr< MFFloat > skyAngle
 The skyAngle field specifies the angles from the zenith in which concentric circles of colour appear. More...
 
H3DUniquePtr< MFColor > skyColor
 The skyColor field specifies the colour of the sky at various angles on the sky sphere. More...
 
H3DUniquePtr< SFFloat > transparency
 The transparency field simply specifies the transparency for the sky and ground. More...
 
- Public Attributes inherited from H3D::X3DBindableNode
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...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNode > metadata
 Meta data about the node. More...
 

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DBackgroundNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DBindableNode
static H3DNodeDatabase database
 The H3DNodedatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Protected Attributes

AutoRef< ImageTexture > backTexture
 The texture displayed at the back.
 
AutoRef< ImageTexture > frontTexture
 The texture displayed at the front.
 
AutoRef< ImageTexture > leftTexture
 The texture displayed to the left.
 
AutoRef< ImageTexture > rightTexture
 The texture displayed to the right.
 
AutoRef< ImageTexture > topTexture
 The texture displayed at the top.
 
AutoRef< ImageTexture > bottomTexture
 The texture displayed at the bottom.
 
- Protected Attributes inherited from H3D::X3DBackgroundNode
H3DUniquePtr< SFMatrix4f > localToGlobal
 A field that transforms from local to global space. More...
 
H3DUniquePtr< SFMatrix4d > projectionMatrix
 Projection matrix for background C++ field only.
 

Additional Inherited Members

- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Static Public Member Functions inherited from H3D::X3DBackgroundNode
static X3DBackgroundNode * getActive ()
 Convenience function to get the top of the X3DBackgroundNode stack.
 
- Static Public Member Functions inherited from H3D::X3DBindableNode
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 Public Member Functions inherited from H3D::Node
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.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static Node * getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 
- Static Protected Attributes inherited from H3D::X3DBindableNode
static StackMapType stack
 The bindable stack.
 

Detailed Description

A background node that uses six static images to compose the backdrop.

The backUrl, bottomUrl, frontUrl, leftUrl, rightUrl, and topUrl fields specify the url to a set of images that define a background panorama between the ground/sky backdrop and the scene's geometry. The panorama consists of six images, each of which is mapped onto a face of an infinitely large cube contained within the backdrop spheres and centred in the local coordinate system. The images are applied individually to each face of the cube. On the front, back, right, and left faces of the cube, when viewed from the origin looking down the negative Z-axis with the Y-axis as the view up direction, each image is mapped onto the corresponding face with the same orientation as if the image were displayed normally in 2D (back to back face, front to front face, left to left face, and right to right face). On the top face of the cube, when viewed from the origin looking along the +Y-axis with the +Z-axis as the view up direction, the top image is mapped onto the face with the same orientation as if the image were displayed normally in 2D. On the bottom face of the box, when viewed from the origin along the negative Y-axis with the negative Z-axis as the view up direction, the bottom image is mapped onto the face with the same orientation as if the image were displayed normally in 2D.

Alpha values in the panorama images (i.e., two or four component images) specify that the panorama is semi-transparent or transparent in regions, allowing the groundColor and skyColor to be visible.

Often, the bottom and top images will not be specified, to allow sky and ground to show. The other four images may depict surrounding mountains or other distant scenery.

The other fields work just as in X3DBackgroundNode.

Examples:

Internal routes:

Member Data Documentation

◆ backUrl

H3DUniquePtr< MFString > H3D::Background::backUrl

The url of the texture to use on the back face of the cube.

Access type: inputOutput

Referenced by Background(), and render().

◆ bottomUrl

H3DUniquePtr< MFString > H3D::Background::bottomUrl

The url of the texture to use on the bottom face of the cube.

Access type: inputOutput

Referenced by Background(), and render().

◆ frontUrl

H3DUniquePtr< MFString > H3D::Background::frontUrl

The url of the texture to use on the front face of the cube.

Access type: inputOutput

Referenced by Background(), and render().

◆ leftUrl

H3DUniquePtr< MFString > H3D::Background::leftUrl

The url of the texture to use on the left face of the cube.

Access type: inputOutput

Referenced by Background(), and render().

◆ rightUrl

H3DUniquePtr< MFString > H3D::Background::rightUrl

The url of the texture to use on the right face of the cube.

Access type: inputOutput

Referenced by Background(), and render().

◆ topUrl

H3DUniquePtr< MFString > H3D::Background::topUrl

The url of the texture to use on the top face of the cube.

Access type: inputOutput

Referenced by Background(), and render().


The documentation for this class was generated from the following files: