本文整理汇总了C#中BulletX.LinerMath.btVector3.cross方法的典型用法代码示例。如果您正苦于以下问题:C# btVector3.cross方法的具体用法?C# btVector3.cross怎么用?C# btVector3.cross使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BulletX.LinerMath.btVector3
的用法示例。
在下文中一共展示了btVector3.cross方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: applyImpulse
public void applyImpulse(btVector3 impulse, btVector3 rel_pos)
{
if (m_inverseMass != 0f)
{
applyCentralImpulse(impulse);
if (m_angularFactor.X != 0 && m_angularFactor.Y != 0 && m_angularFactor.Z != 0)
{
applyTorqueImpulse(rel_pos.cross(impulse * m_linearFactor));
}
}
}
示例2: applyForce
public void applyForce(btVector3 force, btVector3 rel_pos)
{
applyCentralForce(force);
applyTorque(rel_pos.cross(force * m_linearFactor));
}
示例3: cross
public static void cross(ref btVector3 v1, ref btVector3 v2, out btVector3 result)
{
v1.cross(ref v2, out result);
}
示例4: drawArc
public virtual void drawArc(ref btVector3 center,ref btVector3 normal,ref btVector3 axis, float radiusA, float radiusB, float minAngle, float maxAngle,
btVector3 color, bool drawSect, float stepDegrees)
{
btVector3 vx = axis;
btVector3 vy = normal.cross(axis);
float step = stepDegrees * BulletGlobal.SIMD_RADS_PER_DEG;
int nSteps = (int)((maxAngle - minAngle) / step);
if (nSteps == 0) nSteps = 1;
btVector3 prev;// = center + radiusA * vx * (float)Math.Cos(minAngle) + radiusB * vy * (float)Math.Sin(minAngle);
{
btVector3 temp1, temp2, temp3,temp4,temp5;
btVector3.Multiply(ref vx, radiusA, out temp1);
btVector3.Multiply(ref temp1, (float)Math.Cos(minAngle), out temp2);
btVector3.Multiply(ref vy, radiusB, out temp3);
btVector3.Multiply(ref temp3, (float)Math.Sin(minAngle), out temp4);
btVector3.Add(ref center, ref temp2, out temp5);
btVector3.Add(ref temp5, ref temp4, out prev);
}
if (drawSect)
{
drawLine(ref center, ref prev, ref color);
}
for (int i = 1; i <= nSteps; i++)
{
float angle = minAngle + (maxAngle - minAngle) * (float)(i) / (float)(nSteps);
btVector3 next;// = center + radiusA * vx * (float)Math.Cos(angle) + radiusB * vy * (float)Math.Cos(angle);
{
btVector3 temp1, temp2, temp3, temp4, temp5;
btVector3.Multiply(ref vx, radiusA, out temp1);
btVector3.Multiply(ref temp1, (float)Math.Cos(angle), out temp2);
btVector3.Multiply(ref vy, radiusB, out temp3);
btVector3.Multiply(ref temp3, (float)Math.Cos(angle), out temp4);
btVector3.Add(ref center, ref temp2, out temp5);
btVector3.Add(ref temp5, ref temp4, out next);
}
drawLine(ref prev, ref next, ref color);
prev = next;
}
if (drawSect)
{
drawLine(ref center, ref prev, ref color);
}
}