Ajout de Jolt Physics + 1ere version des factory entitecomposants - camera, transform, rigidbody, collider, renderer
This commit is contained in:
42
src/Engine/Core/Component/Collider/CCollider.hpp
Normal file
42
src/Engine/Core/Component/Collider/CCollider.hpp
Normal 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
|
||||
Reference in New Issue
Block a user