reordering optimizeBroadPhase
This commit is contained in:
parent
a6ae7f02f0
commit
d42db622e7
|
|
@ -244,17 +244,18 @@ pub const PhysicsRuntime = struct {
|
||||||
physChar.deinit();
|
physChar.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.system.optimizeBroadPhase();
|
||||||
// self.system.update(0.01, .{}) catch {};
|
// self.system.update(0.01, .{}) catch {};
|
||||||
{
|
{
|
||||||
const interface = self.system.getBodyInterfaceMut();
|
const interface = self.system.getBodyInterfaceMut();
|
||||||
|
|
||||||
var iterator = self.idToEntity.keyIterator();
|
var iterator = self.idToEntity.keyIterator();
|
||||||
while (iterator.next()) |bodyId| {
|
while (iterator.next()) |bodyId| {
|
||||||
self.system.optimizeBroadPhase();
|
|
||||||
interface.removeAndDestroyBody(bodyId.*);
|
interface.removeAndDestroyBody(bodyId.*);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.system.optimizeBroadPhase();
|
||||||
{
|
{
|
||||||
var iterator = self.shapes.iterator();
|
var iterator = self.shapes.iterator();
|
||||||
while (iterator.next()) |n| {
|
while (iterator.next()) |n| {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue