本文整理汇总了C++中IVP_U_Float_Point::add_multiple方法的典型用法代码示例。如果您正苦于以下问题:C++ IVP_U_Float_Point::add_multiple方法的具体用法?C++ IVP_U_Float_Point::add_multiple怎么用?C++ IVP_U_Float_Point::add_multiple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVP_U_Float_Point
的用法示例。
在下文中一共展示了IVP_U_Float_Point::add_multiple方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitOSRay
void CTraceSolverSweptObject::InitOSRay( void )
{
// transform ray into object space
m_rayLengthOS = m_ray->m_length;
m_obstacle->TransformPositionToLocal( m_ray->m_start, m_rayStartOS );
// no translation on matrix mult because this is a vector
m_obstacle->TransformDirectionToLocal( m_ray->m_dir, m_rayDirOS );
// add_multiple with 3 params assumes no initial value (should be set_add_multiple)
m_rayCenterOS.add_multiple( &m_rayStartOS, &m_rayDirOS, m_rayLengthOS*0.5f );
m_rayEndOS.add_multiple( &m_rayStartOS, &m_rayDirOS, m_rayLengthOS );
}
示例2: SweepLedgeTree_r
void CTraceSolverSweptObject::SweepLedgeTree_r( const IVP_Compact_Ledgetree_Node *node )
{
// Recursive function
// Check whether ray hits the ledge tree node sphere
IVP_U_Float_Point center; center.set( node->center.k);
if ( !SweepHitsSphereOS( ¢er, node->radius ) )
return;
if ( node->is_terminal() == IVP_TRUE )
{
const IVP_Compact_Ledge *ledge = node->get_compact_ledge();
unsigned int ledgeContents = m_pConvexInfo->GetContents( ledge->get_client_data() );
if ( m_contentsMask & ledgeContents )
{
m_obstacle->SetLedge( ledge );
if ( SweepSingleConvex() )
{
float fraction = m_pTotalTrace->fraction * m_trace.fraction;
*m_pTotalTrace = m_trace;
m_pTotalTrace->fraction = fraction;
m_ray->Reset( m_ray->m_length * m_trace.fraction );
// Update OS ray to limit tests
m_rayCenterOS.add_multiple( &m_rayStartOS, &m_rayDirOS, m_ray->m_length*0.5f );
m_rayEndOS.add_multiple( &m_rayStartOS, &m_rayDirOS, m_ray->m_length );
m_rayLengthOS = m_ray->m_length;
m_pTotalTrace->contents = ledgeContents;
}
}
return;
}
// check nodes children
SweepLedgeTree_r(node->left_son());
SweepLedgeTree_r(node->right_son());
}
示例3: ComputeController
void ComputeController( IVP_U_Float_Point ¤tSpeed, const IVP_U_Float_Point &delta, const IVP_U_Float_Point &maxSpeed, float scaleDelta, float damping )
{
// scale by timestep
IVP_U_Float_Point acceleration;
acceleration.set_multiple( &delta, scaleDelta );
if ( currentSpeed.quad_length() < 1e-6 )
{
currentSpeed.set_to_zero();
}
acceleration.add_multiple( ¤tSpeed, -damping );
for(int i=2; i>=0; i--)
{
if(IVP_Inline_Math::fabsd(acceleration.k[i]) < maxSpeed.k[i])
continue;
// clip force
acceleration.k[i] = (acceleration.k[i] < 0) ? -maxSpeed.k[i] : maxSpeed.k[i];
}
currentSpeed.add( &acceleration );
}