本文整理汇总了C#中BulletX.LinerMath.btVector3.normalize方法的典型用法代码示例。如果您正苦于以下问题:C# btVector3.normalize方法的具体用法?C# btVector3.normalize怎么用?C# btVector3.normalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BulletX.LinerMath.btVector3
的用法示例。
在下文中一共展示了btVector3.normalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getClosestPoints
//.........这里部分代码省略.........
#endif */
break;
}
bool check = (!m_simplexSolver.fullSimplex);
//bool check = (!m_simplexSolver->fullSimplex() && squaredDistance > SIMD_EPSILON * m_simplexSolver->maxVertex());
if (!check)
{
//do we need this backup_closest here ?
m_simplexSolver.backup_closest(ref m_cachedSeparatingAxis);
m_degenerateSimplex = 13;
break;
}
}
if (checkSimplex)
{
m_simplexSolver.compute_points(out pointOnA, out pointOnB);
normalInB = pointOnA - pointOnB;
float lenSqr = m_cachedSeparatingAxis.Length2;
//valid normal
if (lenSqr < 0.0001)
{
m_degenerateSimplex = 5;
}
if (lenSqr > BulletGlobal.SIMD_EPSILON * BulletGlobal.SIMD_EPSILON)
{
float rlen = 1f / (float)Math.Sqrt(lenSqr);
normalInB *= rlen; //normalize
float s = (float)Math.Sqrt(squaredDistance);
Debug.Assert(s > 0.0f);
pointOnA -= m_cachedSeparatingAxis * (marginA / s);
pointOnB += m_cachedSeparatingAxis * (marginB / s);
distance = ((1f / rlen) - margin);
isValid = true;
m_lastUsedMethod = 1;
}
else
{
m_lastUsedMethod = 2;
}
}
bool catchDegeneratePenetrationCase =
(m_catchDegeneracies != 0 && m_penetrationDepthSolver != null && m_degenerateSimplex != 0 && ((distance + margin) < 0.01));
//if (checkPenetration && !isValid)
if (checkPenetration && (!isValid || catchDegeneratePenetrationCase))
{
//penetration case
//if there is no way to handle penetrations, bail out
if (m_penetrationDepthSolver != null)
{
// Penetration depth case.
btVector3 tmpPointOnA, tmpPointOnB;
//gNumDeepPenetrationChecks++;
m_cachedSeparatingAxis.setZero();