Merge remote-tracking branch 'refs/remotes/origin/master' into enet_wip_nothing_to_see_here
This commit is contained in:
commit
0393eb408b
|
|
@ -142,13 +142,15 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Wait until any registered socket switches to a ready state
|
* \brief Wait until any registered socket switches to a ready state.
|
||||||
*
|
*
|
||||||
* Waits a specific/undetermined amount of time until at least one socket part of the SocketPoller becomes ready.
|
* Waits a specific/undetermined amount of time until at least one socket part of the SocketPoller becomes ready.
|
||||||
* To query the ready state of the registered socket, use the IsReady function.
|
* To query the ready state of the registered socket, use the IsReady function.
|
||||||
*
|
*
|
||||||
* \param msTimeout Maximum time to wait in milliseconds, 0 for infinity
|
* \param msTimeout Maximum time to wait in milliseconds, 0 for infinity
|
||||||
*
|
*
|
||||||
|
* \return True if at least one socket registered to the poller is ready.
|
||||||
|
*
|
||||||
* \remark It is an error to try to unregister a non-registered socket from a SocketPoller.
|
* \remark It is an error to try to unregister a non-registered socket from a SocketPoller.
|
||||||
*
|
*
|
||||||
* \see IsReady
|
* \see IsReady
|
||||||
|
|
|
||||||
|
|
@ -244,24 +244,27 @@ namespace Nz
|
||||||
if (m_mass > 0.f)
|
if (m_mass > 0.f)
|
||||||
{
|
{
|
||||||
if (mass > 0.f)
|
if (mass > 0.f)
|
||||||
|
{
|
||||||
|
m_world->RegisterPostStep(this, [this, mass]()
|
||||||
{
|
{
|
||||||
cpBodySetMass(m_handle, mass);
|
cpBodySetMass(m_handle, mass);
|
||||||
cpBodySetMoment(m_handle, m_geom->ComputeInertialMatrix(m_mass));
|
cpBodySetMoment(m_handle, m_geom->ComputeInertialMatrix(m_mass));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_world->RegisterPostStep(this, [this]() { cpBodySetType(m_handle, CP_BODY_TYPE_STATIC); } );
|
m_world->RegisterPostStep(this, [this]() { cpBodySetType(m_handle, CP_BODY_TYPE_STATIC); } );
|
||||||
}
|
}
|
||||||
else if (mass > 0.f)
|
else if (mass > 0.f)
|
||||||
{
|
|
||||||
if (cpBodyGetType(m_handle) == CP_BODY_TYPE_STATIC)
|
|
||||||
{
|
{
|
||||||
m_world->RegisterPostStep(this, [this, mass]()
|
m_world->RegisterPostStep(this, [this, mass]()
|
||||||
|
{
|
||||||
|
if (cpBodyGetType(m_handle) == CP_BODY_TYPE_STATIC)
|
||||||
{
|
{
|
||||||
cpBodySetType(m_handle, CP_BODY_TYPE_DYNAMIC);
|
cpBodySetType(m_handle, CP_BODY_TYPE_DYNAMIC);
|
||||||
cpBodySetMass(m_handle, mass);
|
cpBodySetMass(m_handle, mass);
|
||||||
cpBodySetMoment(m_handle, m_geom->ComputeInertialMatrix(m_mass));
|
cpBodySetMoment(m_handle, m_geom->ComputeInertialMatrix(m_mass));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mass = mass;
|
m_mass = mass;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue