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
7
namespace
Vkm::Engine {
8
9
struct
SupportShape
;
10
17
struct
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
29
struct
CapsuleShape
{
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
45
int
contactBoxes(
const
BoxShape
& a,
const
BoxShape
& b,
Contact
* out);
46
59
int
contactCapsuleBox(
const
CapsuleShape
& a,
const
BoxShape
& b,
Contact
* out);
60
73
int
contactCapsuleCapsule(
const
CapsuleShape
& a,
const
CapsuleShape
& b,
Contact
* out);
74
94
int
contactTriangle(
const
glm::vec3* triangle,
const
SupportShape
& shape,
Contact
* out);
95
96
}
// namespace Vkm::Engine
Vkm::Engine::BoxShape
An oriented box in world space: centre, three unit axes, half extents.
Definition
narrowphase.h:17
Vkm::Engine::CapsuleShape
A capsule in world space: a segment swept by a radius.
Definition
narrowphase.h:29
Vkm::Engine::Contact
A single collision contact point in world space.
Definition
contact.h:20
Vkm::Engine::SupportShape
A convex shape reduced to the one question GJK asks: its furthest point along a direction.
Definition
support.h:17
system
physics
collision
narrowphase.h
Generated by
1.14.0