本文整理汇总了C++中Point3F::least方法的典型用法代码示例。如果您正苦于以下问题:C++ Point3F::least方法的具体用法?C++ Point3F::least怎么用?C++ Point3F::least使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point3F
的用法示例。
在下文中一共展示了Point3F::least方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSpacials
void PxCapsulePlayer::setSpacials( const Point3F &nPos, const Point3F &nSize )
{
AssertFatal( nSize.least() > 0.0f, "PxCapsulePlayer::setSpacials(), invalid extents!" );
if ( mWorld )
mWorld->releaseWriteLock();
mSize = nSize;
F32 radius = getMax( nSize.x, nSize.y ) * 0.5f;
radius -= mSkinWidth;
radius = getMax(radius,0.01f);
F32 height = nSize.z - ( radius * 2.0f );
height -= mSkinWidth * 2.0f;
height = getMax(height,0.01f);
// The CapsuleController's 'actual' position we are setting.
// We are assuming the position passed in is at the bottom of the object
// box, like a standard player.
Point3F adjustedPos = nPos;
adjustedPos.z += mSize.z * 0.5f;
mCapsuleController->setPosition( pxCast<NxExtendedVec3>( adjustedPos ) );
mCapsuleController->setRadius( radius );
mCapsuleController->setHeight( height );
}
示例2: testSpacials
bool PxCapsulePlayer::testSpacials( const Point3F &nPos, const Point3F &nSize ) const
{
AssertFatal( nSize.least() > 0.0f, "PxCapsulePlayer::testSpacials(), invalid extents!" );
F32 radius = getMax( nSize.x, nSize.y ) / 2.0f;
radius -= mSkinWidth;
radius = getMax(radius,0.01f);
F32 height = nSize.z - ( radius * 2.0f );
height -= mSkinWidth * 2.0f;
height = getMax( height, 0.01f );
F32 halfHeight = height * 0.5f;
// We are assuming the position passed in is at the bottom of the object
// box, like a standard player.
Point3F adjustedPos = nPos;
adjustedPos.z += nSize.z * 0.5f;
NxVec3 origin = pxCast<NxVec3>( adjustedPos );
NxCapsule worldCapsule( NxSegment(origin,origin), radius );
worldCapsule.p0.z -= halfHeight;
worldCapsule.p1.z += halfHeight;
bool hit = mWorld->getScene()->checkOverlapCapsule( worldCapsule, NX_STATIC_SHAPES, 0xffffffff, NULL );
return !hit;
}
示例3: _createActor
void PxSingleActor::_createActor()
{
// NXU::instantiateCollection sometimes calls methods that need
// to have write access.
mWorld->releaseWriteLock();
if ( mActor )
{
mWorld->releaseActor( *mActor );
mActor = NULL;
}
NxScene *scene = mWorld->getScene();
NxMat34 nxMat;
nxMat.setRowMajor44( getTransform() );
Point3F scale = getScale();
// Look for a zero scale in any component.
if ( mIsZero( scale.least() ) )
return;
bool createActors = false;
if ( !mDataBlock->clientOnly || (mDataBlock->clientOnly && isClientObject()) )
createActors = true;
mActor = createActors ? mDataBlock->createActor( scene, &nxMat, scale ) : NULL;
if ( !mActor )
{
mBuildScale = getScale();
mBuildAngDrag = 0;
mBuildLinDrag = 0;
return;
}
U32 group = mDataBlock->clientOnly ? PxGroup_ClientOnly : PxGroup_Default;
mActor->setGroup( group );
mActor->userData = &mUserData;
mActor->setContactReportFlags( NX_NOTIFY_ON_START_TOUCH_FORCE_THRESHOLD | NX_NOTIFY_FORCES );
mActor->setContactReportThreshold( mDataBlock->forceThreshold );
mBuildScale = getScale();
mBuildAngDrag = mActor->getAngularDamping();
mBuildLinDrag = mActor->getLinearDamping();
}