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

A background node that uses six individual texture nodes to compose the backdrop. More...

#include <H3D/TextureBackground.h>

Inheritance diagram for H3D::TextureBackground:
Inheritance graph

Public Types

typedef DependentSFNode< X3DTextureNode, FieldRef< H3DDisplayListObject, H3DDisplayListObject::DisplayList, &H3DDisplayListObject::displayList >, true > SFTextureNode
 The SFTextureNode field is dependent on the displayList field of the containing X3DTextureNode node.
 
- 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.
 

Public Member Functions

 TextureBackground (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< SFTextureNode > _backTexture=0, Inst< SFTextureNode > _frontTexture=0, Inst< SFTextureNode > _leftTexture=0, Inst< SFTextureNode > _rightTexture=0, Inst< SFTextureNode > _topTexture=0, Inst< SFTextureNode > _bottomTexture=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.
 
X3DMetadataObjectgetMetadataByName (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 Nodeclone (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.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 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 FieldgetField (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< SFTextureNodebackTexture
 The texture to use on the back face of the cube. More...
 
H3DUniquePtr< SFTextureNodefrontTexture
 The texture to use on the front face of the cube. More...
 
H3DUniquePtr< SFTextureNodeleftTexture
 The texture to use on the left face of the cube. More...
 
H3DUniquePtr< SFTextureNoderightTexture
 The texture to use on the right face of the cube. More...
 
H3DUniquePtr< SFTextureNodetopTexture
 The texture to use on the top face of the cube. More...
 
H3DUniquePtr< SFTextureNodebottomTexture
 The texture to use on the bottom face of the cube. More...
 
H3DUniquePtr< SFFloattransparency
 The transparency field is not supported in H3D API. More...
 
- Public Attributes inherited from H3D::X3DBackgroundNode
H3DUniquePtr< DisplayListdisplayList
 The DisplayList instance handling the OpenGL caching of this object.
 
H3DUniquePtr< MFFloatgroundAngle
 The groundAngle field specifies the angles from the nadir that the concentric circles of colour appear. More...
 
H3DUniquePtr< MFColorgroundColor
 The groundColor field specifies the colour of the ground at the various angles on the ground partial sphere. More...
 
H3DUniquePtr< MFFloatskyAngle
 The skyAngle field specifies the angles from the zenith in which concentric circles of colour appear. More...
 
H3DUniquePtr< MFColorskyColor
 The skyColor field specifies the colour of the sky at various angles on the sky sphere. More...
 
H3DUniquePtr< SFFloattransparency
 The transparency field simply specifies the transparency for the sky and ground. More...
 
- Public Attributes inherited from H3D::X3DBindableNode
H3DUniquePtr< SFSetBindset_bind
 Input field to bind or unbind the node. More...
 
H3DUniquePtr< SFTimebindTime
 The bindTime field is the time at which the Viewpoint node is bound or unbound. More...
 
H3DUniquePtr< SFBoolisBound
 Output field telling if this node is bound or not. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from H3D::X3DBackgroundNode
static X3DBackgroundNodegetActive ()
 Convenience function to get the top of the X3DBackgroundNode stack.
 
- Static Public Member Functions inherited from H3D::X3DBindableNode
static X3DBindableNodegetActive (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 NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 
- Protected Attributes inherited from H3D::X3DBackgroundNode
H3DUniquePtr< SFMatrix4flocalToGlobal
 A field that transforms from local to global space. More...
 
H3DUniquePtr< SFMatrix4dprojectionMatrix
 Projection matrix for background C++ field only.
 
- Static Protected Attributes inherited from H3D::X3DBindableNode
static StackMapType stack
 The bindable stack.
 

Detailed Description

A background node that uses six individual texture nodes to compose the backdrop.

Unlike the Background node, which only supports static image formats referenced by URL fields, the contents of the TextureBackground node can be arbitrary X3DTextureNode nodes.

The backTexture, bottomTexture, frontTexture, leftTexture, rightTexture, and topTexture fields specify a set of textures 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.

Internal routes:

Examples:

Member Data Documentation

◆ backTexture

H3DUniquePtr< SFTextureNode > H3D::TextureBackground::backTexture

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

Access type: inputOutput

Referenced by render(), and TextureBackground().

◆ bottomTexture

H3DUniquePtr< SFTextureNode > H3D::TextureBackground::bottomTexture

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

Access type: inputOutput

Referenced by render(), and TextureBackground().

◆ frontTexture

H3DUniquePtr< SFTextureNode > H3D::TextureBackground::frontTexture

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

Access type: inputOutput

Referenced by render(), and TextureBackground().

◆ leftTexture

H3DUniquePtr< SFTextureNode > H3D::TextureBackground::leftTexture

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

Access type: inputOutput

Referenced by render(), and TextureBackground().

◆ rightTexture

H3DUniquePtr< SFTextureNode > H3D::TextureBackground::rightTexture

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

Access type: inputOutput

Referenced by render(), and TextureBackground().

◆ topTexture

H3DUniquePtr< SFTextureNode > H3D::TextureBackground::topTexture

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

Access type: inputOutput

Referenced by render(), and TextureBackground().

◆ transparency

H3DUniquePtr< SFFloat > H3D::TextureBackground::transparency

The transparency field is not supported in H3D API.

Access type: inputOutput


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