diff --git a/engine/physics/HitBox.cpp b/engine/physics/HitBox.cpp index 924f91c..cc9cc47 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 = mesh.model()*Vec3D(t[i]); + auto point = 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(mesh.model()*Vec3D(t[i])); + points.insert(Vec3D(t[i])); _hitBox.reserve(points.size()); for (const auto& it : points) diff --git a/engine/physics/RigidBody.cpp b/engine/physics/RigidBody.cpp index 01b12f1..1c9cbae 100644 --- a/engine/physics/RigidBody.cpp +++ b/engine/physics/RigidBody.cpp @@ -18,10 +18,6 @@ RigidBody::RigidBody(ObjectNameTag nameTag, const std::string &filename, const V RigidBody::RigidBody(const Mesh &mesh, bool useSimpleBox) : Mesh(mesh), _hitBox(mesh, useSimpleBox) { } -void RigidBody::recalculateHitBox(bool useSimpleBox) { - _hitBox = HitBox(*this, useSimpleBox); -} - Vec3D RigidBody::_findFurthestPoint(const Vec3D &direction) { Vec3D maxPoint{0, 0, 0}; diff --git a/engine/physics/RigidBody.h b/engine/physics/RigidBody.h index e1e8919..b53fc11 100644 --- a/engine/physics/RigidBody.h +++ b/engine/physics/RigidBody.h @@ -70,8 +70,6 @@ public: [[nodiscard]] CollisionPoint EPA(const Simplex &simplex, std::shared_ptr obj); void solveCollision(const CollisionPoint &collision); - void recalculateHitBox(bool useSimpleBox = true); - [[nodiscard]] Vec3D collisionNormal() const { return _collisionNormal; } [[nodiscard]] bool hasCollision() const { return _hasCollision; } [[nodiscard]] bool inCollision() const { return _inCollision; }