本文整理汇总了C#中btVector3.setZero方法的典型用法代码示例。如果您正苦于以下问题:C# btVector3.setZero方法的具体用法?C# btVector3.setZero怎么用?C# btVector3.setZero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类btVector3
的用法示例。
在下文中一共展示了btVector3.setZero方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getClosestPointsNonVirtual
//.........这里部分代码省略.........
pointOnA.SubScale( ref m_cachedSeparatingAxis, ( marginA / s ), out pointOnA );
pointOnB.AddScale( ref m_cachedSeparatingAxis, ( marginB / s ), out pointOnB );
//pointOnA -= m_cachedSeparatingAxis * ( marginA / s );
//pointOnB += m_cachedSeparatingAxis * ( marginB / s );
distance = ( ( btScalar.BT_ONE / 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();
bool isValid2 = m_penetrationDepthSolver.calcPenDepth(
m_simplexSolver,
m_minkowskiA, m_minkowskiB,
ref localTransA, ref localTransB,
ref m_cachedSeparatingAxis, out tmpPointOnA, out tmpPointOnB,
debugDraw
);
btScalar.Dbg( "points are " + tmpPointOnA.ToString() + " and " + tmpPointOnB.ToString() );
if( isValid2 )
{
btVector3 tmpNormalInB; tmpPointOnB.Sub( ref tmpPointOnA, out tmpNormalInB );
double lenSqr = tmpNormalInB.length2();
if( lenSqr <= ( btScalar.SIMD_EPSILON * btScalar.SIMD_EPSILON ) )
{
tmpNormalInB = m_cachedSeparatingAxis;
lenSqr = m_cachedSeparatingAxis.length2();
}
if( lenSqr > ( btScalar.SIMD_EPSILON * btScalar.SIMD_EPSILON ) )
{
tmpNormalInB.Mult( btScalar.btSqrt( lenSqr ), out tmpNormalInB );
btVector3 tmp;
tmpPointOnA.Sub( ref tmpPointOnB, out tmp );
double distance2 = -tmp.length();
m_lastUsedMethod = 3;
//only replace valid penetrations when the result is deeper (check)
if( !isValid || ( distance2 < distance ) )
{
distance = distance2;
pointOnA = tmpPointOnA;