当前位置: 首页>>代码示例>>C#>>正文


C# Body.GetWorldPoint方法代码示例

本文整理汇总了C#中FarseerPhysics.Dynamics.Body.GetWorldPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Body.GetWorldPoint方法的具体用法?C# Body.GetWorldPoint怎么用?C# Body.GetWorldPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FarseerPhysics.Dynamics.Body的用法示例。


在下文中一共展示了Body.GetWorldPoint方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateRevoluteJoint

 /// <summary>
 /// Creates a revolute joint and adds it to the world
 /// </summary>
 /// <param name="world"></param>
 /// <param name="bodyA"></param>
 /// <param name="bodyB"></param>
 /// <param name="anchorB"></param>
 /// <returns></returns>
 public static RevoluteJoint CreateRevoluteJoint(World world, Body bodyA, Body bodyB, Vector2 anchorB)
 {
     Vector2 localanchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(anchorB));
     RevoluteJoint joint = new RevoluteJoint(bodyA, bodyB, localanchorA, anchorB);
     world.AddJoint(joint);
     return joint;
 }
开发者ID:Alexz18z35z,项目名称:Gibbo2D,代码行数:15,代码来源:JointFactory.cs

示例2: DrawFixture

        private void DrawFixture(Graphic g, Body body, Fixture fixture, Color color)
        {
            switch (fixture.Shape.ShapeType)
            {
                case ShapeType.Circle:
                    {
                        var circle = (CircleShape)fixture.Shape;

                        Vector2 center = body.GetWorldPoint(circle.Position);
                        if (DrawSolidShape)
                        {
                            g.DrawSolidCircle(center, circle.Radius, color);
                        }
                        else
                        {
                            g.DrawCircle(center, circle.Radius, color);
                        }

                        break;
                    }

                case ShapeType.Polygon:
                    {
                        TempVertices.Clear();
                        var poly = fixture.Shape as PolygonShape;
                        int vertexCount = poly.Vertices.Count;

                        for (int i = 0; i < vertexCount; ++i)
                        {
                            var p = body.GetWorldPoint(poly.Vertices[i]);
                            TempVertices.Add(p);
                        }

                        if (DrawSolidShape)
                        {
                            g.DrawSolidPolygon(TempVertices.ToArray(), color);
                        }
                        else
                        {
                            g.DrawPolygon(TempVertices.ToArray(), color);
                        }

                        break;
                    }
            }
        }
开发者ID:hgrandry,项目名称:Mgx,代码行数:46,代码来源:BodyRenderer.cs

示例3: CreateRevoluteJoint

 /// <summary>
 /// Creates a revolute joint.
 /// </summary>
 /// <param name="bodyA"></param>
 /// <param name="bodyB"></param>
 /// <param name="localAnchorB">The anchor of bodyB in local coordinates</param>
 /// <returns></returns>
 public static RevoluteJoint CreateRevoluteJoint(Body bodyA, Body bodyB, Vector2 localAnchorB)
 {
     Vector2 localanchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(localAnchorB));
     RevoluteJoint joint = new RevoluteJoint(bodyA, bodyB, localanchorA, localAnchorB);
     return joint;
 }
开发者ID:HaKDMoDz,项目名称:Zazumo,代码行数:13,代码来源:JointFactory.cs

示例4: CreatePrismaticJoint

 /// <summary>
 /// Creates a prsimatic joint
 /// </summary>
 /// <param name="bodyA"></param>
 /// <param name="bodyB"></param>
 /// <param name="localanchorB"></param>
 /// <param name="axis"></param>
 /// <returns></returns>
 public static PrismaticJoint CreatePrismaticJoint(Body bodyA, Body bodyB, Vector2 localanchorB, Vector2 axis)
 {
     Vector2 localanchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(localanchorB));
     PrismaticJoint joint = new PrismaticJoint(bodyA, bodyB, localanchorA, localanchorB, axis);
     return joint;
 }
开发者ID:HaKDMoDz,项目名称:Zazumo,代码行数:14,代码来源:JointFactory.cs

示例5: CreateWeldJoint

 /// <summary>
 /// Creates a weld joint
 /// </summary>
 /// <param name="world"></param>
 /// <param name="bodyA"></param>
 /// <param name="bodyB"></param>
 /// <param name="localanchorB"></param>
 /// <returns></returns>
 public static WeldJoint CreateWeldJoint(Body bodyA, Body bodyB, Vector2 localanchorB)
 {
     Vector2 localanchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(localanchorB));
     WeldJoint joint = new WeldJoint(bodyA, bodyB, localanchorA, localanchorB);
     return joint;
 }
开发者ID:HaKDMoDz,项目名称:Lunar-Development-Kit,代码行数:14,代码来源:JointFactory.cs


注:本文中的FarseerPhysics.Dynamics.Body.GetWorldPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。