Physics/Geom: Fix NullGeom InertialMatrix

Former-commit-id: ac5e0c6cd9f775c29e37a4bb5a072eee2b224d0f
This commit is contained in:
Lynix 2015-09-19 14:44:41 +02:00
parent bef0736295
commit 67a9dc692a
2 changed files with 11 additions and 0 deletions

View File

@ -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<typename... Args> static NzNullGeomRef New(Args&&... args);

View File

@ -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());