diff --git a/engine/Vec4D.cpp b/engine/Vec4D.cpp index b11321a..7d80487 100644 --- a/engine/Vec4D.cpp +++ b/engine/Vec4D.cpp @@ -57,7 +57,7 @@ Vec4D Vec4D::operator/(double number) const { // Other useful methods double Vec4D::sqrAbs() const { - return x() * x() + y() * y() + z() * z(); + return x() * x() + y() * y() + z() * z() + w() * w(); } double Vec4D::abs() const { diff --git a/engine/physics/RigidBody.cpp b/engine/physics/RigidBody.cpp index 0d1db28..01b12f1 100644 --- a/engine/physics/RigidBody.cpp +++ b/engine/physics/RigidBody.cpp @@ -18,7 +18,7 @@ RigidBody::RigidBody(ObjectNameTag nameTag, const std::string &filename, const V RigidBody::RigidBody(const Mesh &mesh, bool useSimpleBox) : Mesh(mesh), _hitBox(mesh, useSimpleBox) { } -void RigidBody::regenerateHitBox(bool useSimpleBox) { +void RigidBody::recalculateHitBox(bool useSimpleBox) { _hitBox = HitBox(*this, useSimpleBox); } diff --git a/engine/physics/RigidBody.h b/engine/physics/RigidBody.h index 98d02a3..e1e8919 100644 --- a/engine/physics/RigidBody.h +++ b/engine/physics/RigidBody.h @@ -70,7 +70,7 @@ public: [[nodiscard]] CollisionPoint EPA(const Simplex &simplex, std::shared_ptr obj); void solveCollision(const CollisionPoint &collision); - void regenerateHitBox(bool useSimpleBox = true); + void recalculateHitBox(bool useSimpleBox = true); [[nodiscard]] Vec3D collisionNormal() const { return _collisionNormal; } [[nodiscard]] bool hasCollision() const { return _hasCollision; }