small refactoring

master
Vectozavr 2022-03-04 14:40:11 +07:00
parent 2b39c00b6c
commit 0929f9c3a8
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ class Shooter final : public Engine {
private: private:
std::shared_ptr<Player> player = std::make_shared<Player>(ObjectNameTag("Player"), std::shared_ptr<Player> player = std::make_shared<Player>(ObjectNameTag("Player"),
ShooterConsts::CUBE_OBJ, ShooterConsts::CUBE_OBJ,
Vec3D{1.5, 1.9, 1.5}); Vec3D{1.5, 1.2, 1.5});
std::shared_ptr<PlayerController> playerController = std::make_shared<PlayerController>(player, keyboard, mouse); std::shared_ptr<PlayerController> playerController = std::make_shared<PlayerController>(player, keyboard, mouse);
Window mainMenu; Window mainMenu;

View File

@ -38,7 +38,7 @@ void HitBox::generateSimple(const Mesh &mesh) {
for(const auto& t : mesh.triangles()) { for(const auto& t : mesh.triangles()) {
for(int i = 0; i < 3; i++) { for(int i = 0; i < 3; i++) {
auto point = Vec3D(t[i]); auto point = mesh.model()*Vec3D(t[i]);
if(point.x() > maxX) { if(point.x() > maxX) {
maxX = point.x(); maxX = point.x();
} }
@ -78,7 +78,7 @@ void HitBox::generateDetailed(const Mesh &mesh) {
for (const auto& t : mesh.triangles()) for (const auto& t : mesh.triangles())
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
points.insert(Vec3D(t[i])); points.insert(mesh.model()*Vec3D(t[i]));
_hitBox.reserve(points.size()); _hitBox.reserve(points.size());
for (const auto& it : points) for (const auto& it : points)