C# Class FarseerPhysics.Common.PathManager

An easy to use manager for creating paths.
Datei anzeigen Open project: prime31/Nez

Public Methods

Method Description
attachBodiesWithRevoluteJoint ( World world, List bodies, Vector2 localAnchorA, Vector2 localAnchorB, bool connectFirstAndLast, bool collideConnected ) : List

Attaches the bodies with revolute joints.

convertPathToEdges ( Path path, Body body, int subdivisions ) : void

Convert a path into a set of edges and attaches them to the specified body. Note: use only for static edges.

convertPathToPolygon ( Path path, Body body, float density, int subdivisions ) : void

Convert a closed path into a polygon. Convex decomposition is automatically performed.

evenlyDistributeShapesAlongPath ( World world, Path path, IEnumerable shapes, BodyType type, int copies, object userData = null ) : List

Duplicates the given Body along the given path for approximatly the given copies.

evenlyDistributeShapesAlongPath ( World world, Path path, Shape shape, BodyType type, int copies ) : List
evenlyDistributeShapesAlongPath ( World world, Path path, Shape shape, BodyType type, int copies, object userData ) : List

Duplicates the given Body along the given path for approximatly the given copies.

moveBodyOnPath ( Path path, Body body, float time, float strength, float timeStep ) : void

Moves the given body along the defined path.

Method Details

attachBodiesWithRevoluteJoint() public static method

Attaches the bodies with revolute joints.
public static attachBodiesWithRevoluteJoint ( World world, List bodies, Vector2 localAnchorA, Vector2 localAnchorB, bool connectFirstAndLast, bool collideConnected ) : List
world FarseerPhysics.Dynamics.World The world.
bodies List The bodies.
localAnchorA Vector2 The local anchor A.
localAnchorB Vector2 The local anchor B.
connectFirstAndLast bool if set to true [connect first and last].
collideConnected bool if set to true [collide connected].
return List

convertPathToEdges() public static method

Convert a path into a set of edges and attaches them to the specified body. Note: use only for static edges.
public static convertPathToEdges ( Path path, Body body, int subdivisions ) : void
path Path The path.
body FarseerPhysics.Dynamics.Body The body.
subdivisions int The subdivisions.
return void

convertPathToPolygon() public static method

Convert a closed path into a polygon. Convex decomposition is automatically performed.
public static convertPathToPolygon ( Path path, Body body, float density, int subdivisions ) : void
path Path The path.
body FarseerPhysics.Dynamics.Body The body.
density float The density.
subdivisions int The subdivisions.
return void

evenlyDistributeShapesAlongPath() public static method

Duplicates the given Body along the given path for approximatly the given copies.
public static evenlyDistributeShapesAlongPath ( World world, Path path, IEnumerable shapes, BodyType type, int copies, object userData = null ) : List
world FarseerPhysics.Dynamics.World The world.
path Path The path.
shapes IEnumerable The shapes.
type BodyType The type.
copies int The copies.
userData object
return List

evenlyDistributeShapesAlongPath() public static method

public static evenlyDistributeShapesAlongPath ( World world, Path path, Shape shape, BodyType type, int copies ) : List
world FarseerPhysics.Dynamics.World
path Path
shape FarseerPhysics.Collision.Shapes.Shape
type BodyType
copies int
return List

evenlyDistributeShapesAlongPath() public static method

Duplicates the given Body along the given path for approximatly the given copies.
public static evenlyDistributeShapesAlongPath ( World world, Path path, Shape shape, BodyType type, int copies, object userData ) : List
world FarseerPhysics.Dynamics.World The world.
path Path The path.
shape FarseerPhysics.Collision.Shapes.Shape The shape.
type BodyType The type.
copies int The copies.
userData object The user data.
return List

moveBodyOnPath() public static method

Moves the given body along the defined path.
public static moveBodyOnPath ( Path path, Body body, float time, float strength, float timeStep ) : void
path Path The path.
body FarseerPhysics.Dynamics.Body The body.
time float The time.
strength float The strength.
timeStep float The time step.
return void