本文整理汇总了C#中FarseerPhysics.Dynamics.Joints.Joint.isFixedType方法的典型用法代码示例。如果您正苦于以下问题:C# Joint.isFixedType方法的具体用法?C# Joint.isFixedType怎么用?C# Joint.isFixedType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FarseerPhysics.Dynamics.Joints.Joint
的用法示例。
在下文中一共展示了Joint.isFixedType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawJoint
static void drawJoint( FSDebugView instance, Joint joint )
{
if( !joint.enabled )
return;
var b1 = joint.bodyA;
var b2 = joint.bodyB;
FarseerPhysics.Common.Transform xf1;
b1.getTransform( out xf1 );
var x2 = Vector2.Zero;
if( b2 != null || !joint.isFixedType() )
{
FarseerPhysics.Common.Transform xf2;
b2.getTransform( out xf2 );
x2 = xf2.p;
}
var p1 = joint.worldAnchorA;
var p2 = joint.worldAnchorB;
var x1 = xf1.p;
var color = new Color( 0.5f, 0.8f, 0.8f );
switch( joint.jointType )
{
case JointType.Distance:
{
instance.drawSegment( p1, p2, color );
break;
}
case JointType.Pulley:
{
var pulley = (PulleyJoint)joint;
var s1 = b1.getWorldPoint( pulley.localAnchorA );
var s2 = b2.getWorldPoint( pulley.localAnchorB );
instance.drawSegment( p1, p2, color );
instance.drawSegment( p1, s1, color );
instance.drawSegment( p2, s2, color );
break;
}
case JointType.FixedMouse:
{
instance.drawPoint( p1, 0.2f, new Color( 0.0f, 1.0f, 0.0f ) );
instance.drawSegment( p1, p2, new Color( 0.8f, 0.8f, 0.8f ) );
break;
}
case JointType.Revolute:
{
instance.drawSegment( x1, p1, color );
instance.drawSegment( p1, p2, color );
instance.drawSegment( x2, p2, color );
instance.drawSolidCircle( p2, 0.1f, Vector2.Zero, Color.Red );
instance.drawSolidCircle( p1, 0.1f, Vector2.Zero, Color.Blue );
break;
}
case JointType.Gear:
{
instance.drawSegment( x1, x2, color );
break;
}
default:
{
instance.drawSegment( x1, p1, color );
instance.drawSegment( p1, p2, color );
instance.drawSegment( x2, p2, color );
break;
}
}
}