aboutsummaryrefslogtreecommitdiff
path: root/src/phys
diff options
context:
space:
mode:
Diffstat (limited to 'src/phys')
-rw-r--r--src/phys/world.odin11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/phys/world.odin b/src/phys/world.odin
index 189f0b0..15e7826 100644
--- a/src/phys/world.odin
+++ b/src/phys/world.odin
@@ -110,6 +110,17 @@ _get_body :: proc(h: Body_Handle, location := #caller_location) -> ^Body {
return &world.bodies[h.idx]
}
+iterate_bodies :: proc(it: ^int) -> (Body_Handle, bool) {
+ for it^ < len(world.bodies) {
+ if world.bodies[it^].handle.uses > 0 {
+ it^ += 1
+ return world.bodies[it^ - 1].handle, true
+ }
+ it^ += 1
+ }
+ return {}, false
+}
+
add_body :: proc(b: Body) -> Body_Handle {
handle: Body_Handle