From 67a9dc692ae7875eecff659df030f25c999babb2 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 19 Sep 2015 14:44:41 +0200 Subject: [PATCH] Physics/Geom: Fix NullGeom InertialMatrix Former-commit-id: ac5e0c6cd9f775c29e37a4bb5a072eee2b224d0f --- include/Nazara/Physics/Geom.hpp | 2 ++ src/Nazara/Physics/Geom.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/Nazara/Physics/Geom.hpp b/include/Nazara/Physics/Geom.hpp index ba3500513..511b7019d 100644 --- a/include/Nazara/Physics/Geom.hpp +++ b/include/Nazara/Physics/Geom.hpp @@ -218,6 +218,8 @@ class NAZARA_PHYSICS_API NzNullGeom : public NzPhysGeom public: NzNullGeom(); + void ComputeInertialMatrix(NzVector3f* inertia, NzVector3f* center) const; + nzGeomType GetType() const override; template static NzNullGeomRef New(Args&&... args); diff --git a/src/Nazara/Physics/Geom.cpp b/src/Nazara/Physics/Geom.cpp index 5fcf4e8bf..e2676a0df 100644 --- a/src/Nazara/Physics/Geom.cpp +++ b/src/Nazara/Physics/Geom.cpp @@ -379,6 +379,15 @@ nzGeomType NzNullGeom::GetType() const return nzGeomType_Null; } +void NzNullGeom::ComputeInertialMatrix(NzVector3f* inertia, NzVector3f* center) const +{ + if (inertia) + inertia->MakeUnit(); + + if (center) + center->MakeZero(); +} + NewtonCollision* NzNullGeom::CreateHandle(NzPhysWorld* world) const { return NewtonCreateNull(world->GetHandle());