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* 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(const 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]const 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(Texture* tex, int s, int t)
[more]Texture* getTexture()
[more]const Texture* getTexture() const
[more]const int s() const
[more]const int t() const
[more]virtual void drawImmediateMode(State& state)
draw ImpostorSprite directly.
[more]bool getStats(Statistics &stat)

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]Texture* _texture
[more]int _s
[more]int _t

Protected Methods

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


Inherited from Drawable:

Public Methods

oinline const ParentList& getParents() const
oinline ParentList getParents()
oinline const unsigned int getNumParents() const
oinline void setStateSet(StateSet* state)
oinline StateSet* getStateSet()
oinline const StateSet* getStateSet() const
ovoid setSupportsDisplayList(const bool flag)
oinline const bool getSupportsDisplayList() const
ovoid setUseDisplayList(const bool flag)
oinline const bool getUseDisplayList() const
ovoid dirtyDisplayList()
ovoid dirtyBound()
oinline const BoundingBox& getBound() const
ovoid compile(State& state)
ovoid setDrawCallback(DrawCallback* dc)
oDrawCallback* getDrawCallback()
oconst DrawCallback* getDrawCallback() const
ovoid setCullCallback(CullCallback* cc)
oCullCallback* getCullCallback()
oconst CullCallback* getCullCallback() const
ostatic void deleteDisplayList(uint contextID, uint globj)
ostatic void flushDeletedDisplayLists(uint contextID)
ovirtual AttributeBitMask suppportsAttributeOperation() const
ovirtual AttributeBitMask applyAttributeOperation(AttributeFunctor&)
oinline void draw(State& state)

Public Members

otypedef std::vector<Node*> ParentList
ostruct DrawCallback: public osg::Referenced
ostruct CullCallback: public osg::Referenced
otypedef uint AttributeBitMaskenum AttributeBitMaskValues
class AttributeFunctor

Protected Fields

oParentList _parents
oref_ptr<StateSet> _dstate
obool _supportsDisplayList
obool _useDisplayList
omutable BoundingBox _bbox
omutable bool _bbox_computed
oref_ptr<DrawCallback> _drawCallback
oref_ptr<CullCallback> _cullCallback

Protected Methods

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

Protected Members

otypedef std::vector<uint> GLObjectList mutable GLObjectList _globjList
otypedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache


Inherited from Object:

Public Methods

oinline void setDataVariance(const DataVariance dv)
oinline const DataVariance getDataVariance() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline const int referenceCount() const

Protected Fields

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* 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(const 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

oconst float 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(Texture* tex, int s, int t)

oTexture* getTexture()

oconst Texture* getTexture() const

oconst int s() const

oconst int t() const

ovirtual void drawImmediateMode(State& state)
draw ImpostorSprite directly.

obool getStats(Statistics &stat)

o ImpostorSprite(const ImpostorSprite&)

oImpostorSprite& operator = (const ImpostorSprite&)

ovirtual ~ImpostorSprite()

ovirtual const bool computeBound() const

oImpostor* _parent

oImpostorSpriteManager* _ism

oImpostorSprite* _previous

oImpostorSprite* _next

oint _lastFrameUsed

oVec3 _storedLocalEyePoint

oVec3 _coords[4]

oVec2 _texcoords[4]

oVec3 _controlcoords[4]

oTexture* _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++.