本文整理汇总了C++中Matrix4d::matMult方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d::matMult方法的具体用法?C++ Matrix4d::matMult怎么用?C++ Matrix4d::matMult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4d
的用法示例。
在下文中一共展示了Matrix4d::matMult方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateDrawObj
void WingGeom::UpdateDrawObj()
{
Geom::UpdateDrawObj();
Matrix4d attachMat;
Matrix4d relTrans;
attachMat = ComposeAttachMatrix();
relTrans = attachMat;
relTrans.affineInverse();
relTrans.matMult( m_ModelMatrix.data() );
relTrans.postMult( attachMat.data() );
int nxsec = m_XSecSurf.NumXSec();
m_XSecDrawObj_vec.resize( nxsec, DrawObj() );
//==== Tesselate Surface ====//
for ( int i = 0 ; i < nxsec ; i++ )
{
m_XSecDrawObj_vec[i].m_PntVec = m_XSecSurf.FindXSec( i )->GetDrawLines( m_TessW(), relTrans );
m_XSecDrawObj_vec[i].m_GeomChanged = true;
}
m_HighlightXSecDrawObj.m_PntVec = m_XSecSurf.FindXSec( m_ActiveAirfoil )->GetDrawLines( m_TessW(), relTrans );
m_HighlightXSecDrawObj.m_GeomChanged = true;
double w = m_XSecSurf.FindXSec( m_ActiveAirfoil )->GetXSecCurve()->GetWidth();
Matrix4d mat;
m_XSecSurf.GetBasicTransformation( Z_DIR, X_DIR, XS_SHIFT_MID, false, 1.0, mat );
mat.scale( 1.0/w );
VspCurve crv = m_XSecSurf.FindXSec( m_ActiveAirfoil )->GetUntransformedCurve();
crv.Transform( mat );
vector< vec3d > pts;
crv.Tesselate( m_TessW(), pts );
m_CurrentXSecDrawObj.m_PntVec = pts;
m_CurrentXSecDrawObj.m_LineWidth = 1.0;
m_CurrentXSecDrawObj.m_LineColor = vec3d( 0.0, 0.0, 0.0 );
m_CurrentXSecDrawObj.m_Type = DrawObj::VSP_LINES;
m_CurrentXSecDrawObj.m_GeomChanged = true;
VspCurve inbd = m_XSecSurf.FindXSec( m_ActiveXSec - 1 )->GetCurve();
inbd.Transform( relTrans );
VspCurve outbd = m_XSecSurf.FindXSec( m_ActiveXSec )->GetCurve();
outbd.Transform( relTrans );
BndBox iBBox, oBBox;
inbd.GetBoundingBox( iBBox );
outbd.GetBoundingBox( oBBox );
oBBox.Update( iBBox );
m_HighlightWingSecDrawObj.m_PntVec = oBBox.GetBBoxDrawLines();
}
示例2: EnforceOrder
void StackGeom::EnforceOrder( StackXSec* xs, int indx, int policy )
{
int nxsec = m_XSecSurf.NumXSec();
bool first = false;
bool last = false;
bool nextlast = false;
if( indx == 0 ) first = true;
else if( indx == (nxsec-1) ) last = true;
else if( indx == (nxsec-2) ) nextlast = true;
// STACK_FREE implicit.
if ( first )
{
xs->m_XDelta.SetLowerUpperLimits( 0.0, 0.0 );
xs->m_YDelta.SetLowerUpperLimits( 0.0, 0.0 );
xs->m_ZDelta.SetLowerUpperLimits( 0.0, 0.0 );
xs->m_XRotate.SetLowerUpperLimits( 0.0, 0.0 );
xs->m_YRotate.SetLowerUpperLimits( 0.0, 0.0 );
xs->m_ZRotate.SetLowerUpperLimits( 0.0, 0.0 );
}
else
{
xs->m_XDelta.SetLowerUpperLimits( -1.0e12, 1.0e12 );
xs->m_YDelta.SetLowerUpperLimits( -1.0e12, 1.0e12 );
xs->m_ZDelta.SetLowerUpperLimits( -1.0e12, 1.0e12 );
xs->m_XRotate.SetLowerUpperLimits( -180.0, 180.0 );
xs->m_YRotate.SetLowerUpperLimits( -180.0, 180.0 );
xs->m_ZRotate.SetLowerUpperLimits( -180.0, 180.0 );
}
if( policy == STACK_LOOP )
{
if ( last )
{
StackXSec* prevxs = (StackXSec*) m_XSecSurf.FindXSec( indx - 1);
if( prevxs )
{
Matrix4d prevxform;
prevxform.loadIdentity();
prevxform.matMult( prevxs->GetTransform()->data() );
prevxform.affineInverse();
vec3d offset = prevxform.xform( vec3d( 0.0, 0.0, 0.0 ) );
xs->m_XDelta.SetLowerUpperLimits( offset.x(), offset.x() );
xs->m_YDelta.SetLowerUpperLimits( offset.y(), offset.y() );
xs->m_ZDelta.SetLowerUpperLimits( offset.z(), offset.z() );
xs->m_XDelta.Set( offset.x() );
xs->m_YDelta.Set( offset.y() );
xs->m_ZDelta.Set( offset.z() );
vec3d angle = prevxform.getAngles();
xs->m_XRotate.SetLowerUpperLimits( angle.x(), angle.x() );
xs->m_YRotate.SetLowerUpperLimits( angle.y(), angle.y() );
xs->m_ZRotate.SetLowerUpperLimits( angle.z(), angle.z() );
xs->m_XRotate.Set( angle.x() );
xs->m_YRotate.Set( angle.y() );
xs->m_ZRotate.Set( angle.z() );
}
}
}
}
示例3: AddDefaultSources
void StackGeom::AddDefaultSources( double base_len )
{
switch ( m_OrderPolicy() )
{
case STACK_FREE:
{
StackXSec* lastxs = (StackXSec*) m_XSecSurf.FindXSec( m_XSecSurf.NumXSec() - 1);
if( lastxs )
{
Matrix4d prevxform;
prevxform.loadIdentity();
prevxform.matMult( lastxs->GetTransform()->data() );
prevxform.affineInverse();
vec3d offset = prevxform.xform( vec3d( 0.0, 0.0, 0.0 ) );
double len = offset.mag();
AddDefaultSourcesXSec( base_len, len, 0 );
AddDefaultSourcesXSec( base_len, len, m_XSecSurf.NumXSec() - 1 );
}
break;
}
case STACK_LOOP:
{
int iback = -1;
double dfront = -1.0;
for ( int i = 0 ; i < m_XSecSurf.NumXSec() ; i++ )
{
StackXSec* xs = ( StackXSec* ) m_XSecSurf.FindXSec( i );
if ( xs )
{
Matrix4d prevxform;
prevxform.loadIdentity();
prevxform.matMult( xs->GetTransform()->data() );
prevxform.affineInverse();
vec3d offset = prevxform.xform( vec3d( 0.0, 0.0, 0.0 ) );
double len = offset.mag();
if ( len > dfront )
{
dfront = len;
iback = i;
}
}
}
AddDefaultSourcesXSec( base_len, dfront, 0 );
if ( iback >= 0 )
{
AddDefaultSourcesXSec( base_len, dfront, iback );
}
break;
}
}
}