A Verlet physics simulation, using Dots, Constraints, and Composites. Useful for goofy Softbody visuals and effects!

This simulation is standalone, meaning it doesn't directly integrate with the standard echo simulation.

Static methods

staticcloth(x:Float, y:Float, width:Float, height:Float, segments:Int, pin_mod:Int, stiffness:Float):Composite

staticrect(x:Float, y:Float, width:Float, height:Float, stiffness:Float, ?distance:Float):Composite

staticrope(points:Array<Vector2>, stiffness:Float, ?pinned:Array<Int>):Composite

Constructor

Variables

@:value(false)bounds_bottom:Bool = false

@:value(false)bounds_left:Bool = false

@:value(false)bounds_right:Bool = false

@:value(false)bounds_top:Bool = false

@:value([])read onlycomposites:Array<Composite> = []

fixed_framerate:Float

The fixed Step rate of the Verlet World. The Verlet simulation must be stepped forward at a consistent rate, or it's stability will quickly deteriorate.

read onlygravity:Vector2

The amount of acceleration applied to each Dot every Step.

height:Float

Height of the Verlet World, extending down from the World's Y position.

iterations:Int

The amount of iterations that occur on Constraints each time the Verlet World is stepped. The higher the number, the more stable the Physics Simulation will be, at the cost of performance.

width:Float

Width of the Verlet World, extending right from the World's X position.

x:Float

The Verlet World's position on the X axis.

y:Float

The Verlet World's position on the Y axis.

Methods

inlineadd(composite:Composite):Composite

inlinedispose():Void

inlineremove(composite:Composite):Bool

step(dt:Float, ?colliders:Array<Shape>):Void