SYNOPSIS
#include <Inventor/VRMLnodes/SoVRMLBillboard.h>
Inherits SoVRMLParent.
Public Member Functions
virtual SoType getTypeId (void) const
SoVRMLBillboard (void)
SoVRMLBillboard (int numchildren)
virtual void doAction (SoAction *action)
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void pick (SoPickAction *action)
virtual void search (SoSearchAction *action)
virtual void GLRenderBelowPath (SoGLRenderAction *action)
virtual void GLRenderInPath (SoGLRenderAction *action)
virtual void GLRenderOffPath (SoGLRenderAction *action)
virtual void notify (SoNotList *list)
Static Public Member Functions
static SoType getClassTypeId (void)
static void initClass (void)
Public Attributes
SoSFVec3f axisOfRotation
SoSFVec3f bboxCenter
SoSFVec3f bboxSize
Protected Member Functions
virtual const SoFieldData * getFieldData (void) const
virtual ~SoVRMLBillboard ()
Static Protected Member Functions
static const SoFieldData ** getFieldDataPtr (void)
Additional Inherited Members
Detailed Description
The SoVRMLBillboard class is used for rotating geometry towards the viewpoint.
The detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). It is copyright The Web3D Consortium, and is used by permission of the Consortium:
Billboard { eventIn MFNode addChildren eventIn MFNode removeChildren exposedField SFVec3f axisOfRotation 0 1 0 # (-inf, inf) exposedField MFNode children [] field SFVec3f bboxCenter 0 0 0 # (-inf, inf) field SFVec3f bboxSize -1 -1 -1 # (0, inf) or -1,-1,-1 }.fi The Billboard node is a grouping node which modifies its coordinate system so that the Billboard node's local Z-axis turns to point at the viewer. The Billboard node has children which may be other children nodes. The axisOfRotation field specifies which axis to use to perform the rotation. This axis is defined in the local coordinate system. When the axisOfRotation field is not (0, 0, 0), the following steps describe how to rotate the billboard to face the viewer:
- a. Compute the vector from the Billboard node's origin to the viewer's position. This vector is called the billboard-to-viewer vector.
- b. Compute the plane defined by the axisOfRotation and the billboard-to-viewer vector.
- c. Rotate the local Z-axis of the billboard into the plane from b., pivoting around the axisOfRotation.
- d. Compute the billboard-to-viewer vector.
- e. Rotate the Z-axis of the billboard to be collinear with the billboard-to-viewer vector and pointing towards the viewer's position.
- f. Rotate the Y-axis of the billboard to be parallel and oriented in the same direction as the Y-axis of the viewer.
Constructor & Destructor Documentation
SoVRMLBillboard::SoVRMLBillboard (void)
Constructor.SoVRMLBillboard::SoVRMLBillboard (intnumchildren)
Constructor. numchildren is the expected number of children.SoVRMLBillboard::~SoVRMLBillboard () [protected], [virtual]
Destructor.Member Function Documentation
SoType SoVRMLBillboard::getClassTypeId (void) [static]
This static method returns the SoType object associated with objects of this class.Reimplemented from SoVRMLParent.
SoType SoVRMLBillboard::getTypeId (void) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting.Usage example:
void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } }
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Reimplemented from SoVRMLParent.
const SoFieldData ** SoVRMLBillboard::getFieldDataPtr (void) [static], [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.Reimplemented from SoVRMLParent.
const SoFieldData * SoVRMLBillboard::getFieldData (void) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.Reimplemented from SoVRMLParent.
void SoVRMLBillboard::initClass (void) [static]
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.Reimplemented from SoVRMLParent.
void SoVRMLBillboard::doAction (SoAction *action) [virtual]
This function performs the typical operation of a node for any action.Reimplemented from SoVRMLParent.
void SoVRMLBillboard::callback (SoCallbackAction *action) [virtual]
Action method for SoCallbackAction.Simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph.
Reimplemented from SoGroup.
void SoVRMLBillboard::GLRender (SoGLRenderAction *action) [virtual]
Action method for the SoGLRenderAction.This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method.
Reimplemented from SoGroup.
void SoVRMLBillboard::getBoundingBox (SoGetBoundingBoxAction *action) [virtual]
Action method for the SoGetBoundingBoxAction.Calculates bounding box and center coordinates for node and modifies the values of the action to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node.
Nodes influencing how geometry nodes calculates their bounding box also overrides this method to change the relevant state variables.
Reimplemented from SoGroup.
void SoVRMLBillboard::getMatrix (SoGetMatrixAction *action) [virtual]
Action method for SoGetMatrixAction.Updates action by accumulating with the transformation matrix of this node (if any).
Reimplemented from SoGroup.
void SoVRMLBillboard::pick (SoPickAction *action) [virtual]
Action method for SoPickAction.Does common processing for SoPickAction action instances.
Reimplemented from SoGroup.
void SoVRMLBillboard::search (SoSearchAction *action) [virtual]
Action method for SoSearchAction.Compares the search criteria from the action to see if this node is a match. Searching is done by matching up all criteria set up in the SoSearchAction -- if any of the requested criteria is a miss, the search is not deemed successful for the node.
See also:
- SoSearchAction
Reimplemented from SoVRMLParent.
void SoVRMLBillboard::GLRenderBelowPath (SoGLRenderAction *action) [virtual]
Implements the SoAction::BELOW_PATH traversal method for the rendering action.Reimplemented from SoNode.
void SoVRMLBillboard::GLRenderInPath (SoGLRenderAction *action) [virtual]
Implements the SoAction::IN_PATH traversal method for the rendering action.Reimplemented from SoNode.
void SoVRMLBillboard::GLRenderOffPath (SoGLRenderAction *action) [virtual]
Implements the SoAction::OFF_PATH traversal method for the rendering action.Reimplemented from SoNode.
void SoVRMLBillboard::notify (SoNotList *l) [virtual]
Notifies all auditors for this instance when changes are made.Reimplemented from SoVRMLParent.
Member Data Documentation
SoSFVec3f SoVRMLBillboard::axisOfRotation
The axis of rotation for the geometry.SoSFVec3f SoVRMLBillboard::bboxCenter
The bounding box center hint. Default value is (0, 0, 0).SoSFVec3f SoVRMLBillboard::bboxSize
The bounding box size hint. Default value is (-1, -1, -1).
Author
Generated automatically by Doxygen for Coin from the source code.