Static methods

staticcheck(world:World, ?a:BodyOrBodies, ?b:BodyOrBodies, ?options:Null<ListenerOptions>):Void

Performs a one-time collision check.

Parameters:

world

the World to check for collisions

a

The first Body or Array of Bodies to collide against

b

The second Body or Array of Bodies to collide against

options

Options to define the Collision Check's behavior

@:value({ update_world_quadtree : true })staticlinecast(line:Line, test:BodyOrBodies, ?world:World, update_world_quadtree:Bool = true):Null<Intersection>

Casts a Line, returning the Intersection with the closest Body.

Parameters:

line

Line to Cast.

test

The Body or Array of Bodies to Cast the Line at.

Returns:

Null the Intersection with the closest Body, if any occured.

@:value({ update_world_quadtree : true })staticlinecast_all(line:Line, test:BodyOrBodies, ?world:World, update_world_quadtree:Bool = true):Array<Intersection>

Casts a Line, returning all Intersections.

Parameters:

line

Line to Cast.

test

The Body or Array of Bodies to Cast the Line at.

Returns:

Array All Intersections found. if none occured, the length will be 0.

@:value({ update_world_quadtree : true })staticinlinelinecast_floats(x:Float, y:Float, dx:Float, dy:Float, test:BodyOrBodies, ?world:World, update_world_quadtree:Bool = true):Null<Intersection>

Casts a Line Created from the supplied floats, returning the Intersection with the closest Body.

Parameters:

x

The X position to start the cast.

y

The Y position to start the cast.

dx

The X position to end the cast.

dy

The Y position to end the cast.

test

The Body or Array of Bodies to Cast the Line at.

Returns:

Null the Intersection with the closest Body, if any occured.

@:value({ update_world_quadtree : true })staticinlinelinecast_vector(start:Vector2, angle:Float, length:Float, test:BodyOrBodies, ?world:World, update_world_quadtree:Bool = true):Null<Intersection>

Casts a Line Created from the supplied vector, angle, and length returning the Intersection with the closest Body.

Parameters:

start

The position to start the cast.

angle

The anglet of the casted Line.

length

The lengh of the casted Line.

test

The Body or Array of Bodies to Cast the Line at.

Returns:

Null the Intersection with the closest Body, if any occured.

@:value({ update_world_quadtree : true })staticinlinelinecast_vectors(start:Vector2, end:Vector2, test:BodyOrBodies, ?world:World, update_world_quadtree:Bool = true):Null<Intersection>

Casts a Line Created from the supplied vectors, returning the Intersection with the closest Body.

Parameters:

start

The position to start the cast.

end

The position to end the cast.

test

The Body or Array of Bodies to Cast the Line at.

Returns:

Null the Intersection with the closest Body, if any occured.

staticlisten(world:World, ?a:BodyOrBodies, ?b:BodyOrBodies, ?options:Null<ListenerOptions>):Listener

Shortcut for creating a new Listener for a set of Bodies in the World.

Parameters:

world

the World to add the Listener to

a

The first Body or Array of Bodies to collide against

b

The second Body or Array of Bodies to collide against

options

Options to define the Listener's behavior

Returns:

Listener

staticmake(world:World, options:BodyOptions):Body

Shortcut for creating a new Body and adding it to the World

Parameters:

world

the World to add the Body to

options

Options for the new Body

Returns:

Body

staticredo(world:World):World

Redo the World's last step

Parameters:

world

Returns:

World

staticstart(options:WorldOptions):World

Shortcut for creating a new World

Parameters:

options

Options for the new World

Returns:

World

@:value({ rate : 0 })staticstep(world:World, dt:Float, rate:Float = 0):Void

Steps a World forward.

Parameters:

world
dt

The Delta Time to step the World Forward

rate

The target rate of Step-Per-Second. If set to 0, the target rate is unlimited.

staticundo(world:World):World

Undo the World's last step

Parameters:

world

Returns:

World