Added osg::CameraNode to ImpostorSprite in prep for moving across to using
camera node in pre rendering of impostors.
This commit is contained in:
parent
06d3d869f3
commit
c210dd2db9
@ -112,7 +112,6 @@ class OSGSIM_EXPORT Impostor : public osg::LOD
|
||||
|
||||
ImpostorSprite* createImpostorSprite(osgUtil::CullVisitor* cv);
|
||||
|
||||
|
||||
float _impostorThreshold;
|
||||
|
||||
};
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user