14#ifndef OSG_ImpostorSprite
15#define OSG_ImpostorSprite 1
29class ImpostorSpriteManager;
52 virtual const char*
className()
const {
return "ImpostorSprite"; }
127 int s()
const {
return _s; }
128 int t()
const {
return _t; }
Vec2f Vec2
Definition Vec2:21
Vec3f Vec3
Definition Vec3:21
Matrixd Matrix
Definition Matrix:27
The osgSim library is a NodeKit that extends the core scene graph to support nodes and drawables that...
Definition BlinkSequence:27
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Encapsulates OpenGL 2D texture functionality.
Definition Texture2D:25
Impostor - is a form of Level Of Detail group node which allows both switching between children depen...
Definition Impostor:65
An ImposterSprite is a textured quad which is rendered in place of 3D geometry.
Definition ImpostorSprite:38
ImpostorSpriteManager * _ism
Definition ImpostorSprite:157
osg::Camera * getCamera()
Get the camera node to use for pre rendering the impostor sprite's texture.
Definition ImpostorSprite:134
const osg::Vec3 * getCoords() const
Get the const coordinates of the corners of the quad.
Definition ImpostorSprite:88
int _t
Definition ImpostorSprite:171
ImpostorSprite * _next
Definition ImpostorSprite:159
osg::Vec3 * getCoords()
Get the coordinates of the corners of the quad.
Definition ImpostorSprite:85
unsigned int _lastFrameUsed
Definition ImpostorSprite:161
Impostor * getParent()
Get the parent, which is an Impostor.
Definition ImpostorSprite:61
const osg::Camera * getCamera() const
Get the const camera node to use for pre rendering the impostor sprite's texture.
Definition ImpostorSprite:137
void setStoredLocalEyePoint(const osg::Vec3 &v)
Set the eye point for when the ImpostorSprite was snapped.
Definition ImpostorSprite:67
virtual bool isSameKindAs(const osg::Object *obj) const
return true if this and obj are of the same kind of object.
Definition ImpostorSprite:50
Impostor * _parent
Definition ImpostorSprite:148
osg::ref_ptr< osg::Camera > _camera
Definition ImpostorSprite:153
osg::Vec3 * getControlCoords()
Get the control coordinates of the corners of the quad.
Definition ImpostorSprite:112
osg::ref_ptr< osg::Vec2Array > _texcoords
Definition ImpostorSprite:166
void setLastFrameUsed(unsigned int frameNumber)
Set the frame number for when the ImpostorSprite was last used in rendering.
Definition ImpostorSprite:73
int _s
Definition ImpostorSprite:170
const osg::Vec3 * getControlCoords() const
Get the const control coordinates of the corners of the quad.
Definition ImpostorSprite:115
ImpostorSprite(const ImpostorSprite &)
virtual ~ImpostorSprite()
const Impostor * getParent() const
Get the const parent, which is an Impostor.
Definition ImpostorSprite:64
osg::Vec2 * getTexCoords()
Get the texture coordinates of the corners of the quad.
Definition ImpostorSprite:95
void setParent(Impostor *parent)
Set the parent, which must be an Impostor.
Definition ImpostorSprite:58
void setTexture(osg::Texture2D *tex, int s, int t)
virtual const char * libraryName() const
return the name of the node's library.
Definition ImpostorSprite:51
const osg::Vec3 & getStoredLocalEyePoint() const
Get the eye point for when the ImpostorSprite was snapped.
Definition ImpostorSprite:70
unsigned int getLastFrameUsed() const
Get the frame number for when the ImpostorSprite was last used in rendering.
Definition ImpostorSprite:76
friend class osgSim::ImpostorSpriteManager
Definition ImpostorSprite:150
virtual osg::Object * cloneType() const
Clone an object of the same type as an ImpostorSprite.
Definition ImpostorSprite:44
ImpostorSprite * _previous
Definition ImpostorSprite:158
const osg::Texture2D * getTexture() const
Definition ImpostorSprite:125
osg::Texture2D * getTexture()
Definition ImpostorSprite:124
osg::ref_ptr< osg::Vec3Array > _coords
Definition ImpostorSprite:165
int t() const
Definition ImpostorSprite:128
osg::Vec3 _storedLocalEyePoint
Definition ImpostorSprite:163
const osg::Vec2 * getTexCoords() const
Get the const texture coordinates of the corners of the quad.
Definition ImpostorSprite:98
void setCamera(osg::Camera *camera)
Set the camera node to use for pre rendering the impostor sprite's texture.
Definition ImpostorSprite:131
virtual const char * className() const
return the name of the node's class type.
Definition ImpostorSprite:52
osg::Vec3 _controlcoords[4]
Definition ImpostorSprite:167
int s() const
Definition ImpostorSprite:127
virtual osg::Object * clone(const osg::CopyOp &) const
Clone on ImpostorSprite just returns a clone of type, since it is not appropriate to share data of an...
Definition ImpostorSprite:49
osg::Texture2D * _texture
Definition ImpostorSprite:169
float calcPixelError(const osg::Matrix &MVPW) const
Calculate the pixel error value for passing in the ModelViewProjectionWindow transform,...
Helper class for managing the reuse of ImpostorSprite resources.
Definition ImpostorSprite:178
ImpostorSprite * first()
Definition ImpostorSprite:185
bool empty() const
Definition ImpostorSprite:183
std::vector< osg::ref_ptr< osg::StateSet > > StateSetList
Definition ImpostorSprite:210
ImpostorSprite * _last
Definition ImpostorSprite:208
osg::StateSet * createOrReuseStateSet()
void push_back(ImpostorSprite *is)
void remove(ImpostorSprite *is)
ImpostorSprite * _first
Definition ImpostorSprite:207
unsigned int _reuseStateSetIndex
Definition ImpostorSprite:212
ImpostorSprite * last()
Definition ImpostorSprite:187
StateSetList _stateSetList
Definition ImpostorSprite:211
osg::ref_ptr< osg::TexEnv > _texenv
Definition ImpostorSprite:204
osg::ref_ptr< osg::AlphaFunc > _alphafunc
Definition ImpostorSprite:205
ImpostorSprite * createOrReuseImpostorSprite(int s, int t, unsigned int frameNumber)
#define NULL
Definition Export:55
#define OSGSIM_EXPORT
Definition Export:38