Added osg::CameraNode to ImpostorSprite in prep for moving across to using

camera node in pre rendering of impostors.
This commit is contained in:
Robert Osfield 2005-07-23 19:05:42 +00:00
parent 06d3d869f3
commit c210dd2db9
2 changed files with 13 additions and 1 deletions

View File

@ -112,7 +112,6 @@ class OSGSIM_EXPORT Impostor : public osg::LOD
ImpostorSprite* createImpostorSprite(osgUtil::CullVisitor* cv);
float _impostorThreshold;
};

View File

@ -20,6 +20,7 @@
#include <osg/AlphaFunc>
#include <osg/TexEnv>
#include <osg/Texture2D>
#include <osg/CameraNode>
#include <osgSim/Export>
@ -149,6 +150,15 @@ class OSGSIM_EXPORT ImpostorSprite : public osg::Drawable
osg::Vec4 _color;
virtual osg::BoundingBox computeBound() const;
/** Set the camera node to use for pre rendering the impostor sprite's texture.*/
void setCameraNode(osg::CameraNode* camera) { _camera = camera; }
/** Get the camera node to use for pre rendering the impostor sprite's texture.*/
osg::CameraNode* getCameraNode() { return _camera.get(); }
/** Get the const camera node to use for pre rendering the impostor sprite's texture.*/
const osg::CameraNode* getCameraNode() const { return _camera.get(); }
protected:
@ -160,6 +170,9 @@ class OSGSIM_EXPORT ImpostorSprite : public osg::Drawable
Impostor* _parent;
friend class osgSim::ImpostorSpriteManager;
// camera node for doing the pre rendering.
osg::ref_ptr<osg::CameraNode> _camera;
// support for a double linked list managed by the
// ImposotorSpriteManager.