本文整理汇总了C#中Result.addContactPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Result.addContactPoint方法的具体用法?C# Result.addContactPoint怎么用?C# Result.addContactPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result.addContactPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getClosestPoints
internal override void getClosestPoints( ClosestPointInput input, Result output, btIDebugDraw debugDraw, bool swapResults = false )
{
//(void)debugDraw;
//btTransform transformA = input.m_transformA;
//btTransform transformB = input.m_transformB;
btVector3 point, normal;
double timeOfImpact = btScalar.BT_ONE;
double depth = btScalar.BT_ZERO;
// output.m_distance = (double)(BT_LARGE_FLOAT);
//move sphere into triangle space
btTransform sphereInTr; input.m_transformB.inverseTimes( ref input.m_transformA, out sphereInTr );
if( collide( ref sphereInTr.m_origin, out point, out normal, out depth, timeOfImpact, m_contactBreakingThreshold ) )
{
if( swapResults )
{
btVector3 normalOnB; input.m_transformB.m_basis.Apply( ref normal, out normalOnB );
btVector3 normalOnA; normalOnB.Invert( out normalOnA );
btVector3 tmp;
input.m_transformB.Apply( ref point, out tmp );
btVector3 pointOnA; tmp.AddScale( ref normalOnB, depth, out pointOnA );
output.addContactPoint( ref normalOnA, ref pointOnA, depth );
}
else
{
btVector3 tmp, tmp2;
input.m_transformB.m_basis.Apply( ref normal, out tmp );
input.m_transformB.Apply( ref point, out tmp2 );
output.addContactPoint( ref tmp, ref tmp2, depth );
}
}
}