shooter/engine/physics/HitBox.h

33 lines
724 B
C
Raw Normal View History

//
// Created by Иван Ильин on 04.11.2021.
//
#ifndef SHOOTER_HITBOX_H
#define SHOOTER_HITBOX_H
#include "../Mesh.h"
class HitBox final {
private:
2021-11-06 00:28:55 +03:00
struct Vec3DLess {
bool operator()(const Vec3D& lhs, const Vec3D& rhs) const noexcept;
};
2021-11-06 00:28:55 +03:00
std::vector<Vec3D> _hitBox;
2021-11-09 22:54:20 +03:00
void generateSimple(const Mesh &mesh);
void generateDetailed(const Mesh &mesh);
public:
HitBox() = default;
HitBox(const HitBox &hitBox) = default;
2021-11-09 22:54:20 +03:00
explicit HitBox(const Mesh &mesh, bool useSimpleBox = true);
[[nodiscard]] std::vector<Vec3D>::iterator begin() { return _hitBox.begin(); }
[[nodiscard]] std::vector<Vec3D>::iterator end() { return _hitBox.end(); }
};
#endif //SHOOTER_HITBOX_H