Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::Billboard Class Reference

Billboard - a Geode which orientates its child osg::Drawable's to face the eye point. More...

Inheritance diagram for osg::Billboard:

Inheritance graph
[legend]
List of all members.

Public Types

typedef std::vector< Vec3 > PositionList
 PositionList represents a list of pivot points for each drawable.

enum  Mode { POINT_ROT_EYE, POINT_ROT_WORLD, AXIAL_ROT }

Public Methods

 Billboard ()
 Billboard (const Billboard &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.

 META_Node (osg, Billboard)
void setMode (const Mode mode)
 Set the billboard rotation mode.

const Mode getMode () const
 Get the billboard rotation mode.

void setAxis (const Vec3 &axis)
 Set the axis about which all the billboard's drawable rotate.

const Vec3 & getAxis () const
 Get the axis about which all the billboard's drawable rotate.

void setNormal (const Vec3 &normal)
 Set the normal which defines the billboard's drawable front face, when unrotated.

const Vec3 & getNormal () const
 Get the normal of billboard's drawable front face.

void setPos (int i, const Vec3 &pos)
 Set the position of specified drawable.

const Vec3 & getPos (int i) const
 Get the position of specified drawable.

PositionList & getPositionList ()
 Get the PositionList from the billboard.

const PositionList & getPositionList () const
 Get a const PositionList from the billboard.

virtual const bool addDrawable (Drawable *gset)
 Add Drawable to Billboard with default position(0,0,0); If gset not NULL and is not contained in Billboard then increment its reference count, and dirty the bounding box to cause it to recompute on next getBound() and return true for success.

virtual const bool addDrawable (Drawable *gset, const Vec3 &pos)
 Add Drawable to Geode at position pos.

virtual const bool removeDrawable (Drawable *gset)
 Remove Drawable and associated position from Billboard.

const bool getMatrix (Matrix &modelview, const Vec3 &eye_local, const Vec3 &pos_local) const
virtual const bool computeMatrix (Matrix &modelview, const Vec3 &eye_local, const Vec3 &pos_local) const

Protected Types

enum  AxisAligned { AXIAL_ROT_X_AXIS = AXIAL_ROT+1, AXIAL_ROT_Y_AXIS, AXIAL_ROT_Z_AXIS, CACHE_DIRTY }

Protected Methods

virtual ~Billboard ()
virtual const bool computeBound () const
 Compute the bounding sphere around Node's geometry or children.

void updateCache ()

Protected Attributes

Mode _mode
Vec3 _axis
Vec3 _normal
PositionList _positionList
int _cachedMode
Vec3 _side

Detailed Description

Billboard - a Geode which orientates its child osg::Drawable's to face the eye point.

Typical uses are for trees, or particle explosions.


Member Typedef Documentation

typedef std::vector<Vec3> osg::Billboard::PositionList
 

PositionList represents a list of pivot points for each drawable.


Member Enumeration Documentation

enum osg::Billboard::AxisAligned [protected]
 

Enumeration values:
AXIAL_ROT_X_AXIS 
AXIAL_ROT_Y_AXIS 
AXIAL_ROT_Z_AXIS 
CACHE_DIRTY 

enum osg::Billboard::Mode
 

Enumeration values:
POINT_ROT_EYE 
POINT_ROT_WORLD 
AXIAL_ROT 


Constructor & Destructor Documentation

osg::Billboard::Billboard (    ) 
 

osg::Billboard::Billboard (  const Billboard &   ,
const CopyOp &    copyop = CopyOp::SHALLOW_COPY
) 
 

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::Billboard::~Billboard (    )  [protected, virtual]
 


Member Function Documentation

virtual const bool osg::Billboard::addDrawable (  Drawable *    gset,
const Vec3 &    pos
)  [virtual]
 

Add Drawable to Geode at position pos.

If gset not NULL and is not contained in Billboard then increment its reference count, and dirty the bounding box to cause it to recompute on next getBound() and return true for success. Otherwise return false.

virtual const bool osg::Billboard::addDrawable (  Drawable *    gset )  [virtual]
 

Add Drawable to Billboard with default position(0,0,0); If gset not NULL and is not contained in Billboard then increment its reference count, and dirty the bounding box to cause it to recompute on next getBound() and return true for success.

Otherwise return false.

Reimplemented from osg::Geode.

virtual const bool osg::Billboard::computeBound (    )  const [protected, virtual]
 

Compute the bounding sphere around Node's geometry or children.

This method is automatically called by getBound() when the bounding sphere has been marked dirty via dirtyBound().

Reimplemented from osg::Geode.

virtual const bool osg::Billboard::computeMatrix (  Matrix &    modelview,
const Vec3 &    eye_local,
const Vec3 &    pos_local
)  const [virtual]
 

const Vec3& osg::Billboard::getAxis (    )  const [inline]
 

Get the axis about which all the billboard's drawable rotate.

const bool osg::Billboard::getMatrix (  Matrix &    modelview,
const Vec3 &    eye_local,
const Vec3 &    pos_local
)  const [inline]
 

const Mode osg::Billboard::getMode (    )  const [inline]
 

Get the billboard rotation mode.

const Vec3& osg::Billboard::getNormal (    )  const [inline]
 

Get the normal of billboard's drawable front face.

const Vec3& osg::Billboard::getPos (  int    i )  const [inline]
 

Get the position of specified drawable.

const PositionList& osg::Billboard::getPositionList (    )  const [inline]
 

Get a const PositionList from the billboard.

PositionList& osg::Billboard::getPositionList (    )  [inline]
 

Get the PositionList from the billboard.

osg::Billboard::META_Node (  osg   ,
Billboard   
) 
 

virtual const bool osg::Billboard::removeDrawable (  Drawable *    gset )  [virtual]
 

Remove Drawable and associated position from Billboard.

If gset is contained in Billboard then remove it from the geoset list and decrement its reference count, and dirty the bounding box to cause it to recompute on next getBound() and return true for success. If gset is not found then return false and do not the reference count of gset is left unchanged.

Reimplemented from osg::Geode.

void osg::Billboard::setAxis (  const Vec3 &    axis ) 
 

Set the axis about which all the billboard's drawable rotate.

Only utlized when mode==AXIAL_ROT

void osg::Billboard::setMode (  const Mode    mode ) 
 

Set the billboard rotation mode.

void osg::Billboard::setNormal (  const Vec3 &    normal ) 
 

Set the normal which defines the billboard's drawable front face, when unrotated.

void osg::Billboard::setPos (  int    i,
const Vec3 &    pos
)  [inline]
 

Set the position of specified drawable.

void osg::Billboard::updateCache (    )  [protected]
 


Member Data Documentation

Vec3 osg::Billboard::_axis [protected]
 

int osg::Billboard::_cachedMode [protected]
 

Mode osg::Billboard::_mode [protected]
 

Vec3 osg::Billboard::_normal [protected]
 

PositionList osg::Billboard::_positionList [protected]
 

Vec3 osg::Billboard::_side [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:25 2002 for the Open Scene Graph by doxygen 1.2.16.