Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
MeshCollider.hpp
Go to the documentation of this file.
1/**************************************************************************
2 * EngineSquared v0.1.1
3 *
4 * EngineSquared is a software package, part of the Engine² organization.
5 *
6 * This file is part of the EngineSquared project that is under MIT License.
7 * Copyright © 2025-present by @EngineSquared, All rights reserved.
8 *
9 * EngineSquared is a free software: you can redistribute it and/or modify
10 * it under the terms of the MIT License. See the project's LICENSE file for
11 * the full license text and details.
12 *
13 * @file MeshCollider.hpp
14 * @brief Convex hull mesh collider component
15 *
16 * This component creates a convex hull collision shape from the
17 * entity's Object::Mesh vertices using Jolt's ConvexHullShape.
18 *
19 * @author @EngineSquared
20 * @version 0.1.1
21 * @date 2026-01-25
22 **************************************************************************/
23
24#pragma once
25
26#include "component/Mesh.hpp"
27#include <optional>
28
29namespace Physics::Component {
30
51 float activeEdgeCosThresholdAngle = 0.996195f;
52
54 std::optional<Object::Component::Mesh> mesh;
55
59 MeshCollider() = default;
60
65 explicit MeshCollider(float edgeThreshold) : activeEdgeCosThresholdAngle(edgeThreshold) {}
66};
67
68} // namespace Physics::Component
Definition BoxCollider.hpp:27
float activeEdgeCosThresholdAngle
Definition MeshCollider.hpp:51
MeshCollider(float edgeThreshold)
Construct with custom active edge threshold.
Definition MeshCollider.hpp:65
std::optional< Object::Component::Mesh > mesh
Optional embedded mesh data for collision (avoids needing entity Mesh component).
Definition MeshCollider.hpp:54
MeshCollider()=default
Default constructor.