initial commit
This commit is contained in:
parent
81af403965
commit
573e1a9fa3
220 changed files with 150440 additions and 0 deletions
51
src/sensor.h
Normal file
51
src/sensor.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// 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
|
||||
{
|
||||
b3ArrayC( b3Visitor ) hits;
|
||||
b3ArrayC( b3Visitor ) overlaps1;
|
||||
b3ArrayC( b3Visitor ) overlaps2;
|
||||
int shapeId;
|
||||
} b3Sensor;
|
||||
|
||||
typedef struct b3SensorTaskContext
|
||||
{
|
||||
b3BitSet eventBits;
|
||||
} b3SensorTaskContext;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void b3OverlapSensors( b3World* world );
|
||||
|
||||
void b3DestroySensor( b3World* world, b3Shape* sensorShape );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Loading…
Reference in a new issue