vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
narrowphase.h
1#pragma once
2
3#include <glm/glm.hpp>
4
5#include "system/physics/collision/contact.h"
6
7namespace Vkm::Engine {
8
9struct SupportShape;
10
17struct BoxShape {
18 glm::vec3 center = {0.0f, 0.0f, 0.0f};
19 glm::vec3 axes[3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}};
20 glm::vec3 halfExtents = {0.5f, 0.5f, 0.5f};
21};
22
30 glm::vec3 a = {0.0f, -0.5f, 0.0f};
31 glm::vec3 b = {0.0f, 0.5f, 0.0f};
32 float radius = 0.5f;
33};
34
45int contactBoxes(const BoxShape& a, const BoxShape& b, Contact* out);
46
59int contactCapsuleBox(const CapsuleShape& a, const BoxShape& b, Contact* out);
60
73int contactCapsuleCapsule(const CapsuleShape& a, const CapsuleShape& b, Contact* out);
74
94int contactTriangle(const glm::vec3* triangle, const SupportShape& shape, Contact* out);
95
96} // namespace Vkm::Engine
An oriented box in world space: centre, three unit axes, half extents.
Definition narrowphase.h:17
A capsule in world space: a segment swept by a radius.
Definition narrowphase.h:29
A single collision contact point in world space.
Definition contact.h:20
A convex shape reduced to the one question GJK asks: its furthest point along a direction.
Definition support.h:17