Added new Transform::ReferenceType enum ABSOLUTE_RF_INHERIT_VIEWPOINT to support

internal RTT cameras that wish to use the main cameras view/eye point for LOD and other
distance based tests.
This commit is contained in:
Robert Osfield
2007-02-07 16:32:14 +00:00
parent c2e79a2d89
commit c52207b637
11 changed files with 104 additions and 64 deletions

View File

@@ -18,6 +18,7 @@
#include <osg/CullSettings>
#include <osg/Viewport>
#include <osg/fast_back_stack>
#include <osg/Transform>
namespace osg {
@@ -47,7 +48,7 @@ class OSG_EXPORT CullStack : public osg::CullSettings
void pushProjectionMatrix(osg::RefMatrix* matrix);
void popProjectionMatrix();
void pushModelViewMatrix(osg::RefMatrix* matrix);
void pushModelViewMatrix(osg::RefMatrix* matrix, Transform::ReferenceFrame referenceFrame);
void popModelViewMatrix();
inline float getFrustumVolume() { if (_frustumVolume<0.0f) computeFrustumVolume(); return _frustumVolume; }

View File

@@ -90,7 +90,8 @@ class OSG_EXPORT Transform : public Group
enum ReferenceFrame
{
RELATIVE_RF,
ABSOLUTE_RF
ABSOLUTE_RF,
ABSOLUTE_RF_INHERIT_VIEWPOINT
};
/** Set the transform's ReferenceFrame, either to be relative to its
@@ -104,6 +105,12 @@ class OSG_EXPORT Transform : public Group
* deep in the scene graph. It is therefore recommended to only use
* absolute Transforms at the top of the scene, for such things as
* heads up displays.
* ABSOLUTE_RF_INHERIT_VIEWPOINT is the same as ABSOLUTE_RF except it
* adds the ability to use the parents view points position in world coordinates
* as its local viewpoint in the new coordinates frame. This is useful for
* Render to texture Cameras that wish to use the main views LOD range computation
* (which uses the viewpoint rather than the eye point) rather than use the local
* eye point defined by the this Transforms' abosolute view matrix.
*/
void setReferenceFrame(ReferenceFrame rf);