14 #ifndef OSG_ImpostorSprite
15 #define OSG_ImpostorSprite 1
18 #include <osg/BoundingSphere>
19 #include <osg/Drawable>
20 #include <osg/AlphaFunc>
22 #include <osg/Texture2D>
25 #include <osgSim/Export>
30 class ImpostorSpriteManager;
53 virtual const char*
className()
const {
return "ImpostorSprite"; }
74 inline void setLastFrameUsed(
unsigned int frameNumber) { _lastFrameUsed = frameNumber; }
119 float calcPixelError(
const osg::Matrix& MVPW)
const;
125 int s()
const {
return _s; }
126 int t()
const {
return _t; }
132 virtual bool supports(
const Drawable::AttributeFunctor&)
const {
return true; }
135 virtual void accept(Drawable::AttributeFunctor& af);
138 virtual bool supports(
const Drawable::ConstAttributeFunctor&)
const {
return true; }
141 virtual void accept(Drawable::ConstAttributeFunctor& af)
const;
205 bool empty()
const {
return _first==0; }
215 ImpostorSprite* createOrReuseImpostorSprite(
int s,
int t,
unsigned int frameNumber);
virtual bool isSameKindAs(const osg::Object *obj) const
const osg::Vec2 * getTexCoords() const
void setCamera(osg::Camera *camera)
virtual bool supports(const Drawable::AttributeFunctor &) const
const osg::Vec3 * getControlCoords() const
osg::Texture2D * getTexture()
virtual osg::Object * cloneType() const
const osg::Vec3 & getStoredLocalEyePoint() const
osg::Vec3 _storedLocalEyePoint
osg::Camera * getCamera()
virtual const char * libraryName() const
StateSetList _stateSetList
void setParent(Impostor *parent)
std::vector< osg::ref_ptr< osg::StateSet > > StateSetList
ImpostorSprite * _previous
osg::Texture2D * _texture
unsigned int _reuseStateSetIndex
const Impostor * getParent() const
const osg::Camera * getCamera() const
osg::ref_ptr< osg::AlphaFunc > _alphafunc
const osg::Texture2D * getTexture() const
virtual bool supports(const Drawable::ConstAttributeFunctor &) const
virtual bool supports(const osg::PrimitiveFunctor &) const
void setStoredLocalEyePoint(const osg::Vec3 &v)
osg::Vec2 * getTexCoords()
ImpostorSpriteManager * _ism
unsigned int _lastFrameUsed
unsigned int getLastFrameUsed() const
osg::ref_ptr< osg::Camera > _camera
void setLastFrameUsed(unsigned int frameNumber)
const osg::Vec3 * getCoords() const
virtual osg::Object * clone(const osg::CopyOp &) const
osg::Vec3 * getControlCoords()
osg::ref_ptr< osg::TexEnv > _texenv
virtual const char * className() const