AttachCircle() public static method

public static AttachCircle ( float radius, float density, Body body, Vector2 offset, object userData = null ) : Fixture
radius float
density float
body FarseerPhysics.Dynamics.Body
offset Vector2
userData object
return FarseerPhysics.Dynamics.Fixture
Beispiel #1
0
        public static Body CreateCircle(World world, float radius, float density, Vector2 position, object userData = null)
        {
            Body body = CreateBody(world, position);

            FixtureFactory.AttachCircle(radius, density, body, userData);
            return(body);
        }
Beispiel #2
0
        public static Body CreateCircle(World world, float radius, float density, Vector2 position = new Vector2(), BodyType bodyType = BodyType.Static, object userData = null)
        {
            var body = CreateBody(world, position, 0, bodyType);

            FixtureFactory.AttachCircle(radius, density, body, userData);
            return(body);
        }
Beispiel #3
0
        public static Body CreateCircle(World world, float radius, float density, Vector2 position, PressPlay.FFWD.Components.Collider userData)
        {
            Body body = CreateBody(world, position);

            FixtureFactory.AttachCircle(radius, density, body, userData);
            return(body);
        }
Beispiel #4
0
        public static Body CreateCapsule(World world, float height, float endRadius, float density, Vector2 position = new Vector2(), float rotation = 0, BodyType bodyType = BodyType.Static, object userData = null)
        {
            //Create the middle rectangle
            var rectangle = PolygonTools.CreateRectangle(endRadius, height / 2);

            var list = new List <Vertices>();

            list.Add(rectangle);
            var body = CreateCompoundPolygon(world, list, density, position, rotation, bodyType, userData);

            //Create the two circles
            FixtureFactory.AttachCircle(endRadius, density, body, new Vector2(0, height / 2));
            FixtureFactory.AttachCircle(endRadius, density, body, new Vector2(0, -(height / 2)));

            return(body);
        }