1 #ifndef BLANK_MODEL_COLLISIONBOUNDS_HPP_
2 #define BLANK_MODEL_COLLISIONBOUNDS_HPP_
4 #include "../graphics/PrimitiveMesh.hpp"
14 struct CollisionBounds {
16 /// the number of vertices this shape's outline has
17 std::size_t OutlineCount() const { return out_pos.size(); }
18 /// the number of vertex indices this shape's outline has
19 std::size_t OutlineIndexCount() const { return out_idx.size(); }
21 /// fill given buffers with these bounds' outline's elements
22 void Outline(PrimitiveMesh::Buffer &out) const;
24 /// Check if given ray would pass though this shape if it were
25 /// transformed with given matrix.
26 /// If true, dist and normal hold the intersection distance and
27 /// normal, otherwise their content is undefined.
28 virtual bool Intersects(
35 /// Check for intersection with given OBB.
36 /// The OBB is defined by box and box_M, M is applied to the shape.
37 virtual bool Intersects(
40 const glm::mat4 &box_M,
47 const PrimitiveMesh::Positions &pos,
48 const PrimitiveMesh::Indices &idx);
51 PrimitiveMesh::Positions out_pos;
52 PrimitiveMesh::Indices out_idx;