本文整理汇总了C++中MatrixF::getUpVector方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixF::getUpVector方法的具体用法?C++ MatrixF::getUpVector怎么用?C++ MatrixF::getUpVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixF
的用法示例。
在下文中一共展示了MatrixF::getUpVector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void OrientedBox3F::set( const MatrixF& transform, const Point3F& extents )
{
mCenter = transform.getPosition();
mAxes[ RightVector ] = transform.getRightVector();
mAxes[ ForwardVector ] = transform.getForwardVector();
mAxes[ UpVector ] = transform.getUpVector();
mHalfExtents = extents * 0.5f;
_initPoints();
}
示例2: calculateHandAxisRotation
void calculateHandAxisRotation(const MatrixF& handRotation, const F32& maxHandAxisRadius, Point2F& outRotation)
{
const VectorF& controllerUp = handRotation.getUpVector();
outRotation.x = controllerUp.x;
outRotation.y = controllerUp.y;
// Limit the axis angle to that given to us
if(outRotation.len() > maxHandAxisRadius)
{
outRotation.normalize(maxHandAxisRadius);
}
// Renormalize to the range of 0..1
if(maxHandAxisRadius != 0.0f)
{
outRotation /= maxHandAxisRadius;
}
}
示例3: calculateAxisRotation
void calculateAxisRotation(const MatrixF& inRotation, const F32& maxAxisRadius, Point2F& outRotation)
{
const VectorF& controllerUp = inRotation.getUpVector();
Point2F axis(0,0);
axis.x = controllerUp.x;
axis.y = controllerUp.y;
// Limit the axis angle to that given to us
if(axis.len() > maxAxisRadius)
{
axis.normalize(maxAxisRadius);
}
// Renormalize to the range of 0..1
if(maxAxisRadius != 0.0f)
{
axis /= maxAxisRadius;
}
outRotation.x = axis.x;
outRotation.y = axis.y;
}
示例4: _renderDebug
//.........这里部分代码省略.........
// Render faces centers/colors.
if ( false )
{
GFXStateBlockDesc desc;
desc.setCullMode( GFXCullNone );
Point3F size( 0.1f );
for ( S32 i = 0; i < faceList.size(); i++ )
{
ColorI color = faceColorsx[ i % 4 ];
S32 div = ( i / 4 ) * 4;
if ( div > 0 )
color /= div;
color.alpha = 255;
Point3F pnt;
objToWorld.mulP( faceList[i].centroid, &pnt );
drawer->drawCube( desc, size, pnt, color, NULL );
}
}
// Render winding order.
if ( false )
{
GFXStateBlockDesc desc;
desc.setCullMode( GFXCullNone );
desc.setZReadWrite( true, false );
GFX->setStateBlockByDesc( desc );
U32 pointCount = 0;
for ( S32 i = 0; i < faceList.size(); i++ )
pointCount += faceList[i].winding.size();
PrimBuild::begin( GFXLineList, pointCount * 2 );
for ( S32 i = 0; i < faceList.size(); i++ )
{
for ( S32 j = 0; j < faceList[i].winding.size(); j++ )
{
Point3F p0 = pointList[ faceList[i].points[ faceList[i].winding[j] ] ];
Point3F p1 = p0 + mSurfaces[ faceList[i].id ].getUpVector() * 0.75f * ( Point3F::One / mObjScale );
objToWorld.mulP( p0 );
objToWorld.mulP( p1 );
ColorI color = faceColorsx[ j % 4 ];
S32 div = ( j / 4 ) * 4;
if ( div > 0 )
color /= div;
color.alpha = 255;
PrimBuild::color( color );
PrimBuild::vertex3fv( p0 );
PrimBuild::color( color );
PrimBuild::vertex3fv( p1 );
}
}
PrimBuild::end();
}
// Render Points.
if ( false )
{
/*
GFXTransformSaver saver;
MatrixF xfm( getRenderTransform() );
xfm.scale( getScale() );
GFX->multWorld( xfm );
GFXStateBlockDesc desc;
Point3F size( 0.05f );
*/
}
// Render surface transforms.
if ( false )
{
GFXStateBlockDesc desc;
desc.setBlend( false );
desc.setZReadWrite( true, true );
Point3F scale(mNormalLength);
for ( S32 i = 0; i < mSurfaces.size(); i++ )
{
MatrixF objToWorld( mObjToWorld );
objToWorld.scale( mObjScale );
MatrixF renderMat;
renderMat.mul( objToWorld, mSurfaces[i] );
renderMat.setPosition( renderMat.getPosition() + renderMat.getUpVector() * 0.001f );
drawer->drawTransform( desc, renderMat, &scale, NULL );
}
}
}