PortalGame/src/collision/trianglemesh.hpp
2025-08-12 14:40:32 +02:00

27 lines
473 B
C++

#pragma once
#include <vector>
#include <span>
#include <glm/glm.hpp>
#include "aabb.hpp"
#include <memory>
#include <btBulletCollisionCommon.h>
namespace collision
{
class TriangleMesh
{
btTriangleMesh bt_mesh_;
std::unique_ptr<btBvhTriangleMeshShape> bt_shape_;
public:
TriangleMesh();
void AddTriangle(const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2);
void Build();
btBvhTriangleMeshShape* GetShape() { return bt_shape_.get(); }
};
}