From 0929f9c3a8fc393f6d2c4b24d2575702d4a23b89 Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:40:11 +0700 Subject: [PATCH] small refactoring --- Shooter.h | 2 +- engine/physics/HitBox.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Shooter.h b/Shooter.h index 4ff703c..25ec937 100644 --- a/Shooter.h +++ b/Shooter.h @@ -19,7 +19,7 @@ class Shooter final : public Engine { private: std::shared_ptr player = std::make_shared(ObjectNameTag("Player"), ShooterConsts::CUBE_OBJ, - Vec3D{1.5, 1.9, 1.5}); + Vec3D{1.5, 1.2, 1.5}); std::shared_ptr playerController = std::make_shared(player, keyboard, mouse); Window mainMenu; diff --git a/engine/physics/HitBox.cpp b/engine/physics/HitBox.cpp index cc9cc47..924f91c 100644 --- a/engine/physics/HitBox.cpp +++ b/engine/physics/HitBox.cpp @@ -38,7 +38,7 @@ void HitBox::generateSimple(const Mesh &mesh) { for(const auto& t : mesh.triangles()) { for(int i = 0; i < 3; i++) { - auto point = Vec3D(t[i]); + auto point = mesh.model()*Vec3D(t[i]); if(point.x() > maxX) { maxX = point.x(); } @@ -78,7 +78,7 @@ void HitBox::generateDetailed(const Mesh &mesh) { for (const auto& t : mesh.triangles()) for (int i = 0; i < 3; i++) - points.insert(Vec3D(t[i])); + points.insert(mesh.model()*Vec3D(t[i])); _hitBox.reserve(points.size()); for (const auto& it : points)