Core: Add StackVector class
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Physics3D/PhysWorld3D.hpp>
|
||||
#include <Nazara/Core/StackArray.hpp>
|
||||
#include <Nazara/Core/StackVector.hpp>
|
||||
#include <Newton/Newton.h>
|
||||
#include <cassert>
|
||||
#include <Nazara/Physics3D/Debug.hpp>
|
||||
@@ -173,13 +173,9 @@ namespace Nz
|
||||
using ContactJoint = void*;
|
||||
|
||||
// Query all joints first, to prevent removing a joint from the list while iterating on it
|
||||
StackArray<ContactJoint> contacts = NazaraStackArray(ContactJoint, NewtonContactJointGetContactCount(contactJoint));
|
||||
std::size_t contactIndex = 0;
|
||||
StackVector<ContactJoint> contacts = NazaraStackVector(ContactJoint, NewtonContactJointGetContactCount(contactJoint));
|
||||
for (ContactJoint contact = NewtonContactJointGetFirstContact(contactJoint); contact; contact = NewtonContactJointGetNextContact(contactJoint, contact))
|
||||
{
|
||||
assert(contactIndex < contacts.size());
|
||||
contacts[contactIndex++] = contact;
|
||||
}
|
||||
contacts.push_back(contact);
|
||||
|
||||
for (ContactJoint contact : contacts)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user