本文整理汇总了C++中osg::Matrixd::getTrans方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrixd::getTrans方法的具体用法?C++ Matrixd::getTrans怎么用?C++ Matrixd::getTrans使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Matrixd
的用法示例。
在下文中一共展示了Matrixd::getTrans方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fromMatrix
void Math::fromMatrix(const osg::Matrixd& mx, double& x, double& y, double& z, double& h, double& p, double& r)
{
x = mx.getTrans().x();
y = mx.getTrans().y();
z = mx.getTrans().z();
osg::Vec3 hpr = fromQuat(mx.getRotate());
h = osg::RadiansToDegrees(hpr.x());
p = osg::RadiansToDegrees(hpr.y())-90.0;
r = osg::RadiansToDegrees(hpr.z());
}
示例2: setByMatrix
void ViroManipulator::setByMatrix(const osg::Matrixd& matrix){
this->Disable(GRAVITY);
_speed = 0.0;
_padEvent = NAVPAD_NONE;
_vEye = matrix.getTrans();
osg::Quat q = matrix.getRotate();
double qx,qy,qz,qw;
qx = q.x();
qy = q.y();
qz = q.z();
qw = q.w();
_yaw = atan2( 2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz);
_pitch = asin(2*qx*qy + 2*qz*qw);
_roll = atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qz - 2*qz*qz);
osg::Quat rot = osg::Quat( (_pitch+osg::PI_2), osg::X_AXIS) * osg::Quat(0.0/*(_roll) */, osg::Y_AXIS) * osg::Quat( (_yaw), osg::Z_AXIS);
_qRotation = rot;
//matrix.decompose(_vEye, Q, vScale, q);
//osg::Matrixd M,Ms;
//M = matrix;
//M.makeScale(-vScale);
//_qRotation = M.getRotate();
/*
osg::Vec3d vScale,E,T,U;
osg::Quat Q;
matrix.getLookAt(E, T, U );
matrix.decompose(_vEye, _qRotation, vScale, Q);
_vEye = matrix.getTrans();
//osg::Vec3d vLook = -osg::Z_AXIS * matrix;
//vLook = matrix.getScale() ^ (-vLook);
//_vTarget = vLook + _vEye;
//_vUp = osg::Z_AXIS;
//matrix.getScale();
//matrix.get( _qRotation );
//matrix.getLookAt( _vEye, _vTarget, _vUp );
//computePosition( _vEye, _vTarget, osg::Z_AXIS );
//_qRotation.set( matrix );
//SyncData( matrix.getRotate() );
//SyncData(_qRotation);
computePosition( _vEye, T, U );
SyncData();
//computePosition( matrix.getTrans(), (matrix.getTrans()+matrix.get), osg::Z_AXIS );
*/
SyncData();
}
示例3: setByMatrix
void TopView::setByMatrix(const osg::Matrixd& matrix)
{
eye = matrix.getTrans();
}
示例4: setByInverseMatrix
void HumanController::setByInverseMatrix(const osg::Matrixd& matrix)
{
_eye = -matrix.getTrans();
}
示例5: setByMatrix
void DriveManipulator::setByMatrix(const osg::Matrixd& matrix)
{
_eye = matrix.getTrans();
_rotation = matrix.getRotate();
}
示例6: setByMatrix
void GliderManipulator::setByMatrix(const osg::Matrixd& matrix)
{
_eye = matrix.getTrans();
_rotation = matrix.getRotate();
_distance = 1.0f;
}
示例7: setByMatrix
void KeyPadCameraManipulator::setByMatrix(const osg::Matrixd& matrix)
{
_pos = matrix.getTrans();
_ori = getHPRfromQuat(matrix.getRotate());
}