Flock::Collision::Physics2D
Global 2D physics configuration + reusable broadphase, held as a World
resource. Inserted by Physics2DPlugin.
Constructors
new(gravity : Flock::Vec2 = Flock::Vec2.new(0, -9.81), velocity_iterations : Int32 = 8, cell : Number = 1.0, allow_sleeping : Bool = true, sleep_linear_threshold : Float32 = 0.0025_f32, sleep_angular_threshold : Float32 = 0.0025_f32, sleep_time : Float32 = 0.5_f32, broadphase : Symbol = :hash)
SourceInstance methods
add_joint(j : Joint2D) : Nil
Sourceallow_sleeping=(allow_sleeping : Bool)
Sleeping: bodies at rest are deactivated per contact island.
broadphase=(broadphase : Broadphase2D)
Broadphase strategy: :hash (uniform spatial hash) or :sweep (SAP).
Accumulated contact impulses from the previous step (warm starting).
gravity
Sourcegravity=(gravity : Flock::Vec2)
Sourcejoints
Sourcesleep_angular_threshold
Sourcesleep_linear_threshold
Sourcesleep_time
Sourcevelocity_iterations
Source