Nez.Portable/Physics/Shapes/Box.cs
/// <summary>
/// helper that builds the points a Polygon needs in the shape of a box
/// </summary>
/// <returns>The box.</returns>
/// <param name="width">Width.</param>
/// <param name="height">Height.</param>
helper that builds the points a Polygon needs in the shape of a box
helper that builds the points a Polygon needs in the shape of a box
static Vector2[] buildBox(float width, float height)
        {
            var halfWidth = width / 2;
            var halfHeight = height / 2;
            var verts = new Vector2[4];
            verts[0] = new Vector2(-halfWidth, -halfHeight);
            verts[1] = new Vector2(halfWidth, -halfHeight);
            verts[2] = new Vector2(halfWidth, halfHeight);
            verts[3] = new Vector2(-halfWidth, halfHeight);
            return verts;
        }
static Vector2 [ ] buildBox ( float width , float height ) { var halfWidth = width / 2 ; var halfHeight = height / 2 ; var verts = new Vector2 [ 4 ] ; verts [ 0 ] = new Vector2 ( - halfWidth , - halfHeight ) ; verts [ 1 ] = new Vector2 ( halfWidth , - halfHeight ) ; verts [ 2 ] = new Vector2 ( halfWidth , halfHeight ) ; verts [ 3 ] = new Vector2 ( - halfWidth , halfHeight ) ; return verts ; }
helper that builds the points a Polygon needs in the shape of a box
helper that builds the points a Polygon needs in the shape of a box
// we create our points around a center of 0,0
None
width
float
None
height
float
None