2021-11-03 22:57:48 +03:00
|
|
|
//
|
|
|
|
// Created by Иван Ильин on 04.11.2021.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SHOOTER_HITBOX_H
|
|
|
|
#define SHOOTER_HITBOX_H
|
|
|
|
|
|
|
|
#include "../Mesh.h"
|
|
|
|
|
2021-11-03 23:55:32 +03:00
|
|
|
class HitBox final {
|
2021-11-03 22:57:48 +03:00
|
|
|
private:
|
|
|
|
std::vector<Vec3D> _hitBox;
|
|
|
|
|
2021-11-04 04:30:58 +03:00
|
|
|
void _addIfUnique(Vec3D &&point);
|
2021-11-03 23:55:32 +03:00
|
|
|
|
2021-11-03 22:57:48 +03:00
|
|
|
public:
|
|
|
|
HitBox() = default;
|
2021-11-05 00:05:06 +03:00
|
|
|
HitBox(const HitBox &hitBox) = default;
|
2021-11-03 22:57:48 +03:00
|
|
|
|
2021-11-03 23:55:32 +03:00
|
|
|
explicit HitBox(const Mesh &mesh);
|
|
|
|
|
|
|
|
[[nodiscard]] std::vector<Vec3D>::iterator begin() { return _hitBox.begin(); }
|
|
|
|
|
|
|
|
[[nodiscard]] std::vector<Vec3D>::iterator end() { return _hitBox.end(); }
|
2021-11-03 22:57:48 +03:00
|
|
|
|
2021-11-03 23:55:32 +03:00
|
|
|
HitBox static Box(const Mesh &mesh);
|
2021-11-03 22:57:48 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //SHOOTER_HITBOX_H
|