本文整理汇总了C++中IVP_U_Float_Point::quad_distance_to方法的典型用法代码示例。如果您正苦于以下问题:C++ IVP_U_Float_Point::quad_distance_to方法的具体用法?C++ IVP_U_Float_Point::quad_distance_to怎么用?C++ IVP_U_Float_Point::quad_distance_to使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVP_U_Float_Point
的用法示例。
在下文中一共展示了IVP_U_Float_Point::quad_distance_to方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CPlayerController::Update( const Vector& position, const Vector& velocity, bool onground, IPhysicsObject *ground )
{
IVP_U_Point targetPositionIVP;
IVP_U_Float_Point targetSpeedIVP;
ConvertPositionToIVP( position, targetPositionIVP );
ConvertPositionToIVP( velocity, targetSpeedIVP );
// if the object hasn't moved, abort
if ( targetSpeedIVP.quad_distance_to( &m_currentSpeed ) < 1e-6 )
{
if ( targetPositionIVP.quad_distance_to( &m_targetPosition ) < 1e-6 )
{
return;
}
}
m_targetPosition = targetPositionIVP;
m_currentSpeed = targetSpeedIVP;
IVP_Real_Object *pivp = m_pObject->GetObject();
IVP_Core *pCore = pivp->get_core();
IVP_Environment *pEnv = pivp->get_environment();
pEnv->get_controller_manager()->ensure_core_in_simulation(pCore);
m_enable = true;
// m_onground makes this object anti-grav
// UNDONE: Re-evaluate this
m_onground = false;//onground;
if ( velocity.LengthSqr() <= 0.1f )
{
// no input velocity, just go where physics takes you.
m_enable = false;
ground = NULL;
}
else
{
MaxSpeed( velocity );
}
}