PathManager
Declaration
public static class tainicom.Aether.Physics2D.Common.PathManager
An easy to use manager for creating paths.
Methods
ConvertPathToEdges static
Convert a path into a set of edges and attaches them to the specified body. Note: use only for static edges.
void ConvertPathToEdges(Path path, Body body, int subdivisions)
Parameters:
| Name | Type | Description |
|---|---|---|
path |
tainicom.Aether.Physics2D.Common.Path |
The path. |
body |
tainicom.Aether.Physics2D.Dynamics.Body |
The body. |
subdivisions |
System.Int32 |
The subdivisions. |
ConvertPathToPolygon static
Convert a closed path into a polygon. Convex decomposition is automatically performed.
void ConvertPathToPolygon(Path path, Body body, float density, int subdivisions)
Parameters:
| Name | Type | Description |
|---|---|---|
path |
tainicom.Aether.Physics2D.Common.Path |
The path. |
body |
tainicom.Aether.Physics2D.Dynamics.Body |
The body. |
density |
System.Single |
The density. |
subdivisions |
System.Int32 |
The subdivisions. |
EvenlyDistributeShapesAlongPath static
Duplicates the given Body along the given path for approximatly the given copies.
List<Body> EvenlyDistributeShapesAlongPath(World world, Path path, IEnumerable<Shape> shapes, BodyType type, int copies, object userData = null)
Parameters:
| Name | Type | Description |
|---|---|---|
world |
tainicom.Aether.Physics2D.Dynamics.World |
The world. |
path |
tainicom.Aether.Physics2D.Common.Path |
The path. |
shapes |
System.Collections.Generic.IEnumerable |
The shapes. |
type |
tainicom.Aether.Physics2D.Dynamics.BodyType |
The type. |
copies |
System.Int32 |
The copies. |
userData |
System.Object = null |
EvenlyDistributeShapesAlongPath static
Duplicates the given Body along the given path for approximatly the given copies.
List<Body> EvenlyDistributeShapesAlongPath(World world, Path path, Shape shape, BodyType type, int copies, object userData = null)
Parameters:
| Name | Type | Description |
|---|---|---|
world |
tainicom.Aether.Physics2D.Dynamics.World |
The world. |
path |
tainicom.Aether.Physics2D.Common.Path |
The path. |
shape |
tainicom.Aether.Physics2D.Collision.Shapes.Shape |
The shape. |
type |
tainicom.Aether.Physics2D.Dynamics.BodyType |
The type. |
copies |
System.Int32 |
The copies. |
userData |
System.Object = null |
The user data. |
MoveBodyOnPath static
Moves the given body along the defined path.
void MoveBodyOnPath(Path path, Body body, float time, float strength, float timeStep)
Parameters:
| Name | Type | Description |
|---|---|---|
path |
tainicom.Aether.Physics2D.Common.Path |
The path. |
body |
tainicom.Aether.Physics2D.Dynamics.Body |
The body. |
time |
System.Single |
The time. |
strength |
System.Single |
The strength. |
timeStep |
System.Single |
The time step. |
AttachBodiesWithRevoluteJoint static
Attaches the bodies with revolute joints.
List<RevoluteJoint> AttachBodiesWithRevoluteJoint(World world, List<Body> bodies, Vector2 localAnchorA, Vector2 localAnchorB, bool connectFirstAndLast, bool collideConnected)
Parameters:
| Name | Type | Description |
|---|---|---|
world |
tainicom.Aether.Physics2D.Dynamics.World |
The world. |
bodies |
System.Collections.Generic.List |
The bodies. |
localAnchorA |
Strawberry.Math.Vector2 |
The local anchor A. |
localAnchorB |
Strawberry.Math.Vector2 |
The local anchor B. |
connectFirstAndLast |
System.Boolean |
if set to true [connect first and last]. |
collideConnected |
System.Boolean |
if set to true [collide connected]. |
Nested Types
tainicom.Aether.Physics2D.Common.PathManager.LinkType
Revolute static
LinkType Revolute = 0
Slider static
LinkType Slider = 1