Physics/PhysObject: Added Copy/Move constructor/operator

Former-commit-id: 3cec9759476de4eb1adb470d436aa40698357c50
This commit is contained in:
Lynix
2015-04-19 23:20:13 +02:00
parent f7d6107ec7
commit 61c6baeabe
2 changed files with 63 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ class NAZARA_API NzPhysObject : NzNonCopyable
public:
NzPhysObject(NzPhysWorld* world, const NzMatrix4f& mat = NzMatrix4f::Identity());
NzPhysObject(NzPhysWorld* world, NzPhysGeomRef geom, const NzMatrix4f& mat = NzMatrix4f::Identity());
NzPhysObject(const NzPhysObject& object);
NzPhysObject(NzPhysObject&& object);
~NzPhysObject();
void AddForce(const NzVector3f& force, nzCoordSys coordSys = nzCoordSys_Global);
@@ -54,16 +56,19 @@ class NAZARA_API NzPhysObject : NzNonCopyable
void SetPosition(const NzVector3f& position);
void SetRotation(const NzQuaternionf& rotation);
NzPhysObject& operator=(NzPhysObject object);
NzPhysObject& operator=(NzPhysObject&& object);
private:
void UpdateBody();
static void ForceAndTorqueCallback(const NewtonBody* body, float timeStep, int threadIndex);
static void TransformCallback(const NewtonBody* body, const float* matrix, int threadIndex);
NzMatrix4f m_matrix;
NzPhysGeomRef m_geom;
NzVector3f m_forceAccumulator;
NzVector3f m_torqueAccumulator;
NewtonBody* m_body;
NzPhysGeomRef m_geom;
NzPhysWorld* m_world;
float m_gravityFactor;
float m_mass;