Ajout de Jolt Physics + 1ere version des factory entitecomposants - camera, transform, rigidbody, collider, renderer

This commit is contained in:
Tom Ray
2026-03-22 00:28:03 +01:00
parent 6695d46bcd
commit 48348936a8
1147 changed files with 214331 additions and 353 deletions

View File

@@ -0,0 +1,42 @@
#ifndef CCOLLIDER_HPP
#define CCOLLIDER_HPP
#include "CAbstractCollider.hpp"
#include <Jolt/Jolt.h>
#include <Jolt/Physics/Collision/Shape/Shape.h>
#include "../../Graphics/Data/Mesh/CMesh.hpp"
#include "nlohmann/json_fwd.hpp"
namespace CosmicCore {
enum class EColliderType {
Box,
Sphere,
Capsule,
ConvexHull,
Mesh,
Compound
};
class CCollider : public CAbstractCollider{
private:
EColliderType m_type;
JPH::ShapeRefC m_shape = nullptr;
public:
CCollider(CEntity& e, EColliderType type);
void buildFromMesh(CMesh* mesh);
void buildDefaultShape();
JPH::ShapeRefC getShape() const { return m_shape; }
EColliderType getType() const { return m_type; }
void setCapsule(float halfHeight, float radius);
void setSphereRadius(float radius);
void setBoxSize(glm::vec3 size);
void buildFromRenderer();
nlohmann::json to_json(){return nlohmann::json();};
};
}
#endif