本文整理汇总了C++中Matrix4d::rotateZ方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d::rotateZ方法的具体用法?C++ Matrix4d::rotateZ怎么用?C++ Matrix4d::rotateZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4d
的用法示例。
在下文中一共展示了Matrix4d::rotateZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void SSRectangle::Update()
{
Geom* geom = VehicleMgr.GetVehicle()->FindGeom( m_CompID );
if ( !geom )
{
return;
}
vec3d center;
vector< vec3d > pntVec;
center = vec3d( m_CenterU(), m_CenterW(), 0 );
// Rotation Matrix
Matrix4d transMat1, transMat2;
Matrix4d rotMat;
rotMat.loadIdentity();
rotMat.rotateZ( m_Theta() );
transMat1.loadIdentity();
transMat1.translatef( center.x() * -1, center.y() * -1, 0 );
transMat2.loadIdentity();
transMat2.translatef( center.x(), center.y(), 0 );
// Make points in counter clockwise fashion;
pntVec.resize( 5 );
pntVec[0] = center + vec3d( m_ULength(), m_WLength(), 0 ) * -0.5;
pntVec[1] = center + vec3d( m_ULength(), -1.0 * m_WLength(), 0 ) * 0.5;
pntVec[2] = center + vec3d( m_ULength(), m_WLength(), 0 ) * 0.5;
pntVec[3] = center + vec3d( -1.0 * m_ULength(), m_WLength(), 0 ) * 0.5;
pntVec[4] = pntVec[0];
// Apply transformations
for ( int i = 0; i < 5 ; i++ )
{
pntVec[i] = transMat2.xform( rotMat.xform( transMat1.xform( pntVec[i] ) ) );
}
int pind = 0;
for ( int i = 0 ; i < 4; i++ )
{
m_LVec[i].SetSP0( pntVec[pind] );
pind++;
m_LVec[i].SetSP1( pntVec[pind] );
m_LVec[i].Update( geom );
}
SubSurface::Update();
}
示例2: Update
void PropPositioner::Update()
{
m_NeedsUpdate = false;
m_TransformedCurve = m_Curve;
Matrix4d mat;
mat.scale( m_Chord );
if ( m_Reverse < 0 )
{
mat.translatef( 1.0, 0.0, 0.0 );
mat.flipx();
}
m_TransformedCurve.Transform( mat );
if ( !m_ParentProp )
{
return;
}
// Basic transformation orients curve before other transformations.
m_ParentProp->GetBasicTransformation( m_Chord, mat );
m_TransformedCurve.Transform( mat );
mat.loadIdentity();
// Propeller rotation first because order is reversed.
mat.rotateX( -m_Reverse * m_PropRot );
mat.translatef( m_FoldOrigin.x(), m_FoldOrigin.y(), m_FoldOrigin.z() );
mat.rotate( m_FoldAngle * PI / 180.0, m_FoldDirection );
mat.translatef( -m_FoldOrigin.x(), -m_FoldOrigin.y(), -m_FoldOrigin.z() );
mat.rotateY( m_Reverse * m_Feather );
mat.translatef( 0, m_Radius, 0 );
mat.rotateY( m_Reverse * m_Twist );
mat.rotateX( m_XRotate ); // About rake direction
mat.translatef( m_Rake, 0, m_Reverse * m_Skew );
mat.rotateZ( m_ZRotate ); // About chord
m_TransformedCurve.Transform( mat );
}