From 564ee34f76803ca92ddbddfaa8c54ba39052e7a6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 31 Jul 2006 17:31:21 +0000 Subject: [PATCH] Added Matrix*::getRotate()/setRotate(Quat), deprecating Matrix*::get(Quat&), Matrix*::set(Quat&) --- examples/osghangglide/GliderManipulator.cpp | 5 +- examples/osgimpostor/TestManipulator.cpp | 5 +- .../osgprerendercubemap.cpp | 3 +- examples/osgunittests/osgunittests.cpp | 6 +-- .../osgvertexprogram/osgvertexprogram.cpp | 3 +- include/osg/Export | 2 +- include/osg/Matrixd | 14 ++++-- include/osg/Matrixf | 15 ++++-- src/osg/AutoTransform.cpp | 3 +- src/osg/Matrix_implementation.cpp | 50 ++++++++++++++----- src/osg/NodeTrackerCallback.cpp | 10 +--- src/osg/Quat.cpp | 8 +-- src/osgGA/DriveManipulator.cpp | 7 ++- src/osgGA/FlightManipulator.cpp | 5 +- src/osgGA/NodeTrackerManipulator.cpp | 11 ++-- src/osgGA/TerrainManipulator.cpp | 13 +++-- src/osgGA/TrackballManipulator.cpp | 7 ++- src/osgProducer/Viewer.cpp | 2 +- src/osgWrappers/osg/Matrixd.cpp | 5 +- src/osgWrappers/osg/Matrixf.cpp | 5 +- 20 files changed, 99 insertions(+), 80 deletions(-) diff --git a/examples/osghangglide/GliderManipulator.cpp b/examples/osghangglide/GliderManipulator.cpp index f4989f1c8..565930ac7 100644 --- a/examples/osghangglide/GliderManipulator.cpp +++ b/examples/osghangglide/GliderManipulator.cpp @@ -184,7 +184,7 @@ void GliderManipulator::addMouseEvent(const GUIEventAdapter& ea) void GliderManipulator::setByMatrix(const osg::Matrixd& matrix) { _eye = matrix.getTrans(); - matrix.get(_rotation); + _rotation = matrix.getRotate(); _distance = 1.0f; } @@ -214,8 +214,7 @@ void GliderManipulator::computePosition(const osg::Vec3& eye,const osg::Vec3& lv _eye = eye; _distance = lv.length(); - rotation_matrix.get(_rotation); - _rotation = _rotation.inverse(); + _rotation = rotation_matrix.getRotate().inverse(); } diff --git a/examples/osgimpostor/TestManipulator.cpp b/examples/osgimpostor/TestManipulator.cpp index 5395a3127..ce5da0c6c 100644 --- a/examples/osgimpostor/TestManipulator.cpp +++ b/examples/osgimpostor/TestManipulator.cpp @@ -182,7 +182,7 @@ void TestManipulator::addMouseEvent(const GUIEventAdapter& ea) void TestManipulator::setByMatrix(const osg::Matrixd& matrix) { _center = matrix.getTrans(); - matrix.get(_rotation); + _rotation = matrix.getRotate(); _distance = 1.0f; } @@ -212,8 +212,7 @@ void TestManipulator::computePosition(const osg::Vec3& eye,const osg::Vec3& lv,c _center = eye+lv; _distance = lv.length(); - rotation_matrix.get(_rotation); - _rotation = _rotation.inverse(); + _rotation = rotation_matrix.getRotate().inverse(); } diff --git a/examples/osgprerendercubemap/osgprerendercubemap.cpp b/examples/osgprerendercubemap/osgprerendercubemap.cpp index 0a71a3286..d92005c26 100644 --- a/examples/osgprerendercubemap/osgprerendercubemap.cpp +++ b/examples/osgprerendercubemap/osgprerendercubemap.cpp @@ -180,8 +180,7 @@ class TexMatCullCallback : public osg::NodeCallback osgUtil::CullVisitor* cv = dynamic_cast(nv); if (cv) { - osg::Quat quat; - cv->getModelViewMatrix().get(quat); + osg::Quat quat = cv->getModelViewMatrix().getRotate(); _texmat->setMatrix(osg::Matrix::rotate(quat.inverse())); } } diff --git a/examples/osgunittests/osgunittests.cpp b/examples/osgunittests/osgunittests.cpp index 8aae0c04e..58c513430 100644 --- a/examples/osgunittests/osgunittests.cpp +++ b/examples/osgunittests/osgunittests.cpp @@ -222,14 +222,14 @@ void testGetQuatFromMatrix() { // create two matrices based on the input quats osg::Matrixd mat1,mat2; - mat1.set(rot_quat1); - mat2.set(rot_quat2); + mat1.makeRotate(rot_quat1); + mat2.makeRotate(rot_quat2); // create an output quat by matrix multiplication and get osg::Matrixd out_mat; out_mat = mat2 * mat1; osg::Quat out_quat2; - out_mat.get(out_quat2); + out_quat2 = out_mat.getRotate(); // if the output quat length is not one // or if the component magnitudes do not match, diff --git a/examples/osgvertexprogram/osgvertexprogram.cpp b/examples/osgvertexprogram/osgvertexprogram.cpp index 13b2242a7..35c9c2795 100644 --- a/examples/osgvertexprogram/osgvertexprogram.cpp +++ b/examples/osgvertexprogram/osgvertexprogram.cpp @@ -183,8 +183,7 @@ public: const osg::Matrix R = osg::Matrix::rotate( osg::DegreesToRadians(112.0f), 0.0f,0.0f,1.0f)* osg::Matrix::rotate( osg::DegreesToRadians(90.0f), 1.0f,0.0f,0.0f); - osg::Quat q; - MV.get(q); + osg::Quat q = MV.getRotate(); const osg::Matrix C = osg::Matrix::rotate( q.inverse() ); _texMat.setMatrix( C*R ); diff --git a/include/osg/Export b/include/osg/Export index 452654ba9..85c01d2c9 100644 --- a/include/osg/Export +++ b/include/osg/Export @@ -17,7 +17,7 @@ // define USE_DEPRECATED_API is used to include in API which is being fazed out // if you can compile your apps with this turned off you are // well placed for compatablity with future versions. -//#define USE_DEPRECATED_API +#define USE_DEPRECATED_API #if defined(_MSC_VER) #pragma warning( disable : 4244 ) diff --git a/include/osg/Matrixd b/include/osg/Matrixd index 6b4dfc426..150bf71d1 100644 --- a/include/osg/Matrixd +++ b/include/osg/Matrixd @@ -34,7 +34,7 @@ class OSG_EXPORT Matrixd Matrixd( const Matrixf& mat ); inline explicit Matrixd( float const * const ptr ) { set(ptr); } inline explicit Matrixd( double const * const ptr ) { set(ptr); } - inline explicit Matrixd( const Quat& quat ) { set(quat); } + inline explicit Matrixd( const Quat& quat ) { makeRotate(quat); } Matrixd(value_type a00, value_type a01, value_type a02, value_type a03, value_type a10, value_type a11, value_type a12, value_type a13, @@ -88,10 +88,6 @@ class OSG_EXPORT Matrixd value_type a20, value_type a21, value_type a22,value_type a23, value_type a30, value_type a31, value_type a32,value_type a33); - void set(const Quat& q); - - void get(Quat& q) const; - value_type * ptr() { return (value_type*)_mat; } const value_type * ptr() const { return (const value_type *)_mat; } @@ -289,6 +285,14 @@ class OSG_EXPORT Matrixd inline Vec4f operator* ( const Vec4f& v ) const; inline Vec4d operator* ( const Vec4d& v ) const; +#ifdef USE_DEPRECATED_API + inline void set(const Quat& q) { makeRotate(q); } + inline void get(Quat& q) const { q = getRotate(); } +#endif + + void setRotate(const Quat& q); + Quat getRotate() const; + void setTrans( value_type tx, value_type ty, value_type tz ); void setTrans( const Vec3f& v ); void setTrans( const Vec3d& v ); diff --git a/include/osg/Matrixf b/include/osg/Matrixf index b68f5301a..cfd340bba 100644 --- a/include/osg/Matrixf +++ b/include/osg/Matrixf @@ -34,7 +34,7 @@ class OSG_EXPORT Matrixf Matrixf( const Matrixd& mat ); inline explicit Matrixf( float const * const ptr ) { set(ptr); } inline explicit Matrixf( double const * const ptr ) { set(ptr); } - inline explicit Matrixf( const Quat& quat ) { set(quat); } + inline explicit Matrixf( const Quat& quat ) { makeRotate(quat); } Matrixf( value_type a00, value_type a01, value_type a02, value_type a03, value_type a10, value_type a11, value_type a12, value_type a13, @@ -88,10 +88,6 @@ class OSG_EXPORT Matrixf value_type a20, value_type a21, value_type a22,value_type a23, value_type a30, value_type a31, value_type a32,value_type a33); - void set(const Quat& q); - - void get(Quat& q) const; - value_type * ptr() { return (value_type*)_mat; } const value_type * ptr() const { return (const value_type *)_mat; } @@ -290,6 +286,15 @@ class OSG_EXPORT Matrixf inline Vec4f operator* ( const Vec4f& v ) const; inline Vec4d operator* ( const Vec4d& v ) const; +#ifdef USE_DEPRECATED_API + inline void set(const Quat& q) { makeRotate(q); } + inline void get(Quat& q) const { q = getRotate(); } +#endif + + void setRotate(const Quat& q); + Quat getRotate() const; + + void setTrans( value_type tx, value_type ty, value_type tz ); void setTrans( const Vec3f& v ); void setTrans( const Vec3d& v ); diff --git a/src/osg/AutoTransform.cpp b/src/osg/AutoTransform.cpp index a57b4f8b2..53666797b 100644 --- a/src/osg/AutoTransform.cpp +++ b/src/osg/AutoTransform.cpp @@ -159,8 +159,7 @@ void AutoTransform::accept(NodeVisitor& nv) if (_autoRotateMode==ROTATE_TO_SCREEN) { - osg::Quat rotation; - cs->getModelViewMatrix().get(rotation); + osg::Quat rotation = cs->getModelViewMatrix().getRotate(); setRotation(rotation.inverse()); } else if (_autoRotateMode==ROTATE_TO_CAMERA) diff --git a/src/osg/Matrix_implementation.cpp b/src/osg/Matrix_implementation.cpp index 744c76396..36e24a122 100644 --- a/src/osg/Matrix_implementation.cpp +++ b/src/osg/Matrix_implementation.cpp @@ -62,7 +62,7 @@ void Matrix_implementation::set( value_type a00, value_type a01, value_type a02, #define QZ q._v[2] #define QW q._v[3] -void Matrix_implementation::set(const Quat& q_in) +void Matrix_implementation::setRotate(const Quat& q_in) { Quat q(q_in); double length2 = q.length2(); @@ -103,29 +103,35 @@ void Matrix_implementation::set(const Quat& q_in) _mat[0][0] = 1.0 - (yy + zz); _mat[1][0] = xy - wz; _mat[2][0] = xz + wy; - _mat[3][0] = 0.0; + _mat[0][1] = xy + wz; _mat[1][1] = 1.0 - (xx + zz); _mat[2][1] = yz - wx; - _mat[3][1] = 0.0; _mat[0][2] = xz - wy; _mat[1][2] = yz + wx; _mat[2][2] = 1.0 - (xx + yy); - _mat[3][2] = 0.0; +#if 0 _mat[0][3] = 0.0; _mat[1][3] = 0.0; _mat[2][3] = 0.0; + + _mat[3][0] = 0.0; + _mat[3][1] = 0.0; + _mat[3][2] = 0.0; _mat[3][3] = 1.0; +#endif } #if 1 // David Spillings implementation Mk 2 -void Matrix_implementation::get( Quat& q ) const +Quat Matrix_implementation::getRotate() const { + Quat q; + // From http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm QW = 0.5 * sqrt( osg::maximum( 0.0, 1.0 + _mat[0][0] + _mat[1][1] + _mat[2][2] ) ); QX = 0.5 * sqrt( osg::maximum( 0.0, 1.0 + _mat[0][0] - _mat[1][1] - _mat[2][2] ) ); @@ -135,6 +141,8 @@ void Matrix_implementation::get( Quat& q ) const QX = QX * osg::sign( _mat[1][2] - _mat[2][1]) ; QY = QY * osg::sign( _mat[2][0] - _mat[0][2]) ; QZ = QZ * osg::sign( _mat[0][1] - _mat[1][0]) ; + + return q; } #else @@ -332,62 +340,78 @@ void Matrix_implementation::makeTranslate( value_type x, value_type y, value_typ void Matrix_implementation::makeRotate( const Vec3f& from, const Vec3f& to ) { + makeIdentity(); + Quat quat; quat.makeRotate(from,to); - set(quat); + setRotate(quat); } void Matrix_implementation::makeRotate( const Vec3d& from, const Vec3d& to ) { + makeIdentity(); + Quat quat; quat.makeRotate(from,to); - set(quat); + setRotate(quat); } void Matrix_implementation::makeRotate( value_type angle, const Vec3f& axis ) { + makeIdentity(); + Quat quat; quat.makeRotate( angle, axis); - set(quat); + setRotate(quat); } void Matrix_implementation::makeRotate( value_type angle, const Vec3d& axis ) { + makeIdentity(); + Quat quat; quat.makeRotate( angle, axis); - set(quat); + setRotate(quat); } void Matrix_implementation::makeRotate( value_type angle, value_type x, value_type y, value_type z ) { + makeIdentity(); + Quat quat; quat.makeRotate( angle, x, y, z); - set(quat); + setRotate(quat); } void Matrix_implementation::makeRotate( const Quat& quat ) { - set(quat); + makeIdentity(); + + setRotate(quat); } void Matrix_implementation::makeRotate( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3) { + makeIdentity(); + Quat quat; quat.makeRotate(angle1, axis1, angle2, axis2, angle3, axis3); - set(quat); + setRotate(quat); } void Matrix_implementation::makeRotate( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3) { + makeIdentity(); + Quat quat; quat.makeRotate(angle1, axis1, angle2, axis2, angle3, axis3); - set(quat); + setRotate(quat); } void Matrix_implementation::mult( const Matrix_implementation& lhs, const Matrix_implementation& rhs ) diff --git a/src/osg/NodeTrackerCallback.cpp b/src/osg/NodeTrackerCallback.cpp index 5d23c9976..8fc2b2bbe 100644 --- a/src/osg/NodeTrackerCallback.cpp +++ b/src/osg/NodeTrackerCallback.cpp @@ -35,11 +35,8 @@ class ApplyMatrixVisitor : public NodeVisitor virtual void apply(CameraView& cv) { - Quat rotation; - _matrix.get(rotation); - cv.setPosition(_matrix.getTrans()); - cv.setAttitude(rotation); + cv.setAttitude(_matrix.getRotate()); } virtual void apply(MatrixTransform& mt) @@ -49,11 +46,8 @@ class ApplyMatrixVisitor : public NodeVisitor virtual void apply(PositionAttitudeTransform& pat) { - Quat rotation; - _matrix.get(rotation); - pat.setPosition(_matrix.getTrans()); - pat.setAttitude(rotation); + pat.setAttitude(_matrix.getRotate()); } osg::Matrix _matrix; diff --git a/src/osg/Quat.cpp b/src/osg/Quat.cpp index f27ad876d..e9c5fec95 100644 --- a/src/osg/Quat.cpp +++ b/src/osg/Quat.cpp @@ -27,22 +27,22 @@ using namespace osg; void Quat::set(const Matrixf& matrix) { - matrix.get(*this); + *this = matrix.getRotate(); } void Quat::set(const Matrixd& matrix) { - matrix.get(*this); + *this = matrix.getRotate(); } void Quat::get(Matrixf& matrix) const { - matrix.set(*this); + matrix.makeRotate(*this); } void Quat::get(Matrixd& matrix) const { - matrix.set(*this); + matrix.makeRotate(*this); } diff --git a/src/osgGA/DriveManipulator.cpp b/src/osgGA/DriveManipulator.cpp index 426316bd2..5c51096c9 100644 --- a/src/osgGA/DriveManipulator.cpp +++ b/src/osgGA/DriveManipulator.cpp @@ -217,7 +217,7 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us) osg::CoordinateFrame cf=getCoordinateFrame(ep); Matrixd rotation_matrix; - rotation_matrix.set(_rotation); + rotation_matrix.makeRotate(_rotation); osg::Vec3d sv = osg::Vec3d(1.0,0.0,0.0) * rotation_matrix; osg::Vec3d bp = ep; bp -= getUpVector(cf)*_modelScale; @@ -446,7 +446,7 @@ void DriveManipulator::addMouseEvent(const GUIEventAdapter& ea) void DriveManipulator::setByMatrix(const osg::Matrixd& matrix) { _eye = matrix.getTrans(); - matrix.get(_rotation); + _rotation = matrix.getRotate(); } osg::Matrixd DriveManipulator::getMatrix() const @@ -476,8 +476,7 @@ void DriveManipulator::computePosition(const osg::Vec3d& eye,const osg::Vec3d& c 0.0, 0.0, 0.0, 1.0); _eye = eye; - rotation_matrix.get(_rotation); - _rotation = _rotation.inverse(); + _rotation = rotation_matrix.getRotate().inverse(); } diff --git a/src/osgGA/FlightManipulator.cpp b/src/osgGA/FlightManipulator.cpp index 0559a5c92..4e9b496b1 100644 --- a/src/osgGA/FlightManipulator.cpp +++ b/src/osgGA/FlightManipulator.cpp @@ -191,7 +191,7 @@ void FlightManipulator::addMouseEvent(const GUIEventAdapter& ea) void FlightManipulator::setByMatrix(const osg::Matrixd& matrix) { _eye = matrix.getTrans(); - matrix.get(_rotation); + _rotation = matrix.getRotate(); _distance = 1.0f; } @@ -223,8 +223,7 @@ void FlightManipulator::computePosition(const osg::Vec3& eye,const osg::Vec3& ce _eye = eye; _distance = lv.length(); - rotation_matrix.get(_rotation); - _rotation = _rotation.inverse(); + _rotation = rotation_matrix.getRotate().inverse(); } diff --git a/src/osgGA/NodeTrackerManipulator.cpp b/src/osgGA/NodeTrackerManipulator.cpp index 7029b6000..b7ee74123 100644 --- a/src/osgGA/NodeTrackerManipulator.cpp +++ b/src/osgGA/NodeTrackerManipulator.cpp @@ -353,7 +353,7 @@ void NodeTrackerManipulator::computeNodeCenterAndRotation(osg::Vec3d& nodeCenter double azim = atan2(-localToFrame(0,1),localToFrame(0,0)); osg::Quat nodeRotationRelToFrame, rotationOfFrame; nodeRotationRelToFrame.makeRotate(-azim,0.0,0.0,1.0); - coordinateFrame.get(rotationOfFrame); + rotationOfFrame = coordinateFrame.getRotate(); nodeRotation = nodeRotationRelToFrame*rotationOfFrame; break; } @@ -365,14 +365,14 @@ void NodeTrackerManipulator::computeNodeCenterAndRotation(osg::Vec3d& nodeCenter double sz = 1.0/sqrt(localToWorld(0,2)*localToWorld(0,2) + localToWorld(1,2)*localToWorld(1,2) + localToWorld(2,2)*localToWorld(2,2)); localToWorld = localToWorld*osg::Matrixd::scale(sx,sy,sz); - localToWorld.get(nodeRotation); + nodeRotation = localToWorld.getRotate(); break; } case(NODE_CENTER): default: { CoordinateFrame coordinateFrame = getCoordinateFrame(nodeCenter); - coordinateFrame.get(nodeRotation); + nodeRotation = coordinateFrame.getRotate(); break; } } @@ -406,9 +406,8 @@ void NodeTrackerManipulator::computePosition(const osg::Vec3d& eye,const osg::Ve osg::Matrixd lookat; lookat.makeLookAt(eye,center,up); - lookat.get(_rotation); - _rotation = _rotation.inverse(); + _rotation = lookat.getRotate().inverse(); } bool NodeTrackerManipulator::calcMovement() @@ -457,7 +456,7 @@ bool NodeTrackerManipulator::calcMovement() else { osg::Matrix rotation_matrix; - rotation_matrix.set(_rotation); + rotation_matrix.makeRotate(_rotation); osg::Vec3d lookVector = -getUpVector(rotation_matrix); osg::Vec3d sideVector = getSideVector(rotation_matrix); diff --git a/src/osgGA/TerrainManipulator.cpp b/src/osgGA/TerrainManipulator.cpp index 7eb199453..005e21e0a 100644 --- a/src/osgGA/TerrainManipulator.cpp +++ b/src/osgGA/TerrainManipulator.cpp @@ -221,7 +221,7 @@ void TerrainManipulator::setByMatrix(const osg::Matrixd& matrix) { _center = eye+ lookVector; _distance = lookVector.length(); - matrix.get(_rotation); + _rotation = matrix.getRotate(); return; } @@ -261,7 +261,7 @@ void TerrainManipulator::setByMatrix(const osg::Matrixd& matrix) matrix* osg::Matrixd::translate(-_center); - rotation_matrix.get(_rotation); + _rotation = rotation_matrix.getRotate(); hitFound = true; } @@ -372,8 +372,7 @@ void TerrainManipulator::computePosition(const osg::Vec3d& eye,const osg::Vec3d& osg::Matrixd rotation_matrix = osg::Matrixd::lookAt(eye,center,up); - rotation_matrix.get(_rotation); - _rotation = _rotation.inverse(); + _rotation = rotation_matrix.getRotate().inverse(); CoordinateFrame coordinateFrame = getCoordinateFrame(_center); _previousUp = getUpVector(coordinateFrame); @@ -421,7 +420,7 @@ bool TerrainManipulator::calcMovement() else { osg::Matrix rotation_matrix; - rotation_matrix.set(_rotation); + rotation_matrix.makeRotate(_rotation); osg::Vec3d lookVector = -getUpVector(rotation_matrix); osg::Vec3d sideVector = getSideVector(rotation_matrix); @@ -459,7 +458,7 @@ bool TerrainManipulator::calcMovement() double scale = -0.3f*_distance; osg::Matrix rotation_matrix; - rotation_matrix.set(_rotation); + rotation_matrix.makeRotate(_rotation); // compute look vector. @@ -577,7 +576,7 @@ void TerrainManipulator::clampOrientation() if (_rotationMode==ELEVATION_AZIM) { osg::Matrix rotation_matrix; - rotation_matrix.set(_rotation); + rotation_matrix.makeRotate(_rotation); osg::Vec3d lookVector = -getUpVector(rotation_matrix); osg::Vec3d upVector = getFrontVector(rotation_matrix); diff --git a/src/osgGA/TrackballManipulator.cpp b/src/osgGA/TrackballManipulator.cpp index 33b8f56f5..f9e184010 100644 --- a/src/osgGA/TrackballManipulator.cpp +++ b/src/osgGA/TrackballManipulator.cpp @@ -189,7 +189,7 @@ void TrackballManipulator::addMouseEvent(const GUIEventAdapter& ea) void TrackballManipulator::setByMatrix(const osg::Matrixd& matrix) { _center = osg::Vec3(0.0f,0.0f,-_distance)*matrix; - matrix.get(_rotation); + _rotation = matrix.getRotate(); } osg::Matrixd TrackballManipulator::getMatrix() const @@ -221,8 +221,7 @@ void TrackballManipulator::computePosition(const osg::Vec3& eye,const osg::Vec3& _center = center; _distance = lv.length(); - rotation_matrix.get(_rotation); - _rotation = _rotation.inverse(); + _rotation = rotation_matrix.getRotate().inverse(); } @@ -276,7 +275,7 @@ bool TrackballManipulator::calcMovement() float scale = -0.3f*_distance; osg::Matrix rotation_matrix; - rotation_matrix.set(_rotation); + rotation_matrix.makeRotate(_rotation); osg::Vec3 dv(dx*scale,dy*scale,0.0f); diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index 58699dd09..b3c20ab7a 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -666,7 +666,7 @@ void Viewer::frame() // record the position of the view point. osg::Matrixd matrix; matrix.invert(getViewMatrix()); - matrix.get(_orientation); + _orientation = matrix.getRotate(); double newPosition[3]; newPosition[0] = matrix(3,0); diff --git a/src/osgWrappers/osg/Matrixd.cpp b/src/osgWrappers/osg/Matrixd.cpp index b6bb52e9a..5386e2f62 100644 --- a/src/osgWrappers/osg/Matrixd.cpp +++ b/src/osgWrappers/osg/Matrixd.cpp @@ -45,8 +45,6 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixd) I_Method1(void, set, IN, float const *const, ptr); I_Method1(void, set, IN, double const *const, ptr); I_Method16(void, set, IN, osg::Matrixd::value_type, a00, IN, osg::Matrixd::value_type, a01, IN, osg::Matrixd::value_type, a02, IN, osg::Matrixd::value_type, a03, IN, osg::Matrixd::value_type, a10, IN, osg::Matrixd::value_type, a11, IN, osg::Matrixd::value_type, a12, IN, osg::Matrixd::value_type, a13, IN, osg::Matrixd::value_type, a20, IN, osg::Matrixd::value_type, a21, IN, osg::Matrixd::value_type, a22, IN, osg::Matrixd::value_type, a23, IN, osg::Matrixd::value_type, a30, IN, osg::Matrixd::value_type, a31, IN, osg::Matrixd::value_type, a32, IN, osg::Matrixd::value_type, a33); - I_Method1(void, set, IN, const osg::Quat &, q); - I_Method1(void, get, IN, osg::Quat &, q); I_Method0(osg::Matrixd::value_type *, ptr); I_Method0(const osg::Matrixd::value_type *, ptr); I_Method0(void, makeIdentity); @@ -86,6 +84,8 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixd) I_Method1(osg::Vec4d, preMult, IN, const osg::Vec4d &, v); I_Method1(osg::Vec4f, postMult, IN, const osg::Vec4f &, v); I_Method1(osg::Vec4d, postMult, IN, const osg::Vec4d &, v); + I_Method1(void, setRotate, IN, const osg::Quat &, q); + I_Method0(osg::Quat, getRotate); I_Method3(void, setTrans, IN, osg::Matrixd::value_type, tx, IN, osg::Matrixd::value_type, ty, IN, osg::Matrixd::value_type, tz); I_Method1(void, setTrans, IN, const osg::Vec3f &, v); I_Method1(void, setTrans, IN, const osg::Vec3d &, v); @@ -95,6 +95,7 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixd) I_Method1(void, preMult, IN, const osg::Matrixd &, x); I_Method1(void, postMult, IN, const osg::Matrixd &, x); I_WriteOnlyProperty(float const *const, ); + I_ReadOnlyProperty(osg::Quat, Rotate); I_ReadOnlyProperty(osg::Vec3d, Scale); I_ReadOnlyProperty(osg::Vec3d, Trans); END_REFLECTOR diff --git a/src/osgWrappers/osg/Matrixf.cpp b/src/osgWrappers/osg/Matrixf.cpp index cc111cb78..1cce03508 100644 --- a/src/osgWrappers/osg/Matrixf.cpp +++ b/src/osgWrappers/osg/Matrixf.cpp @@ -45,8 +45,6 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixf) I_Method1(void, set, IN, float const *const, ptr); I_Method1(void, set, IN, double const *const, ptr); I_Method16(void, set, IN, osg::Matrixf::value_type, a00, IN, osg::Matrixf::value_type, a01, IN, osg::Matrixf::value_type, a02, IN, osg::Matrixf::value_type, a03, IN, osg::Matrixf::value_type, a10, IN, osg::Matrixf::value_type, a11, IN, osg::Matrixf::value_type, a12, IN, osg::Matrixf::value_type, a13, IN, osg::Matrixf::value_type, a20, IN, osg::Matrixf::value_type, a21, IN, osg::Matrixf::value_type, a22, IN, osg::Matrixf::value_type, a23, IN, osg::Matrixf::value_type, a30, IN, osg::Matrixf::value_type, a31, IN, osg::Matrixf::value_type, a32, IN, osg::Matrixf::value_type, a33); - I_Method1(void, set, IN, const osg::Quat &, q); - I_Method1(void, get, IN, osg::Quat &, q); I_Method0(osg::Matrixf::value_type *, ptr); I_Method0(const osg::Matrixf::value_type *, ptr); I_Method0(void, makeIdentity); @@ -86,6 +84,8 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixf) I_Method1(osg::Vec4d, preMult, IN, const osg::Vec4d &, v); I_Method1(osg::Vec4f, postMult, IN, const osg::Vec4f &, v); I_Method1(osg::Vec4d, postMult, IN, const osg::Vec4d &, v); + I_Method1(void, setRotate, IN, const osg::Quat &, q); + I_Method0(osg::Quat, getRotate); I_Method3(void, setTrans, IN, osg::Matrixf::value_type, tx, IN, osg::Matrixf::value_type, ty, IN, osg::Matrixf::value_type, tz); I_Method1(void, setTrans, IN, const osg::Vec3f &, v); I_Method1(void, setTrans, IN, const osg::Vec3d &, v); @@ -95,6 +95,7 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixf) I_Method1(void, preMult, IN, const osg::Matrixf &, x); I_Method1(void, postMult, IN, const osg::Matrixf &, x); I_WriteOnlyProperty(float const *const, ); + I_ReadOnlyProperty(osg::Quat, Rotate); I_ReadOnlyProperty(osg::Vec3d, Scale); I_ReadOnlyProperty(osg::Vec3d, Trans); END_REFLECTOR