box2d 3.0.0
A 2D physics engine for games
 
Loading...
Searching...
No Matches
callbacks.h
1// SPDX-FileCopyrightText: 2023 Erin Catto
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "box2d/api.h"
7#include "box2d/id.h"
8#include "box2d/types.h"
9
10typedef struct b2Manifold b2Manifold;
11
23typedef bool b2PreSolveFcn(b2ShapeId shapeIdA, b2ShapeId shapeIdB, b2Manifold* manifold, int32_t color, void* context);
24
26BOX2D_API void b2World_SetPreSolveCallback(b2WorldId worldId, b2PreSolveFcn* fcn, void* context);
27
32typedef bool b2QueryResultFcn(b2ShapeId shapeId, void* context);
33
48typedef float b2RayResultFcn(b2ShapeId shapeId, b2Vec2 point, b2Vec2 normal, float fraction, void* context);
49
51typedef struct b2RayResult
52{
53 b2ShapeId shapeId;
54 b2Vec2 point;
55 b2Vec2 normal;
56 float fraction;
57 bool hit;
59
60static const b2RayResult b2_emptyRayResult = {{-1, -1, 0}, {0.0f, 0.0f}, {0.0f, 0.0f}, 0.0f, false};
Contact manifold convex shapes.
Definition manifold.h:44
Use an instance of this structure and the callback below to get the closest hit.
Definition callbacks.h:52
References a shape instance.
Definition id.h:31
World identifier.
Definition id.h:16
types used by the Box2D API
Definition types.h:47