vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
physics_events.h
1#pragma once
2
3#include <cstdint>
4
5#include <glm/glm.hpp>
6
7#include "ecs/entity.h"
8
9namespace Vkm::Engine {
10
17enum class ContactPhase : uint8_t {
18 Began,
19 Stayed,
20 Ended,
21};
22
32 EntityId a;
33 EntityId b;
34 ContactPhase phase = ContactPhase::Began;
35 glm::vec3 point = {0.0f, 0.0f, 0.0f};
36 glm::vec3 normal = {0.0f, 1.0f, 0.0f};
37};
38
45struct Collision {
47 glm::vec3 point = {0.0f, 0.0f, 0.0f};
48 glm::vec3 normal = {0.0f, 0.0f, 0.0f};
49};
50
60 ContactPhase phase = ContactPhase::Began;
61};
62
63} // namespace Vkm::Engine
A resolved (non-trigger) contact between two bodies began, lasted or ended this tick.
Definition physics_events.h:31
One entity's view of a CollisionEvent, as its behaviors' collision hooks receive it.
Definition physics_events.h:45
EntityId other
The entity on the far side of the contact.
Definition physics_events.h:46
glm::vec3 point
A representative world-space contact position.
Definition physics_events.h:47
glm::vec3 normal
Unit, from other into this entity.
Definition physics_events.h:48
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23
Something began, kept or stopped overlapping a trigger collider this tick.
Definition physics_events.h:57
EntityId other
The collider it overlapped.
Definition physics_events.h:59
EntityId trigger
The entity whose collider isTrigger.
Definition physics_events.h:58