Added new Matrixf and Matrixd implementations.
Made Matrix be a typedef to either Matrixf or Matrixd. Defaults to Matrixf. Converted the osgGA::MatrixManipulators and osgProducer::Viewer/OsgCameraGroup across to using exclusively Matrixd for internal computations and passing betwen Manipulators, Producer and SceneView. Note, SceneView still uses Matrix internally so will depend on what is set as the default in include/osg/Matrix. Added the ability to osgProducer::setDone/getDone(), kept done() as the method that the viewer main loop uses for detecting the exit condition.
This commit is contained in:
@@ -42,16 +42,16 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
|
||||
virtual const char* className() const { return "AnimationPath"; }
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByMatrix(const osg::Matrix& matrix) { _matrix = matrix; }
|
||||
virtual void setByMatrix(const osg::Matrixd& matrix) { _matrix = matrix; }
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByInverseMatrix(const osg::Matrix& matrix) { _matrix.invert(matrix); }
|
||||
virtual void setByInverseMatrix(const osg::Matrixd& matrix) { _matrix.invert(matrix); }
|
||||
|
||||
/** get the position of the manipulator as 4x4 Matrix.*/
|
||||
virtual osg::Matrix getMatrix() const { return _matrix; }
|
||||
virtual osg::Matrixd getMatrix() const { return _matrix; }
|
||||
|
||||
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
||||
virtual osg::Matrix getInverseMatrix() const { return osg::Matrix::inverse(_matrix); }
|
||||
virtual osg::Matrixd getInverseMatrix() const { return osg::Matrixd::inverse(_matrix); }
|
||||
|
||||
|
||||
void setAnimationPath( osg::AnimationPath* animationPath ) { _animationPath=animationPath; }
|
||||
@@ -88,7 +88,7 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
|
||||
double _animStartOfTimedPeriod;
|
||||
int _numOfFramesSinceStartOfTimedPeriod;
|
||||
|
||||
osg::Matrix _matrix;
|
||||
osg::Matrixd _matrix;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -35,16 +35,16 @@ class OSGGA_EXPORT DriveManipulator : public MatrixManipulator
|
||||
virtual const char* className() const { return "Drive"; }
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByMatrix(const osg::Matrix& matrix);
|
||||
virtual void setByMatrix(const osg::Matrixd& matrix);
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByInverseMatrix(const osg::Matrix& matrix) { setByMatrix(osg::Matrix::inverse(matrix)); }
|
||||
virtual void setByInverseMatrix(const osg::Matrixd& matrix) { setByMatrix(osg::Matrixd::inverse(matrix)); }
|
||||
|
||||
/** get the position of the manipulator as 4x4 Matrix.*/
|
||||
virtual osg::Matrix getMatrix() const;
|
||||
virtual osg::Matrixd getMatrix() const;
|
||||
|
||||
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
||||
virtual osg::Matrix getInverseMatrix() const;
|
||||
virtual osg::Matrixd getInverseMatrix() const;
|
||||
|
||||
virtual void setNode(osg::Node*);
|
||||
|
||||
|
||||
@@ -35,16 +35,16 @@ class OSGGA_EXPORT FlightManipulator : public MatrixManipulator
|
||||
virtual const char* className() const { return "Flight"; }
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByMatrix(const osg::Matrix& matrix);
|
||||
virtual void setByMatrix(const osg::Matrixd& matrix);
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByInverseMatrix(const osg::Matrix& matrix) { setByMatrix(osg::Matrix::inverse(matrix)); }
|
||||
virtual void setByInverseMatrix(const osg::Matrixd& matrix) { setByMatrix(osg::Matrixd::inverse(matrix)); }
|
||||
|
||||
/** get the position of the manipulator as 4x4 Matrix.*/
|
||||
virtual osg::Matrix getMatrix() const;
|
||||
virtual osg::Matrixd getMatrix() const;
|
||||
|
||||
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
||||
virtual osg::Matrix getInverseMatrix() const;
|
||||
virtual osg::Matrixd getInverseMatrix() const;
|
||||
|
||||
|
||||
virtual void setNode(osg::Node*);
|
||||
|
||||
@@ -66,16 +66,16 @@ public:
|
||||
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByMatrix(const osg::Matrix& matrix) { _current->setByMatrix(matrix); }
|
||||
virtual void setByMatrix(const osg::Matrixd& matrix) { _current->setByMatrix(matrix); }
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByInverseMatrix(const osg::Matrix& matrix) { _current->setByInverseMatrix(matrix); }
|
||||
virtual void setByInverseMatrix(const osg::Matrixd& matrix) { _current->setByInverseMatrix(matrix); }
|
||||
|
||||
/** get the position of the manipulator as 4x4 Matrix.*/
|
||||
virtual osg::Matrix getMatrix() const { return _current->getMatrix(); }
|
||||
virtual osg::Matrixd getMatrix() const { return _current->getMatrix(); }
|
||||
|
||||
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
||||
virtual osg::Matrix getInverseMatrix() const { return _current->getInverseMatrix(); }
|
||||
virtual osg::Matrixd getInverseMatrix() const { return _current->getInverseMatrix(); }
|
||||
|
||||
/** Get the FusionDistanceMode. Used by SceneView for setting up setereo convergence.*/
|
||||
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const { return _current->getFusionDistanceMode(); }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#define OSGGA_MatrixManipulator 1
|
||||
|
||||
#include <osg/Node>
|
||||
#include <osg/Matrix>
|
||||
#include <osg/Matrixd>
|
||||
|
||||
#include <osgUtil/SceneView>
|
||||
|
||||
@@ -41,16 +41,16 @@ public:
|
||||
virtual const char* className() const { return "MatrixManipulator"; }
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByMatrix(const osg::Matrix& matrix) = 0;
|
||||
virtual void setByMatrix(const osg::Matrixd& matrix) = 0;
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByInverseMatrix(const osg::Matrix& matrix) = 0;
|
||||
virtual void setByInverseMatrix(const osg::Matrixd& matrix) = 0;
|
||||
|
||||
/** get the position of the manipulator as 4x4 Matrix.*/
|
||||
virtual osg::Matrix getMatrix() const = 0;
|
||||
virtual osg::Matrixd getMatrix() const = 0;
|
||||
|
||||
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
||||
virtual osg::Matrix getInverseMatrix() const = 0;
|
||||
virtual osg::Matrixd getInverseMatrix() const = 0;
|
||||
|
||||
/** Get the FusionDistanceMode. Used by SceneView for setting up setereo convergence.*/
|
||||
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const { return osgUtil::SceneView::PROPORTIONAL_TO_SCREEN_DISTANCE; }
|
||||
|
||||
@@ -28,16 +28,16 @@ class OSGGA_EXPORT TrackballManipulator : public MatrixManipulator
|
||||
virtual const char* className() const { return "Trackball"; }
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByMatrix(const osg::Matrix& matrix);
|
||||
virtual void setByMatrix(const osg::Matrixd& matrix);
|
||||
|
||||
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
|
||||
virtual void setByInverseMatrix(const osg::Matrix& matrix) { setByMatrix(osg::Matrix::inverse(matrix)); }
|
||||
virtual void setByInverseMatrix(const osg::Matrixd& matrix) { setByMatrix(osg::Matrixd::inverse(matrix)); }
|
||||
|
||||
/** get the position of the manipulator as 4x4 Matrix.*/
|
||||
virtual osg::Matrix getMatrix() const;
|
||||
virtual osg::Matrixd getMatrix() const;
|
||||
|
||||
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
||||
virtual osg::Matrix getInverseMatrix() const;
|
||||
virtual osg::Matrixd getInverseMatrix() const;
|
||||
|
||||
/** Get the FusionDistanceMode. Used by SceneView for setting up setereo convergence.*/
|
||||
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const { return osgUtil::SceneView::USE_FUSION_DISTANCE_VALUE; }
|
||||
|
||||
Reference in New Issue
Block a user