当前位置: 首页>>代码示例>>C++>>正文


C++ Point3F::least方法代码示例

本文整理汇总了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 );
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:26,代码来源:pxCapsulePlayer.cpp

示例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;
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:26,代码来源:pxCapsulePlayer.cpp

示例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();
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:49,代码来源:pxSingleActor.cpp


注:本文中的Point3F::least方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。