本文整理汇总了C++中EulerAngles::set方法的典型用法代码示例。如果您正苦于以下问题:C++ EulerAngles::set方法的具体用法?C++ EulerAngles::set怎么用?C++ EulerAngles::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EulerAngles
的用法示例。
在下文中一共展示了EulerAngles::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Vector
TEST( Transform, planeTransformation )
{
// construct a transformation we'll use for testing
Transform trans;
Matrix transformMtx;
{
Matrix m1, m2;
EulerAngles angles;
angles.set( FastFloat::fromFloat( 45.0f ), FastFloat::fromFloat( 60.0f ), FastFloat::fromFloat( -10.0f ) );
m1.setTranslation( Vector( 1, 2, 3 ) );
m2.setRotation( angles );
transformMtx.setMul( m2, m1 );
trans.set( transformMtx );
}
// create a test plane
Plane testPlane;
testPlane.set( Float_1, Float_0, Float_0, FastFloat::fromFloat( 10.0f ) );
// transform the plane
Plane tamyTransformedPlane;
trans.transform( testPlane, tamyTransformedPlane );
// let DX help us generate a transformed plane we can compare our results against
D3DXPLANE dxTransformedPlane;
D3DXMATRIX dxMtx = ( const D3DXMATRIX& )transformMtx;
D3DXMatrixInverse( &dxMtx, NULL, &dxMtx );
D3DXMatrixTranspose( &dxMtx, &dxMtx );
D3DXPlaneTransform( &dxTransformedPlane, ( const D3DXPLANE* )&testPlane, &dxMtx );
COMPARE_PLANE( dxTransformedPlane, tamyTransformedPlane );
}
示例2:
TEST( MatrixInterpolator, rotation )
{
Matrix start;
Matrix end;
start.setIdentity();
EulerAngles ea;
ea.set( FastFloat::fromFloat( 90.0f ), Float_0, Float_0 );
end.setRotation( ea );
Matrix result;
MatrixUtils::lerp( start, end, Float_0, result );
COMPARE_MTX( start, result );
MatrixUtils::lerp( start, end, Float_1, result );
COMPARE_MTX( end, result );
Matrix expectedResult;
ea.set( FastFloat::fromFloat( 45.0f ), Float_0, Float_0 );
expectedResult.setRotation( ea );
MatrixUtils::lerp( start, end, Float_Inv2, result );
COMPARE_MTX(expectedResult, result );
}