public Line(Vector2D[] vertexes, Scalar thickness, Scalar gridSpacing, Scalar momentOfInertiaMultiplier) : base(vertexes) { if (thickness < 0) { throw new ArgumentOutOfRangeException("thickness", "must be equal or larger then zero"); } if (momentOfInertiaMultiplier < 0) { throw new ArgumentOutOfRangeException("momentofInertiaMultiplier", "must be equal or larger then zero"); } this.thickness = thickness; this.thicknessHalf = thickness * .5f; this.inertiaMultiplier = momentOfInertiaMultiplier; if (thickness > 0) { this.grid = new DistanceGrid(this, gridSpacing); } }
private Line(Line copy) : base(copy) { this.thickness = copy.thickness; this.grid = copy.grid; }
private Polygon(Polygon copy) : base(copy) { this.grid = copy.grid; }
public Polygon(Vector2D[] vertexes, Scalar gridSpacing, Scalar momentOfInertiaMultiplier) : base(vertexes) { if (vertexes == null) { throw new ArgumentNullException("vertexes"); } if (vertexes.Length < 3) { throw new ArgumentException("too few", "vertexes"); } if (momentOfInertiaMultiplier <= 0) { throw new ArgumentOutOfRangeException("momentofInertiaMultiplier"); } if (gridSpacing <= 0) { throw new ArgumentOutOfRangeException("gridSpacing"); } this.grid = new DistanceGrid(this, gridSpacing); this.inertiaMultiplier = momentOfInertiaMultiplier; }