当前位置: 首页>>代码示例>>C++>>正文


C++ Matrixd::getTrans方法代码示例

本文整理汇总了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());
}
开发者ID:qqdiguo,项目名称:MuseOpenIG,代码行数:11,代码来源:mathematics.cpp

示例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();
}
开发者ID:flyskyosg,项目名称:virtualrome,代码行数:57,代码来源:ViroManipulator.cpp

示例3: setByMatrix

void TopView::setByMatrix(const osg::Matrixd& matrix)
{
    eye = matrix.getTrans();
}
开发者ID:BackupTheBerlios,项目名称:eu07-svn,代码行数:4,代码来源:TopView.cpp

示例4: setByInverseMatrix

	void HumanController::setByInverseMatrix(const osg::Matrixd& matrix)
	{
		_eye = -matrix.getTrans();
	}
开发者ID:saedrna,项目名称:osgpg,代码行数:4,代码来源:HumanController.cpp

示例5: setByMatrix

void DriveManipulator::setByMatrix(const osg::Matrixd& matrix)
{
    _eye = matrix.getTrans();
    _rotation = matrix.getRotate();
}
开发者ID:aalex,项目名称:osg,代码行数:5,代码来源:DriveManipulator.cpp

示例6: setByMatrix

void GliderManipulator::setByMatrix(const osg::Matrixd& matrix)
{
    _eye = matrix.getTrans();
    _rotation = matrix.getRotate();
    _distance = 1.0f;
}
开发者ID:yueying,项目名称:osg,代码行数:6,代码来源:GliderManipulator.cpp

示例7: setByMatrix

void KeyPadCameraManipulator::setByMatrix(const osg::Matrixd& matrix)
{
    _pos = matrix.getTrans();
    _ori = getHPRfromQuat(matrix.getRotate());

}
开发者ID:wangfeilong321,项目名称:MuseOpenIG,代码行数:6,代码来源:keypad.cpp


注:本文中的osg::Matrixd::getTrans方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。