Stowy Physics Engine 0.1.0
Loading...
Searching...
No Matches
Manifold.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include <format>
14
15#include "math/Vector2.hpp"
16
17namespace stw
18{
20{
21 Manifold(const Vector2& a, const Vector2& b, const Vector2& normal, float depth);
22 Manifold(const Vector2& normal, float depth);
23 Manifold();
24
29
34
40
44 float depth{};
45
50
55 static Manifold Empty()
56 {
57 return {};
58 }
59
60 [[nodiscard]] Manifold Swaped() const;
61};
62
63std::ostream& operator<<(std::ostream& os, const Manifold& manifold);
64}
Contains the Vector2 struct.
Definition BroadPhaseGrid.hpp:18
std::ostream & operator<<(std::ostream &os, const Manifold &manifold)
Definition Manifold.cpp:28
Definition Manifold.hpp:20
Manifold Swaped() const
Definition Manifold.cpp:19
Vector2 a
Point a of the manifold.
Definition Manifold.hpp:28
Vector2 b
Point b of the manifold.
Definition Manifold.hpp:33
static Manifold Empty()
Gets an empty manifold with no collisions.
Definition Manifold.hpp:55
float depth
The depth of the collision. Can be seen as the magnitude of the normal.
Definition Manifold.hpp:44
Manifold()
Definition Manifold.cpp:13
bool hasCollision
Boolean indicating whether a collision happened.
Definition Manifold.hpp:49
Vector2 normal
The normal of the manifold. Represents the direction in which the collision should be solved.
Definition Manifold.hpp:39
A struct representing a 2D Vector.
Definition Vector2.hpp:21