Physics3D/RigidBody3D: Fix copy constructor not copying all states

This commit is contained in:
Lynix 2017-12-10 12:10:47 +01:00
parent 0df70dcb16
commit b8e447e4fe
2 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,7 @@ Nazara Engine:
- Add linear and angular damping accessor to RigidBody3D - Add linear and angular damping accessor to RigidBody3D
- Fix MemoryStream::WriteBlock "Invalid buffer" assertion triggering when writing a zero-sized block - Fix MemoryStream::WriteBlock "Invalid buffer" assertion triggering when writing a zero-sized block
- ⚠️ Rename RigidBody3D::[Get|Set]Velocity to [Get|Set]LinearVelocity - ⚠️ Rename RigidBody3D::[Get|Set]Velocity to [Get|Set]LinearVelocity
- Fix RigidBody3D copy constructor not copying all physics states (angular/linear damping/velocity, mass center, position and rotation)
Nazara Development Kit: Nazara Development Kit:
- Added ImageWidget (#139) - Added ImageWidget (#139)

View File

@ -47,7 +47,15 @@ namespace Nz
m_body = NewtonCreateDynamicBody(m_world->GetHandle(), m_geom->GetHandle(m_world), m_matrix); m_body = NewtonCreateDynamicBody(m_world->GetHandle(), m_geom->GetHandle(m_world), m_matrix);
NewtonBodySetUserData(m_body, this); NewtonBodySetUserData(m_body, this);
SetMass(object.m_mass); SetMass(object.m_mass);
SetAngularDamping(object.GetAngularDamping());
SetAngularVelocity(object.GetAngularVelocity());
SetLinearDamping(object.GetLinearDamping());
SetLinearVelocity(object.GetLinearVelocity());
SetMassCenter(object.GetMassCenter());
SetPosition(object.GetPosition());
SetRotation(object.GetRotation());
} }
RigidBody3D::RigidBody3D(RigidBody3D&& object) : RigidBody3D::RigidBody3D(RigidBody3D&& object) :