H3D API
2.4.1
|
A background node that uses six individual texture nodes to compose the backdrop. More...
#include <H3D/TextureBackground.h>
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. | |
![]() | |
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. | |
![]() | |
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... | |
![]() | |
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 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< SFTextureNode > | backTexture |
The texture to use on the back face of the cube. More... | |
H3DUniquePtr< SFTextureNode > | frontTexture |
The texture to use on the front face of the cube. More... | |
H3DUniquePtr< SFTextureNode > | leftTexture |
The texture to use on the left face of the cube. More... | |
H3DUniquePtr< SFTextureNode > | rightTexture |
The texture to use on the right face of the cube. More... | |
H3DUniquePtr< SFTextureNode > | topTexture |
The texture to use on the top face of the cube. More... | |
H3DUniquePtr< SFTextureNode > | bottomTexture |
The texture to use on the bottom face of the cube. More... | |
H3DUniquePtr< SFFloat > | transparency |
The transparency field is not supported in H3D API. More... | |
![]() | |
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... | |
![]() | |
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. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
static X3DBackgroundNode * | getActive () |
Convenience function to get the top of the X3DBackgroundNode 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. | |
![]() | |
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... | |
![]() | |
H3DUniquePtr< SFMatrix4f > | localToGlobal |
A field that transforms from local to global space. More... | |
H3DUniquePtr< SFMatrix4d > | projectionMatrix |
Projection matrix for background C++ field only. | |
![]() | |
static StackMapType | stack |
The bindable stack. | |
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.
Examples:
H3DUniquePtr< SFTextureNode > H3D::TextureBackground::backTexture |
The texture to use on the back face of the cube.
Access type: inputOutput
Referenced by render(), and TextureBackground().
H3DUniquePtr< SFTextureNode > H3D::TextureBackground::bottomTexture |
The texture to use on the bottom face of the cube.
Access type: inputOutput
Referenced by render(), and TextureBackground().
H3DUniquePtr< SFTextureNode > H3D::TextureBackground::frontTexture |
The texture to use on the front face of the cube.
Access type: inputOutput
Referenced by render(), and TextureBackground().
H3DUniquePtr< SFTextureNode > H3D::TextureBackground::leftTexture |
The texture to use on the left face of the cube.
Access type: inputOutput
Referenced by render(), and TextureBackground().
H3DUniquePtr< SFTextureNode > H3D::TextureBackground::rightTexture |
The texture to use on the right face of the cube.
Access type: inputOutput
Referenced by render(), and TextureBackground().
H3DUniquePtr< SFTextureNode > H3D::TextureBackground::topTexture |
The texture to use on the top face of the cube.
Access type: inputOutput
Referenced by render(), and TextureBackground().
H3DUniquePtr< SFFloat > H3D::TextureBackground::transparency |
The transparency field is not supported in H3D API.
Access type: inputOutput