small refactoring
parent
874df60941
commit
2b39c00b6c
|
@ -57,7 +57,7 @@ Vec4D Vec4D::operator/(double number) const {
|
||||||
|
|
||||||
// Other useful methods
|
// Other useful methods
|
||||||
double Vec4D::sqrAbs() const {
|
double Vec4D::sqrAbs() const {
|
||||||
return x() * x() + y() * y() + z() * z();
|
return x() * x() + y() * y() + z() * z() + w() * w();
|
||||||
}
|
}
|
||||||
|
|
||||||
double Vec4D::abs() const {
|
double Vec4D::abs() const {
|
||||||
|
|
|
@ -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) {
|
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);
|
_hitBox = HitBox(*this, useSimpleBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
[[nodiscard]] CollisionPoint EPA(const Simplex &simplex, std::shared_ptr<RigidBody> obj);
|
[[nodiscard]] CollisionPoint EPA(const Simplex &simplex, std::shared_ptr<RigidBody> obj);
|
||||||
void solveCollision(const CollisionPoint &collision);
|
void solveCollision(const CollisionPoint &collision);
|
||||||
|
|
||||||
void regenerateHitBox(bool useSimpleBox = true);
|
void recalculateHitBox(bool useSimpleBox = true);
|
||||||
|
|
||||||
[[nodiscard]] Vec3D collisionNormal() const { return _collisionNormal; }
|
[[nodiscard]] Vec3D collisionNormal() const { return _collisionNormal; }
|
||||||
[[nodiscard]] bool hasCollision() const { return _hasCollision; }
|
[[nodiscard]] bool hasCollision() const { return _hasCollision; }
|
||||||
|
|
Loading…
Reference in New Issue