class SG_EXPORT osg::ImpostorSprite

An ImposterSprite is a textured quad which is rendered in place a 3D geometry.

Inheritance:


Public Fields

[more]Vec4 _color

Public Methods

[more] ImpostorSprite()
[more]virtual Object* cloneType() const
Clone an object of the same type as an ImpostorSprite
[more]virtual Object* clone(const CopyOp&) const
Clone on ImpostorSprite just returns a clone of type, since it is not appropriate to share data of an ImpostorSprite
[more]virtual bool isSameKindAs(const Object* obj) const
[more]virtual const char* libraryName() const
[more]virtual const char* className() const
[more]void setParent(Impostor* parent)
Set the parent, which must be an Impostor.
[more]Impostor* getParent()
Get the parent, which is an Impostor.
[more]const Impostor* getParent() const
Get the const parent, which is an Impostor.
[more]inline void setStoredLocalEyePoint(const Vec3& v)
Set the eye point for when the ImpsotorSprite was snapped
[more]inline const Vec3& getStoredLocalEyePoint() const
Get the eye point for when the ImpsotorSprite was snapped
[more]inline void setLastFrameUsed(int frameNumber)
Set the frame number for when the ImpostorSprite was last used in rendering
[more]inline int getLastFrameUsed() const
Get the frame number for when the ImpostorSprite was last used in rendering
[more]inline Vec3* getCoords()
Get the coordinates of the corners of the quad.
[more]inline const Vec3* getCoords() const
Get the const coordinates of the corners of the quad
[more]inline Vec2* getTexCoords()
Get the texture coordinates of the corners of the quad.
[more]inline const Vec2* getTexCoords() const
Get the const texture coordinates of the corners of the quad
[more]inline Vec3* getControlCoords()
Get the control coordinates of the corners of the quad.
[more]inline const Vec3* getControlCoords() const
Get the const control coordinates of the corners of the quad
[more]float calcPixelError(const Matrix& MVPW) const
calculate the pixel error value for passing in the ModelViewProjectionWindow transform, which transform local coords into screen space
[more]void setTexture(Texture2D* tex, int s, int t)
[more]Texture2D* getTexture()
[more]const Texture2D* getTexture() const
[more]int s() const
[more]int t() const
[more]virtual void drawImplementation(State& state) const
draw ImpostorSprite directly.
[more]virtual bool supports(AttributeFunctor&) const
return true, osg::ImpostorSprite does support accept(AttributeFunctor&)
[more]virtual void accept(AttributeFunctor& af)
accept an AttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has
[more]virtual bool supports(ConstAttributeFunctor&) const
return true, osg::ImpostorSprite does support accept(ConstAttributeFunctor&)
[more]virtual void accept(ConstAttributeFunctor& af) const
accept an ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has
[more]virtual bool supports(PrimitiveFunctor&) const
return true, osg::ImpostorSprite does support accept(PrimitiveFunctor&)
[more]virtual void accept(PrimitiveFunctor& pf) const
accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has

Protected Fields

[more]Impostor* _parent
[more]ImpostorSpriteManager* _ism
[more]ImpostorSprite* _previous
[more]ImpostorSprite* _next
[more]int _lastFrameUsed
[more]Vec3 _storedLocalEyePoint
[more]Vec3 _coords[4]
[more]Vec2 _texcoords[4]
[more]Vec3 _controlcoords[4]
[more]Texture2D* _texture
[more]int _s
[more]int _t

Protected Methods

[more] ImpostorSprite(const ImpostorSprite&)
[more]ImpostorSprite& operator = (const ImpostorSprite&)
[more]virtual ~ImpostorSprite()
[more]virtual bool computeBound() const


Inherited from Drawable:

Public Classes

ostruct UpdateCallback: public virtual osg::Object
ostruct CullCallback: public virtual osg::Object
ostruct DrawCallback: public virtual osg::Object
oenum AttributeTypes
class AttributeFunctor
class ConstAttributeFunctor
class PrimitiveFunctor
class PrimitiveIndexFunctor
class SG_EXPORT Extensions: public osg::Referenced
Extensions class which encapsulates the querring of extensions and associated function pointers, and provide convinience wrappers to check for the extensions or use the associated functions

Public Methods

ovirtual Geometry* asGeometry()
ovirtual const Geometry* asGeometry() const
oinline const ParentList& getParents() const
oinline ParentList getParents()
oinline unsigned int getNumParents() const
oinline void setStateSet(StateSet* state)
oinline StateSet* getStateSet()
oinline const StateSet* getStateSet() const
oStateSet* getOrCreateStateSet()
ovoid dirtyBound()
oinline const BoundingBox& getBound() const
oinline void setShape(Shape* shape)
oinline Shape* getShape()
oinline const Shape* getShape() const
ovoid setSupportsDisplayList(bool flag)
oinline bool getSupportsDisplayList() const
ovoid setUseDisplayList(bool flag)
oinline bool getUseDisplayList() const
ovoid setUseVertexBufferObjects(bool flag)
oinline bool getUseVertexBufferObjects() const
ovoid dirtyDisplayList()
ovirtual void compileGLObjects(State& state) const
ovirtual void releaseGLObjects(State* state=0) const
ovoid setUpdateCallback(UpdateCallback* ac)
oUpdateCallback* getUpdateCallback()
oconst UpdateCallback* getUpdateCallback() const
ovoid setCullCallback(CullCallback* cc)
oCullCallback* getCullCallback()
oconst CullCallback* getCullCallback() const
ovoid setDrawCallback(DrawCallback* dc)
oDrawCallback* getDrawCallback()
oconst DrawCallback* getDrawCallback() const
ostatic void deleteDisplayList(unsigned int contextID, GLuint globj)
ostatic void flushDeletedDisplayLists(unsigned int contextID, double currentTime, double& availableTime)
ostatic void deleteVertexBufferObject(unsigned int contextID, GLuint globj)
ostatic void flushDeletedVertexBufferObjects(unsigned int contextID, double currentTime, double& availableTime)
ostatic Extensions* getExtensions(unsigned int contextID, bool createIfNotInitalized)
ostatic void setExtensions(unsigned int contextID, Extensions* extensions)
oinline void draw(State& state) const

Public

otypedef std::vector<Node*> ParentList
otypedef unsigned int AttributeType

Protected Fields

oParentList _parents
oref_ptr<StateSet> _stateset
omutable BoundingBox _bbox
omutable bool _bbox_computed
oref_ptr<Shape> _shape
obool _supportsDisplayList
obool _useDisplayList
obool _supportsVertexBufferObjects
obool _useVertexBufferObjects
omutable GLObjectList _globjList
omutable GLObjectList _vboList
oref_ptr<UpdateCallback> _updateCallback
oref_ptr<CullCallback> _cullCallback
oref_ptr<DrawCallback> _drawCallback

Protected Methods

ovoid setBound(const BoundingBox& bb) const
ovoid addParent(osg::Node* node)
ovoid removeParent(osg::Node* node)

Protected

otypedef osg::buffered_value<GLuint> GLObjectList


Inherited from Object:

Public Classes

oenum DataVariance

Public Methods

oinline void setDataVariance(DataVariance dv)
oinline DataVariance getDataVariance() const
oinline void setUserData(Referenced* obj)
oinline Referenced* getUserData()
oinline const Referenced* getUserData() const

Protected Fields

oDataVariance _dataVariance
oref_ptr<Referenced> _userData


Inherited from Referenced:

Public Methods

ostatic void setDeleteHandler(DeleteHandler* handler)
ostatic DeleteHandler* getDeleteHandler()
oinline void ref() const
oinline void unref_nodelete() const
oinline int referenceCount() const
oinline void unref() const

Protected Fields

omutable OpenThreads::Mutex _refMutex
omutable int _refCount


Documentation

An ImposterSprite is a textured quad which is rendered in place a 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.
o ImpostorSprite()

ovirtual Object* cloneType() const
Clone an object of the same type as an ImpostorSprite

ovirtual Object* clone(const CopyOp&) const
Clone on ImpostorSprite just returns a clone of type, since it is not appropriate to share data of an ImpostorSprite

ovirtual bool isSameKindAs(const Object* obj) const

ovirtual const char* libraryName() const

ovirtual const char* className() const

ovoid setParent(Impostor* parent)
Set the parent, which must be an Impostor. Unlike conventional Drawables, ImpostorSprite's can only ever have one parent.

oImpostor* getParent()
Get the parent, which is an Impostor.

oconst Impostor* getParent() const
Get the const parent, which is an Impostor.

oinline void setStoredLocalEyePoint(const Vec3& v)
Set the eye point for when the ImpsotorSprite was snapped

oinline const Vec3& getStoredLocalEyePoint() const
Get the eye point for when the ImpsotorSprite was snapped

oinline void setLastFrameUsed(int frameNumber)
Set the frame number for when the ImpostorSprite was last used in rendering

oinline int getLastFrameUsed() const
Get the frame number for when the ImpostorSprite was last used in rendering

oinline Vec3* getCoords()
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.

oinline const Vec3* getCoords() const
Get the const coordinates of the corners of the quad

oinline Vec2* getTexCoords()
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.

oinline const Vec2* getTexCoords() const
Get the const texture coordinates of the corners of the quad

oinline Vec3* getControlCoords()
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 or 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.

oinline const Vec3* getControlCoords() const
Get the const control coordinates of the corners of the quad

ofloat calcPixelError(const Matrix& MVPW) const
calculate the pixel error value for passing in the ModelViewProjectionWindow transform, which transform local coords into screen space

ovoid setTexture(Texture2D* tex, int s, int t)

oTexture2D* getTexture()

oconst Texture2D* getTexture() const

oint s() const

oint t() const

ovirtual void drawImplementation(State& state) const
draw ImpostorSprite directly.

ovirtual bool supports(AttributeFunctor&) const
return true, osg::ImpostorSprite does support accept(AttributeFunctor&)

ovirtual void accept(AttributeFunctor& af)
accept an AttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has

ovirtual bool supports(ConstAttributeFunctor&) const
return true, osg::ImpostorSprite does support accept(ConstAttributeFunctor&)

ovirtual void accept(ConstAttributeFunctor& af) const
accept an ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has

ovirtual bool supports(PrimitiveFunctor&) const
return true, osg::ImpostorSprite does support accept(PrimitiveFunctor&)

ovirtual void accept(PrimitiveFunctor& pf) const
accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has

oVec4 _color

o ImpostorSprite(const ImpostorSprite&)

oImpostorSprite& operator = (const ImpostorSprite&)

ovirtual ~ImpostorSprite()

ovirtual bool computeBound() const

oImpostor* _parent

oImpostorSpriteManager* _ism

oImpostorSprite* _previous

oImpostorSprite* _next

oint _lastFrameUsed

oVec3 _storedLocalEyePoint

oVec3 _coords[4]

oVec2 _texcoords[4]

oVec3 _controlcoords[4]

oTexture2D* _texture

oint _s

oint _t


This class has no child classes.
Friends:
class osg::ImpostorSpriteManager

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.