box2d 3.0.0
A 2D physics engine for games
 
Loading...
Searching...
No Matches
manifold.h
1// SPDX-FileCopyrightText: 2023 Erin Catto
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "box2d/types.h"
7
8typedef struct b2Circle b2Circle;
9typedef struct b2Capsule b2Capsule;
10typedef struct b2DistanceCache b2DistanceCache;
11typedef struct b2Polygon b2Polygon;
12typedef struct b2Segment b2Segment;
13typedef struct b2SmoothSegment b2SmoothSegment;
14
18typedef struct b2ManifoldPoint
19{
22
24 b2Vec2 anchorA, anchorB;
25
28
31
34
36 uint16_t id;
37
41
43typedef struct b2Manifold
44{
45 b2ManifoldPoint points[2];
46 b2Vec2 normal;
47 int32_t pointCount;
49
51static const b2Manifold b2_emptyManifold = B2_ZERO_INIT;
52
54BOX2D_API b2Manifold b2CollideCircles(const b2Circle* circleA, b2Transform xfA, const b2Circle* circleB, b2Transform xfB);
55
57BOX2D_API b2Manifold b2CollideCapsuleAndCircle(const b2Capsule* capsuleA, b2Transform xfA, const b2Circle* circleB,
58 b2Transform xfB);
59
61BOX2D_API b2Manifold b2CollideSegmentAndCircle(const b2Segment* segmentA, b2Transform xfA, const b2Circle* circleB,
62 b2Transform xfB);
63
65BOX2D_API b2Manifold b2CollidePolygonAndCircle(const b2Polygon* polygonA, b2Transform xfA, const b2Circle* circleB,
66 b2Transform xfB);
67
69BOX2D_API b2Manifold b2CollideCapsules(const b2Capsule* capsuleA, b2Transform xfA, const b2Capsule* capsuleB, b2Transform xfB,
70 b2DistanceCache* cache);
71
73BOX2D_API b2Manifold b2CollideSegmentAndCapsule(const b2Segment* segmentA, b2Transform xfA, const b2Capsule* capsuleB,
74 b2Transform xfB, b2DistanceCache* cache);
75
77BOX2D_API b2Manifold b2CollidePolygonAndCapsule(const b2Polygon* polygonA, b2Transform xfA, const b2Capsule* capsuleB,
78 b2Transform xfB, b2DistanceCache* cache);
79
81BOX2D_API b2Manifold b2CollidePolygons(const b2Polygon* polyA, b2Transform xfA, const b2Polygon* polyB, b2Transform xfB,
82 b2DistanceCache* cache);
83
85BOX2D_API b2Manifold b2CollideSegmentAndPolygon(const b2Segment* segmentA, b2Transform xfA, const b2Polygon* polygonB,
86 b2Transform xfB, b2DistanceCache* cache);
87
89BOX2D_API b2Manifold b2CollideSmoothSegmentAndCircle(const b2SmoothSegment* smoothSegmentA, b2Transform xfA,
90 const b2Circle* circleB, b2Transform xfB);
91
93BOX2D_API b2Manifold b2CollideSmoothSegmentAndCapsule(const b2SmoothSegment* segmentA, b2Transform xfA, const b2Capsule* capsuleB,
94 b2Transform xfB, b2DistanceCache* cache);
95
97BOX2D_API b2Manifold b2CollideSmoothSegmentAndPolygon(const b2SmoothSegment* segmentA, b2Transform xfA, const b2Polygon* polygonB,
98 b2Transform xfB, b2DistanceCache* cache);
A solid capsule.
Definition geometry.h:44
A solid circle.
Definition geometry.h:37
Definition distance.h:33
Contact manifold convex shapes.
Definition manifold.h:44
Definition manifold.h:19
float normalImpulse
the non-penetration impulse
Definition manifold.h:30
float tangentImpulse
the friction impulse
Definition manifold.h:33
b2Vec2 point
world coordinates of contact point
Definition manifold.h:21
b2Vec2 anchorA
body anchors used by solver internally
Definition manifold.h:24
float separation
the separation of the contact point, negative if penetrating
Definition manifold.h:27
uint16_t id
uniquely identifies a contact point between two shapes
Definition manifold.h:36
bool persisted
did this contact point exist the previous step?
Definition manifold.h:39
Definition geometry.h:56
A line segment with two-sided collision.
Definition geometry.h:66
Definition geometry.h:74
types used by the Box2D API
#define B2_ZERO_INIT
Used for C zero initialization, such as b2Vec2 v = {0} where C++ requires b2Vec2 v = {}.
Definition types.h:32
A 2D rigid transform.
Definition types.h:61
Definition types.h:47