Class PathManager
- Namespace
- Alis.Core.Physic.Common
- Assembly
- Alis.dll
An easy to use manager for creating paths.
public static class PathManager
Inheritance
Inherited Members
Methods
AttachBodiesWithRevoluteJoint(World, List<Body>, Vector2, Vector2, bool, bool)
Attaches the bodies with revolute joints.
public static List<RevoluteJoint> AttachBodiesWithRevoluteJoint(World world, List<Body> bodies, Vector2 localAnchorA, Vector2 localAnchorB, bool connectFirstAndLast, bool collideConnected)
Parameters
world
World-
The world.
bodies
List<Body>-
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].
Returns
ConvertPathToEdges(Path, Body, int)
Convert a path into a set of edges and attaches them to the specified body. Note: use only for static edges.
public static void ConvertPathToEdges(Path path, Body body, int subdivisions)
Parameters
ConvertPathToPolygon(Path, Body, float, int)
Convert a closed path into a polygon. Convex decomposition is automatically performed.
public static void ConvertPathToPolygon(Path path, Body body, float density, int subdivisions)
Parameters
path
Path-
The path.
body
Body-
The body.
density
float-
The density.
subdivisions
int-
The subdivisions.
EvenlyDistributeShapesAlongPath(World, Path, IEnumerable<Shape>, BodyType, int, object)
Duplicates the given Body along the given path for approximatly the given copies.
public static List<Body> EvenlyDistributeShapesAlongPath(World world, Path path, IEnumerable<Shape> shapes, BodyType type, int copies, object userData = null)
Parameters
world
World-
The world.
path
Path-
The path.
shapes
IEnumerable<Shape>-
The shapes.
type
BodyType-
The type.
copies
int-
The copies.
userData
object
Returns
EvenlyDistributeShapesAlongPath(World, Path, Shape, BodyType, int, object)
Duplicates the given Body along the given path for approximatly the given copies.
public static List<Body> EvenlyDistributeShapesAlongPath(World world, Path path, Shape shape, BodyType type, int copies, object userData = null)
Parameters
world
World-
The world.
path
Path-
The path.
shape
Shape-
The shape.
type
BodyType-
The type.
copies
int-
The copies.
userData
object-
The user data.
Returns
MoveBodyOnPath(Path, Body, float, float, float)
Moves the given body along the defined path.
public static void MoveBodyOnPath(Path path, Body body, float time, float strength, float timeStep)