Physics: Upgrade Newton to 3.13
Former-commit-id: 9e3777a39842ab18e103a75a590d8d58d25b10c5
This commit is contained in:
parent
ea920d2e64
commit
6557fedf47
|
|
@ -20,7 +20,7 @@
|
||||||
#include <Nazara/Physics/Enums.hpp>
|
#include <Nazara/Physics/Enums.hpp>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
struct NewtonCollision;
|
class NewtonCollision;
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
#include <Nazara/Physics/Config.hpp>
|
#include <Nazara/Physics/Config.hpp>
|
||||||
#include <Nazara/Physics/Geom.hpp>
|
#include <Nazara/Physics/Geom.hpp>
|
||||||
|
|
||||||
struct NewtonBody;
|
class NewtonBody;
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
#include <Nazara/Math/Vector3.hpp>
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
#include <Nazara/Physics/Config.hpp>
|
#include <Nazara/Physics/Config.hpp>
|
||||||
|
|
||||||
struct NewtonWorld;
|
class NewtonWorld;
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace Nz
|
||||||
PhysObject::~PhysObject()
|
PhysObject::~PhysObject()
|
||||||
{
|
{
|
||||||
if (m_body)
|
if (m_body)
|
||||||
NewtonDestroyBody(m_world->GetHandle(), m_body);
|
NewtonDestroyBody(m_body);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysObject::AddForce(const Vector3f& force, CoordSys coordSys)
|
void PhysObject::AddForce(const Vector3f& force, CoordSys coordSys)
|
||||||
|
|
@ -304,11 +304,13 @@ namespace Nz
|
||||||
Vector3f min, max;
|
Vector3f min, max;
|
||||||
NewtonBodyGetAABB(m_body, min, max);
|
NewtonBodyGetAABB(m_body, min, max);
|
||||||
|
|
||||||
NewtonWorldForEachBodyInAABBDo(m_world->GetHandle(), min, max, [](const NewtonBody* const body, void* const userData)
|
NewtonWorldForEachBodyInAABBDo(m_world->GetHandle(), min, max, [](const NewtonBody* const body, void* const userData) -> int
|
||||||
{
|
{
|
||||||
NazaraUnused(userData);
|
NazaraUnused(userData);
|
||||||
NewtonBodySetSleepState(body, 0);
|
NewtonBodySetSleepState(body, 0);
|
||||||
}, nullptr);
|
return 1;
|
||||||
|
},
|
||||||
|
nullptr);
|
||||||
}
|
}
|
||||||
/*for (std::set<PhysObjectListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
|
/*for (std::set<PhysObjectListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
|
||||||
(*it)->PhysObjectOnUpdate(this);*/
|
(*it)->PhysObjectOnUpdate(this);*/
|
||||||
|
|
@ -317,7 +319,7 @@ namespace Nz
|
||||||
PhysObject& PhysObject::operator=(PhysObject&& object)
|
PhysObject& PhysObject::operator=(PhysObject&& object)
|
||||||
{
|
{
|
||||||
if (m_body)
|
if (m_body)
|
||||||
NewtonDestroyBody(m_world->GetHandle(), m_body);
|
NewtonDestroyBody(m_body);
|
||||||
|
|
||||||
m_body = object.m_body;
|
m_body = object.m_body;
|
||||||
m_forceAccumulator = std::move(object.m_forceAccumulator);
|
m_forceAccumulator = std::move(object.m_forceAccumulator);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue