C# Class Project290.Physics.Common.PolygonManipulation.CuttingTools

Datei anzeigen Open project: scastle/Solitude

Public Methods

Method Description
Cut ( World world, Vector2 start, Vector2 end, float thickness ) : void

This is a high-level function to cuts fixtures inside the given world, using the start and end points. Note: We don't support cutting when the start or end is inside a shape.

SplitShape ( Fixture fixture, Vector2 entryPoint, Vector2 exitPoint, float splitSize, Vertices &first, Vertices &second ) : void

Split a fixture into 2 vertice collections using the given entry and exit-point.

Private Methods

Method Description
SanityCheck ( Vertices vertices ) : bool

Method Details

Cut() public static method

This is a high-level function to cuts fixtures inside the given world, using the start and end points. Note: We don't support cutting when the start or end is inside a shape.
public static Cut ( World world, Vector2 start, Vector2 end, float thickness ) : void
world Project290.Physics.Dynamics.World The world.
start Microsoft.Xna.Framework.Vector2 The startpoint.
end Microsoft.Xna.Framework.Vector2 The endpoint.
thickness float The thickness of the cut
return void

SplitShape() public static method

Split a fixture into 2 vertice collections using the given entry and exit-point.
public static SplitShape ( Fixture fixture, Vector2 entryPoint, Vector2 exitPoint, float splitSize, Vertices &first, Vertices &second ) : void
fixture Project290.Physics.Dynamics.Fixture The Fixture to split
entryPoint Microsoft.Xna.Framework.Vector2 The entry point - The start point
exitPoint Microsoft.Xna.Framework.Vector2 The exit point - The end point
splitSize float The size of the split. Think of this as the laser-width
first Vertices The first collection of vertexes
second Vertices The second collection of vertexes
return void