box3d/src/sensor.h
Erin Catto 1767150df4
Pull model task API (#228)
Port the pull model task API from Box2D.

https://github.com/erincatto/box2d/pull/1133

Addresses discussion #150
2026-11-17 16:42:52 -08:00

42 lines
811 B
C

// SPDX-FileCopyrightText: 2025 Erin Catto
// SPDX-License-Identifier: MIT
#pragma once
#include "bitset.h"
#include "container.h"
typedef struct b3Shape b3Shape;
typedef struct b3World b3World;
// Used to track shapes that hit sensors using time of impact
typedef struct b3SensorHit
{
int sensorId;
int visitorId;
} b3SensorHit;
typedef struct b3Visitor
{
int shapeId;
uint16_t generation;
} b3Visitor;
b3DeclareArray( b3Visitor );
typedef struct b3Sensor
{
b3Array( b3Visitor ) hits;
b3Array( b3Visitor ) overlaps1;
b3Array( b3Visitor ) overlaps2;
int shapeId;
} b3Sensor;
typedef struct b3SensorTaskContext
{
b3BitSet eventBits;
} b3SensorTaskContext;
void b3BeginSensors( b3World* world );
void b3EndSensors( b3World* world );
void b3DestroySensor( b3World* world, b3Shape* sensorShape );