Physics/Geom: Improved Geom class
Renamed BaseGeom to PhysGeom, made it a reference-counted class Former-commit-id: 5b3a2921addb537c2744346edc9c74eafb3260b0
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
#include <Nazara/Math/Matrix4.hpp>
|
||||
#include <Nazara/Math/Quaternion.hpp>
|
||||
#include <Nazara/Math/Vector3.hpp>
|
||||
#include <Nazara/Physics/Geom.hpp>
|
||||
|
||||
class NzBaseGeom;
|
||||
class NzPhysWorld;
|
||||
struct NewtonBody;
|
||||
|
||||
@@ -22,7 +22,7 @@ class NAZARA_API NzPhysObject : NzNonCopyable
|
||||
{
|
||||
public:
|
||||
NzPhysObject(NzPhysWorld* world, const NzMatrix4f& mat = NzMatrix4f::Identity());
|
||||
NzPhysObject(NzPhysWorld* world, const NzBaseGeom* geom, const NzMatrix4f& mat = NzMatrix4f::Identity());
|
||||
NzPhysObject(NzPhysWorld* world, NzPhysGeomRef geom, const NzMatrix4f& mat = NzMatrix4f::Identity());
|
||||
~NzPhysObject();
|
||||
|
||||
void AddForce(const NzVector3f& force, nzCoordSys coordSys = nzCoordSys_Global);
|
||||
@@ -31,7 +31,9 @@ class NAZARA_API NzPhysObject : NzNonCopyable
|
||||
|
||||
void EnableAutoSleep(bool autoSleep);
|
||||
|
||||
NzBoxf GetAABB() const;
|
||||
NzVector3f GetAngularVelocity() const;
|
||||
const NzPhysGeomRef& GetGeom() const;
|
||||
float GetGravityFactor() const;
|
||||
NewtonBody* GetHandle() const;
|
||||
float GetMass() const;
|
||||
@@ -45,6 +47,7 @@ class NAZARA_API NzPhysObject : NzNonCopyable
|
||||
bool IsMoveable() const;
|
||||
bool IsSleeping() const;
|
||||
|
||||
void SetGeom(NzPhysGeomRef geom);
|
||||
void SetGravityFactor(float gravityFactor);
|
||||
void SetMass(float mass);
|
||||
void SetMassCenter(const NzVector3f& center);
|
||||
@@ -60,9 +63,8 @@ class NAZARA_API NzPhysObject : NzNonCopyable
|
||||
NzVector3f m_forceAccumulator;
|
||||
NzVector3f m_torqueAccumulator;
|
||||
NewtonBody* m_body;
|
||||
const NzBaseGeom* m_geom;
|
||||
NzPhysGeomRef m_geom;
|
||||
NzPhysWorld* m_world;
|
||||
bool m_ownsGeom;
|
||||
float m_gravityFactor;
|
||||
float m_mass;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user