Added DataVariance enum and set/get fields to osg::Object to help identify

which objects have values that vary over the lifetime of the object (DYNAMIC)
and ones that do not vary (STATIC).  Removed the equivalent code in
osg::Transform, StateSet and StateAttribute, as these are now encompassed
by the new DataVariance field.

Removed MatrixMode enum from Matrix, and associated fields/parameters from
osg::Transfrom and osg::NodeVisitor, since MatrixMode was not providing
any useful functionality, but made the interface more complex (MatrixMode
was an experimental API)

Added ReferenceFrame field to osg::Transform which allows users to specify
transforms that are relative to their parents (the default, and previous behavior)
or absolute reference frame, which can be used for HUD's, camera relative
light sources etc etc.  Note, the view frustum culling for absolute Transform
are disabled, and all their parents up to the root are also automatically
have view frustum culling disabled.  However, once passed an absolute Transform
node culling will return to its default state of on, so you can still cull
underneath an absolute transform, its only the culling above which is disabled.
This commit is contained in:
Robert Osfield
2002-04-11 23:20:23 +00:00
parent e85e5a6ce6
commit 6ed233d0d2
18 changed files with 202 additions and 175 deletions

View File

@@ -17,16 +17,6 @@ namespace osg {
class Quat;
/** The range of matrix modes that the scene graph might utilize.
* Similar in concept to different modes in OpenGL glMatrixMode().*/
enum MatrixMode
{
PROJECTION,
VIEW,
MODEL,
MODELVIEW
};
class SG_EXPORT Matrix : public Object
{
@@ -128,6 +118,7 @@ class SG_EXPORT Matrix : public Object
inline static Matrix rotate( float, float, float, float );
inline static Matrix rotate( float angle, const Vec3& axis);
inline static Matrix rotate( const Quat&);
inline static Matrix inverse( const Matrix&);
/** Create a orthographic projection. See glOrtho for further details.*/
inline static Matrix ortho(const double left, const double right,
@@ -276,6 +267,13 @@ inline Matrix Matrix::rotate(const Vec3& from, const Vec3& to )
return m;
}
inline Matrix inverse( const Matrix& matrix)
{
Matrix m;
m.invert(matrix);
return m;
}
inline Matrix Matrix::ortho(const double left, const double right,
const double bottom, const double top,
const double zNear, const double zFar)