Made the following name changes to Matrix and Quat to clean them up and make
the functionality clear given the name. This will break user code unfortunately so please be away of the following mapping. osg::Matrix::makeTrans(..)?\026 -> osg::Matrix::makeTranslate(..) osg::Matrix::makeRot(..)?\026 -> osg::Matrix::makeRotate(..) osg::Matrix::trans(..)?\026 -> osg::Matrix::translate(..) osg::Quat::makeRot(..)?\026 -> osg::Quat::makeRotate(..) Also updated the rest of the OSG distribution to use the new names, and have removed the old deprecated Matrix methods too.
This commit is contained in:
@@ -208,7 +208,7 @@ bool GliderManipulator::calcMovement()
|
||||
float roll = inDegrees(dx*0.1f*dt);
|
||||
|
||||
osg::Matrix mat;
|
||||
mat.makeTrans(-center);
|
||||
mat.makeTranslate(-center);
|
||||
mat *= Matrix::rotate(pitch,sv.x(),sv.y(),sv.z());
|
||||
mat *= Matrix::rotate(roll,lv.x(),lv.y(),lv.z());
|
||||
if (_yawMode==YAW_AUTOMATICALLY_WHEN_BANKED)
|
||||
@@ -220,7 +220,7 @@ bool GliderManipulator::calcMovement()
|
||||
|
||||
lv *= (_velocity*dt);
|
||||
|
||||
mat *= Matrix::trans(center + lv);
|
||||
mat *= Matrix::translate(center + lv);
|
||||
|
||||
_camera->transformLookAt(mat);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class CameraPacket {
|
||||
osg::Vec3 lv = _center-_eye;
|
||||
osg::Matrix matrix;
|
||||
matrix.makeIdent();
|
||||
matrix.makeRot(angle_offset,_up.x(),_up.y(),_up.z());
|
||||
matrix.makeRotate(angle_offset,_up.x(),_up.y(),_up.z());
|
||||
lv = lv*matrix;
|
||||
|
||||
camera.setLookAt(_eye,_eye+lv,_up);
|
||||
|
||||
@@ -24,7 +24,7 @@ void OrientationConverter::setRotation( const Vec3 &from, const Vec3 &to )
|
||||
|
||||
void OrientationConverter::setTranslation( const Vec3 &trans )
|
||||
{
|
||||
T = Matrix::trans(trans);
|
||||
T = Matrix::translate(trans);
|
||||
_trans_set = true;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ void OrientationConverter::convert( Node &node )
|
||||
// else
|
||||
// - translate back to model's original origin.
|
||||
BoundingSphere bs = node.getBound();
|
||||
Matrix C = Matrix::trans( Vec3(0,0,0) - bs.center() );
|
||||
Matrix C = Matrix::translate( Vec3(0,0,0) - bs.center() );
|
||||
if( _trans_set == false )
|
||||
T = Matrix::trans( bs.center() );
|
||||
T = Matrix::translate( bs.center() );
|
||||
_cv.setMatrix( C * R * S * T );
|
||||
|
||||
node.accept(_cv);
|
||||
|
||||
@@ -45,8 +45,8 @@ class MyTransformCallback : public osg::NodeCallback{
|
||||
float delta_angle = _angular_velocity*_timer.delta_s(_orig_t,new_t);
|
||||
|
||||
osg::Matrix matrix;
|
||||
matrix.makeRot(delta_angle,1.0f,1.0f,1.0f);
|
||||
matrix *= osg::Matrix::trans(1.0f,0.0f,0.0f);
|
||||
matrix.makeRotate(delta_angle,1.0f,1.0f,1.0f);
|
||||
matrix *= osg::Matrix::translate(1.0f,0.0f,0.0f);
|
||||
matrix *= osg::Matrix::rotate(delta_angle,0.0f,0.0f,1.0f);
|
||||
|
||||
_nodeToOperateOn->setMatrix(matrix);
|
||||
|
||||
@@ -367,9 +367,9 @@ int main( int argc, char **argv )
|
||||
|
||||
osg::Transform* dcs = new osg::Transform;
|
||||
dcs->setStateSet(dstate);
|
||||
dcs->preMult(osg::Matrix::trans(0.0f,0.0f,-z)*
|
||||
dcs->preMult(osg::Matrix::translate(0.0f,0.0f,-z)*
|
||||
osg::Matrix::scale(1.0f,1.0f,-1.0f)*
|
||||
osg::Matrix::trans(0.0f,0.0f,z));
|
||||
osg::Matrix::translate(0.0f,0.0f,z));
|
||||
|
||||
dcs->addChild(loadedModelTransform);
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ osg::Node* createTexturedItem(const osg::Vec3& offset,osg::Texture* texture,osg:
|
||||
// place and also to add individual texture set to it, so that
|
||||
// that state is inherited down to its children.
|
||||
osg::Transform* local_transform = new osg::Transform;
|
||||
local_transform->postMult(osg::Matrix::trans(offset));
|
||||
local_transform->postMult(osg::Matrix::translate(offset));
|
||||
|
||||
// create the StateSet to store the texture data
|
||||
osg::StateSet* stateset = new osg::StateSet;
|
||||
@@ -140,7 +140,7 @@ osg::Node* createLayer(const osg::Vec3& offset,osg::Image* image,osg::Node* geom
|
||||
if (image==NULL) return NULL;
|
||||
|
||||
osg::Transform* top_transform = new osg::Transform;
|
||||
top_transform->postMult(osg::Matrix::trans(offset));
|
||||
top_transform->postMult(osg::Matrix::translate(offset));
|
||||
|
||||
osg::Vec3 local_offset(0.0f,0.0f,0.0f);
|
||||
osg::Vec3 local_delta(3.0f,0.0f,0.0f);
|
||||
|
||||
Reference in New Issue
Block a user