Nez.Portable/Physics/Shapes/Box.cs
/// <summary>
/// updates the Box points, recalculates the center and sets the width/height
/// </summary>
/// <param name="width">Width.</param>
/// <param name="height">Height.</param>
updates the Box points, recalculates the center and sets the width/height
updates the Box points recalculates the center and sets the width / height
public void updateBox(float width, float height)
        {
            this.width = width;
            this.height = height;
            var halfWidth = width / 2;
            var halfHeight = height / 2;
            points[0] = new Vector2(-halfWidth, -halfHeight);
            points[1] = new Vector2(halfWidth, -halfHeight);
            points[2] = new Vector2(halfWidth, halfHeight);
            points[3] = new Vector2(-halfWidth, halfHeight);
            for (var i = 0; i < points.Length; i++)
                _originalPoints[i] = points[i];
        }
public void updateBox ( float width , float height ) { this . width = width ; this . height = height ; var halfWidth = width / 2 ; var halfHeight = height / 2 ; points [ 0 ] = new Vector2 ( - halfWidth , - halfHeight ) ; points [ 1 ] = new Vector2 ( halfWidth , - halfHeight ) ; points [ 2 ] = new Vector2 ( halfWidth , halfHeight ) ; points [ 3 ] = new Vector2 ( - halfWidth , halfHeight ) ; for ( var i = 0 ; i < points . Length ; i ++ ) _originalPoints [ i ] = points [ i ] ; }
updates the Box points, recalculates the center and sets the width/height
updates the Box points recalculates the center and sets the width / height
// we create our points around a center of 0,0
width
float
None
height
float
None