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* clone() const
[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 Camera& camera, const Viewport& viewport, const osg::Matrix* matrix) const
calculate the pixel error value for current camera position and object position
[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.

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 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()
oinline void dirtyBound()
oinline const BoundingBox& getBound() const
oinline void draw(State& state)
ovoid compile(State& state)
ostatic void deleteDisplayList(uint contextID, uint globj)
ostatic void flushDeletedDisplayLists(uint contextID)

Protected Fields

oref_ptr<StateSet> _dstate
obool _supportsDisplayList
obool _useDisplayList
omutable BoundingBox _bbox
omutable bool _bbox_computed

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:


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() 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 automatiacally generatated by the osgUtil::CullVisitor so it not necessary to deal with it directly.
o ImpostorSprite()

ovirtual Object* clone() const

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 cornders 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 ontop of the coorners 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 nolonger lie ontop of the corners of the quad in screen space - a pixel error will have accumulated. This pixel error can then be used to dertermine 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 Camera& camera, const Viewport& viewport, const osg::Matrix* matrix) const
calculate the pixel error value for current camera position and object position

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.

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:
ImpostorSpriteManager

Alphabetic index HTML hierarchy of classes or Java



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