class SG_EXPORT osg::ImpostorSprite

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

Inheritance:


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 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 dirtyDisplayList()
ovoid compile(State& state)
ovoid setAppCallback(AppCallback* ac)
oAppCallback* getAppCallback()
oconst AppCallback* getAppCallback() const
ovoid setCullCallback(CullCallback* cc)
oCullCallback* getCullCallback()
oconst CullCallback* getCullCallback() const
ovoid setDrawCallback(DrawCallback* dc)
oDrawCallback* getDrawCallback()
oconst DrawCallback* getDrawCallback() const
ostatic void deleteDisplayList(uint contextID, uint globj)
ostatic void flushDeletedDisplayLists(uint contextID)
oinline void draw(State& state)

Public Members

otypedef std::vector<Node*> ParentList
ostruct AppCallback: public osg::Referenced
ostruct CullCallback: public osg::Referenced
ostruct DrawCallback: public osg::Referenced
oenum AttributeType
class AttributeFunctor
class ConstAttributeFunctor
class PrimitiveFunctor

Protected Fields

oParentList _parents
oref_ptr<StateSet> _stateset
omutable BoundingBox _bbox
omutable bool _bbox_computed
oref_ptr<Shape> _shape
obool _supportsDisplayList
obool _useDisplayList
omutable GLObjectList _globjList
oref_ptr<AppCallback> _appCallback
oref_ptr<DrawCallback> _drawCallback
oref_ptr<CullCallback> _cullCallback
ostatic DeletedDisplayListCache s_deletedDisplayListCache

Protected Methods

ovoid addParent(osg::Node* node)
ovoid removeParent(osg::Node* node)

Protected Members

otypedef std::vector<uint> GLObjectList
otypedef std::map<uint,std::set<uint> > DeletedDisplayListCache


Inherited from Object:

Public Methods

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

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance
oref_ptr<Referenced> _userData


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline int referenceCount() const
oinline static int createdCount()
oinline static int deletedCount()

Protected Fields

omutable int _refCount
ostatic int _createdCount
ostatic int _deletedCount


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

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++.