From c210dd2db92260ab61d4aab1cde6f70fdd24a523 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 23 Jul 2005 19:05:42 +0000 Subject: [PATCH] Added osg::CameraNode to ImpostorSprite in prep for moving across to using camera node in pre rendering of impostors. --- include/osgSim/Impostor | 1 - include/osgSim/ImpostorSprite | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/osgSim/Impostor b/include/osgSim/Impostor index c3094f0c8..052f96c5f 100644 --- a/include/osgSim/Impostor +++ b/include/osgSim/Impostor @@ -112,7 +112,6 @@ class OSGSIM_EXPORT Impostor : public osg::LOD ImpostorSprite* createImpostorSprite(osgUtil::CullVisitor* cv); - float _impostorThreshold; }; diff --git a/include/osgSim/ImpostorSprite b/include/osgSim/ImpostorSprite index 91e97ff87..08185d9f6 100644 --- a/include/osgSim/ImpostorSprite +++ b/include/osgSim/ImpostorSprite @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -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 _camera; // support for a double linked list managed by the // ImposotorSpriteManager.