Native physics-world notifications delivered through the extension broadcast. Defold owns simulation, collision objects and transform synchronization.
| Namespace: | dmPhysics |
| Include: | #include <dmsdk/physics/physics_event_gen.hpp> |
| CONSTANTS | |
|---|---|
| EVENT_POST_STEP | physics world step completed |
| PHYSICS_EVENT_POST_STEP | physics world step completed |
| STRUCTS | |
|---|---|
| struct Event | native physics world event |
| struct PhysicsEvent | native physics world event |
TYPE
struct EventPayload for EVENT_POST_STEP with data_size equal to sizeof(Event). Interpret m_World using the physics backend configured for the project and build. Legacy Defold Box2D supplies a b2World pointer, Box2D 3 a pointer to a b2WorldId value, and Bullet a btDiscreteDynamicsWorld pointer. For Box2D 3, copy the b2WorldId value from the supplied pointer. Native headers and libraries must match the backend bundled with this SDK. The payload and native world access are borrowed only during the callback. Read native event buffers and perform queries using that backend's own API. Do not step or destroy the world, destroy Defold-managed bodies, replace reserved user data or callbacks, or invalidate event buffers for other listeners. Defer destructive changes through Defold's normal lifecycle operations. Delivery order between extensions is unspecified. This event cannot change contact response for the completed step; that requires the backend's own pre-solve mechanism.
MEMBERS
const void* |
m_World |
borrowed native world access for the configured physics backend |
float |
m_Dt |
time-scaled world update interval in seconds; native simulated time can differ |
TYPE
struct PhysicsEventPayload for PHYSICS_EVENT_POST_STEP with data_size equal to sizeof(PhysicsEvent). Interpret m_World using the physics backend configured for the project and build. Legacy Defold Box2D supplies a b2World pointer, Box2D 3 a pointer to a b2WorldId value, and Bullet a btDiscreteDynamicsWorld pointer. For Box2D 3, copy the b2WorldId value from the supplied pointer. Native headers and libraries must match the backend bundled with this SDK. The payload and native world access are borrowed only during the callback. Read native event buffers and perform queries using that backend's own API. Do not step or destroy the world, destroy Defold-managed bodies, replace reserved user data or callbacks, or invalidate event buffers for other listeners. Defer destructive changes through Defold's normal lifecycle operations. Delivery order between extensions is unspecified. This event cannot change contact response for the completed step; that requires the backend's own pre-solve mechanism.
MEMBERS
const void* |
m_World |
borrowed native world access for the configured physics backend |
float |
m_Dt |
time-scaled world update interval in seconds; native simulated time can differ |
Event identifier for Event notifications after each Defold physics-world update. Delivery is synchronous on the engine thread after native stepping and game-object world-transform propagation, before the collection's queued message dispatch. Fixed updates publish once per completed world update; paused or skipped world updates do not publish. A backend can perform zero or multiple internal simulation substeps in one world update, as Bullet does with fixed substeps. These substeps do not publish separate events. m_Dt carries the supplied world update interval; the amount of native simulation time advanced can differ.
Event identifier for PhysicsEvent notifications after each Defold physics-world update. Delivery is synchronous on the engine thread after native stepping and game-object world-transform propagation, before the collection's queued message dispatch. Fixed updates publish once per completed world update; paused or skipped world updates do not publish. A backend can perform zero or multiple internal simulation substeps in one world update, as Bullet does with fixed substeps. These substeps do not publish separate events. m_Dt carries the supplied world update interval; the amount of native simulation time advanced can differ.