Physics2D/ChipmunkRigidBody2D: Fix SetGeom

This commit is contained in:
Lynix 2023-12-28 17:47:15 +01:00
parent 08eaf396ed
commit 8a32c748bb
1 changed files with 4 additions and 4 deletions

View File

@ -303,8 +303,8 @@ namespace Nz
if (cpBodyGetType(m_handle) == CP_BODY_TYPE_DYNAMIC)
{
cpBodySetMass(m_handle, mass);
cpBodySetMoment(m_handle, moment);
cpBodySetMass(newHandle, mass);
cpBodySetMoment(newHandle, moment);
}
DestroyBody();
@ -670,6 +670,8 @@ namespace Nz
void ChipmunkRigidBody2D::CopyBodyData(cpBody* from, cpBody* to)
{
cpBodySetType(to, cpBodyGetType(from));
cpBodySetCenterOfGravity(to, cpBodyGetCenterOfGravity(from));
cpBodySetAngle(to, cpBodyGetAngle(from));
@ -679,8 +681,6 @@ namespace Nz
cpBodySetTorque(to, cpBodyGetTorque(from));
cpBodySetVelocity(to, cpBodyGetVelocity(from));
cpBodySetType(to, cpBodyGetType(from));
to->velocity_func = from->velocity_func;
}