Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::ImpostorSprite Class Reference

Inheritance diagram for osg::ImpostorSprite:

osg::Drawable osg::Object osg::Referenced List of all members.

Public Member Functions

 ImpostorSprite ()
virtual ObjectcloneType () const
virtual Objectclone (const CopyOp &) const
virtual bool isSameKindAs (const Object *obj) const
virtual const char * libraryName () const
virtual const char * className () const
void setParent (Impostor *parent)
ImpostorgetParent ()
const ImpostorgetParent () const
void setStoredLocalEyePoint (const Vec3 &v)
const Vec3getStoredLocalEyePoint () const
void setLastFrameUsed (int frameNumber)
int getLastFrameUsed () const
Vec3getCoords ()
const Vec3getCoords () const
Vec2getTexCoords ()
const Vec2getTexCoords () const
Vec3getControlCoords ()
const Vec3getControlCoords () const
float calcPixelError (const Matrix &MVPW) const
void setTexture (Texture2D *tex, int s, int t)
Texture2DgetTexture ()
const Texture2DgetTexture () const
int s () const
int t () const
virtual void drawImplementation (State &state) const
virtual bool supports (AttributeFunctor &) const
virtual void accept (AttributeFunctor &af)
virtual bool supports (ConstAttributeFunctor &) const
virtual void accept (ConstAttributeFunctor &af) const
virtual bool supports (PrimitiveFunctor &) const
virtual void accept (PrimitiveFunctor &pf) const

Public Attributes

Vec4 _color

Protected Member Functions

 ImpostorSprite (const ImpostorSprite &)
ImpostorSpriteoperator= (const ImpostorSprite &)
virtual ~ImpostorSprite ()
virtual bool computeBound () const

Protected Attributes

Impostor_parent
ImpostorSpriteManager_ism
ImpostorSprite_previous
ImpostorSprite_next
int _lastFrameUsed
Vec3 _storedLocalEyePoint
Vec3 _coords [4]
Vec2 _texcoords [4]
Vec3 _controlcoords [4]
Texture2D_texture
int _s
int _t

Friends

class osg::ImpostorSpriteManager

Detailed Description

An ImposterSprite is a textured quad which is rendered in place of 3D geometry. The ImposterSprite is generated by rendering the original 3D geometry to a texture as an image cache. The ImpostorSprite is automatically generated by the osgUtil::CullVisitor so it not necessary to deal with it directly.


Constructor & Destructor Documentation

osg::ImpostorSprite::ImpostorSprite  ) 
 

osg::ImpostorSprite::ImpostorSprite const ImpostorSprite  )  [inline, protected]
 

virtual osg::ImpostorSprite::~ImpostorSprite  )  [protected, virtual]
 


Member Function Documentation

virtual void osg::ImpostorSprite::accept PrimitiveFunctor &  pf  )  const [virtual]
 

Accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has.

virtual void osg::ImpostorSprite::accept ConstAttributeFunctor &  af  )  const [virtual]
 

Accept a ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.

virtual void osg::ImpostorSprite::accept AttributeFunctor &  af  )  [virtual]
 

Accept an AttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.

float osg::ImpostorSprite::calcPixelError const Matrix MVPW  )  const
 

Calculate the pixel error value for passing in the ModelViewProjectionWindow transform, which transform local coords into screen space.

virtual const char* osg::ImpostorSprite::className  )  const [inline, virtual]
 

return the name of the object's class type. Must be defined by derived classes.

Reimplemented from osg::Drawable.

virtual Object* osg::ImpostorSprite::clone const CopyOp  )  const [inline, virtual]
 

Clone on ImpostorSprite just returns a clone of type, since it is not appropriate to share data of an ImpostorSprite.

Implements osg::Object.

virtual Object* osg::ImpostorSprite::cloneType  )  const [inline, virtual]
 

Clone an object of the same type as an ImpostorSprite.

Implements osg::Object.

virtual bool osg::ImpostorSprite::computeBound  )  const [protected, virtual]
 

compute the bounding box of the drawable. Method must be implemented by subclasses.

Reimplemented from osg::Drawable.

virtual void osg::ImpostorSprite::drawImplementation State state  )  const [virtual]
 

Draw ImpostorSprite directly.

Implements osg::Drawable.

const Vec3* osg::ImpostorSprite::getControlCoords  )  const [inline]
 

Get the const control coordinates of the corners of the quad.

Vec3* osg::ImpostorSprite::getControlCoords  )  [inline]
 

Get the control coordinates of the corners of the quad. The control coordinates are the corners of the quad projected out onto the front face of bounding box which enclosed the impostor geometry when it was pre-rendered into the impostor sprite's texture. At the point of creation/or update of the impostor sprite the control coords will lie on top of the corners of the quad in screen space - with a pixel error of zero. Once the camera moves relative to the impostor sprite the control coords will no longer lie on top of the corners of the quad in screen space - a pixel error will have accumulated. This pixel error can then be used to determine whether the impostor needs to be updated. Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left.

const Vec3* osg::ImpostorSprite::getCoords  )  const [inline]
 

Get the const coordinates of the corners of the quad.

Vec3* osg::ImpostorSprite::getCoords  )  [inline]
 

Get the coordinates of the corners of the quad. Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left.

int osg::ImpostorSprite::getLastFrameUsed  )  const [inline]
 

Get the frame number for when the ImpostorSprite was last used in rendering.

const Impostor* osg::ImpostorSprite::getParent  )  const [inline]
 

Get the const parent, which is an Impostor.

Impostor* osg::ImpostorSprite::getParent  )  [inline]
 

Get the parent, which is an Impostor.

const Vec3& osg::ImpostorSprite::getStoredLocalEyePoint  )  const [inline]
 

Get the eye point for when the ImpostorSprite was snapped.

const Vec2* osg::ImpostorSprite::getTexCoords  )  const [inline]
 

Get the const texture coordinates of the corners of the quad.

Vec2* osg::ImpostorSprite::getTexCoords  )  [inline]
 

Get the texture coordinates of the corners of the quad. Stored in the order, [0] - top_left, [1] - bottom_left, [2] - bottom_right, [3] - top_left.

const Texture2D* osg::ImpostorSprite::getTexture  )  const [inline]
 

Texture2D* osg::ImpostorSprite::getTexture  )  [inline]
 

virtual bool osg::ImpostorSprite::isSameKindAs const Object obj  )  const [inline, virtual]
 

Reimplemented from osg::Drawable.

virtual const char* osg::ImpostorSprite::libraryName  )  const [inline, virtual]
 

return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Reimplemented from osg::Drawable.

ImpostorSprite& osg::ImpostorSprite::operator= const ImpostorSprite  )  [inline, protected]
 

int osg::ImpostorSprite::s  )  const [inline]
 

void osg::ImpostorSprite::setLastFrameUsed int  frameNumber  )  [inline]
 

Set the frame number for when the ImpostorSprite was last used in rendering.

void osg::ImpostorSprite::setParent Impostor parent  )  [inline]
 

Set the parent, which must be an Impostor. Unlike conventional Drawables, ImpostorSprites can only ever have one parent.

void osg::ImpostorSprite::setStoredLocalEyePoint const Vec3 v  )  [inline]
 

Set the eye point for when the ImpostorSprite was snapped.

void osg::ImpostorSprite::setTexture Texture2D tex,
int  s,
int  t
 

virtual bool osg::ImpostorSprite::supports PrimitiveFunctor &   )  const [inline, virtual]
 

Return true, osg::ImpostorSprite does support accept(PrimitiveFunctor&).

virtual bool osg::ImpostorSprite::supports ConstAttributeFunctor &   )  const [inline, virtual]
 

Return true, osg::ImpostorSprite does support accept(ConstAttributeFunctor&).

virtual bool osg::ImpostorSprite::supports AttributeFunctor &   )  const [inline, virtual]
 

Return true, osg::ImpostorSprite does support accept(AttributeFunctor&).

int osg::ImpostorSprite::t  )  const [inline]
 


Friends And Related Function Documentation

friend class osg::ImpostorSpriteManager [friend]
 


Member Data Documentation

Vec4 osg::ImpostorSprite::_color
 

Vec3 osg::ImpostorSprite::_controlcoords[4] [protected]
 

Vec3 osg::ImpostorSprite::_coords[4] [protected]
 

ImpostorSpriteManager* osg::ImpostorSprite::_ism [protected]
 

int osg::ImpostorSprite::_lastFrameUsed [protected]
 

ImpostorSprite* osg::ImpostorSprite::_next [protected]
 

Impostor* osg::ImpostorSprite::_parent [protected]
 

ImpostorSprite* osg::ImpostorSprite::_previous [protected]
 

int osg::ImpostorSprite::_s [protected]
 

Vec3 osg::ImpostorSprite::_storedLocalEyePoint [protected]
 

int osg::ImpostorSprite::_t [protected]
 

Vec2 osg::ImpostorSprite::_texcoords[4] [protected]
 

Texture2D* osg::ImpostorSprite::_texture [protected]
 


The documentation for this class was generated from the following file:
Generated on Wed Sep 7 11:10:02 2005 for openscenegraph by  doxygen 1.4.4