Box3D
Safe HaskellNone
LanguageGHC2021

Box3D.Events

Description

Reading the per-step event buffers as ordinary Haskell values.

Box3D exposes events as C-owned arrays that live only between one step and the next. The generated World.get*Events primitives hand back the raw { pointer, count } buffer struct; this module copies the elements out (one memcpy each) into Haskell-owned storable vectors so they outlive the step. For zero-copy step-scoped views, wrap the raw buffers with unsafeViewVector. Call it after stepping.

Synopsis

Documentation

bodyMoveEvents :: WorldId -> IO (Vector BodyMoveEvent) Source #

The bodies that moved during the last step, copied out of the world-owned buffer.

sensorBeginTouchEvents :: WorldId -> IO (Vector SensorBeginTouchEvent) Source #

The shapes that started overlapping a sensor during the last step.

sensorEndTouchEvents :: WorldId -> IO (Vector SensorEndTouchEvent) Source #

The shapes that stopped overlapping a sensor during the last step.

contactBeginTouchEvents :: WorldId -> IO (Vector ContactBeginTouchEvent) Source #

The shape pairs that began touching during the last step. Requires shapeDefEnableContactEvents on both shapes.

contactEndTouchEvents :: WorldId -> IO (Vector ContactEndTouchEvent) Source #

The shape pairs that stopped touching during the last step.

contactHitEvents :: WorldId -> IO (Vector ContactHitEvent) Source #

The impacts faster than worldDefHitEventThreshold during the last step. Requires shapeDefEnableHitEvents.

jointEvents :: WorldId -> IO (Vector JointEvent) Source #

The joints that exceeded their force/torque event threshold during the last step. Requires Box3D.Joint.setForceThreshold / torque threshold and per-joint event enabling.