namespace blank {
void Shape::Vertices(
- Model::Positions &vertex,
- Model::Normals &normal,
- Model::Indices &index
+ EntityModel::Positions &vertex,
+ EntityModel::Normals &normal,
+ EntityModel::Indices &index
) const {
for (const auto &pos : vtx_pos) {
vertex.emplace_back(pos);
}
void Shape::Vertices(
- Model::Positions &vertex,
- Model::Normals &normal,
- Model::Indices &index,
+ EntityModel::Positions &vertex,
+ EntityModel::Normals &normal,
+ EntityModel::Indices &index,
const glm::mat4 &transform,
- Model::Index idx_offset
+ EntityModel::Index idx_offset
) const {
for (const auto &pos : vtx_pos) {
vertex.emplace_back(transform * glm::vec4(pos, 1.0f));
bool NullShape::Intersects(
const glm::mat4 &,
const AABB &,
- const glm::mat4 &
+ const glm::mat4 &,
+ float &,
+ glm::vec3 &
) const noexcept {
return false;
}
bool CuboidShape::Intersects(
const glm::mat4 &M,
const AABB &box,
- const glm::mat4 &box_M
+ const glm::mat4 &box_M,
+ float &depth,
+ glm::vec3 &normal
) const noexcept {
- float depth;
- glm::vec3 normal;
return Intersection(bb, M, box, box_M, depth, normal);
}
bool StairShape::Intersects(
const glm::mat4 &M,
const AABB &box,
- const glm::mat4 &box_M
+ const glm::mat4 &box_M,
+ float &depth,
+ glm::vec3 &normal
) const noexcept {
- float depth;
- glm::vec3 normal;
+ // TODO: this is wrong, but simple. so for now will have to do
return Intersection(bot, M, box, box_M, depth, normal) || Intersection(top, M, box, box_M, depth, normal);
}