Physics2D/ChipmunkRigidBody2D: Fix SetGeom
This commit is contained in:
parent
08eaf396ed
commit
8a32c748bb
|
|
@ -303,8 +303,8 @@ namespace Nz
|
||||||
|
|
||||||
if (cpBodyGetType(m_handle) == CP_BODY_TYPE_DYNAMIC)
|
if (cpBodyGetType(m_handle) == CP_BODY_TYPE_DYNAMIC)
|
||||||
{
|
{
|
||||||
cpBodySetMass(m_handle, mass);
|
cpBodySetMass(newHandle, mass);
|
||||||
cpBodySetMoment(m_handle, moment);
|
cpBodySetMoment(newHandle, moment);
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyBody();
|
DestroyBody();
|
||||||
|
|
@ -670,6 +670,8 @@ namespace Nz
|
||||||
|
|
||||||
void ChipmunkRigidBody2D::CopyBodyData(cpBody* from, cpBody* to)
|
void ChipmunkRigidBody2D::CopyBodyData(cpBody* from, cpBody* to)
|
||||||
{
|
{
|
||||||
|
cpBodySetType(to, cpBodyGetType(from));
|
||||||
|
|
||||||
cpBodySetCenterOfGravity(to, cpBodyGetCenterOfGravity(from));
|
cpBodySetCenterOfGravity(to, cpBodyGetCenterOfGravity(from));
|
||||||
|
|
||||||
cpBodySetAngle(to, cpBodyGetAngle(from));
|
cpBodySetAngle(to, cpBodyGetAngle(from));
|
||||||
|
|
@ -679,8 +681,6 @@ namespace Nz
|
||||||
cpBodySetTorque(to, cpBodyGetTorque(from));
|
cpBodySetTorque(to, cpBodyGetTorque(from));
|
||||||
cpBodySetVelocity(to, cpBodyGetVelocity(from));
|
cpBodySetVelocity(to, cpBodyGetVelocity(from));
|
||||||
|
|
||||||
cpBodySetType(to, cpBodyGetType(from));
|
|
||||||
|
|
||||||
to->velocity_func = from->velocity_func;
|
to->velocity_func = from->velocity_func;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue