paint: move ts to c

This commit is contained in:
luboslenco
2026-03-06 12:56:38 +01:00
parent 1adcc0f59a
commit 313378a923
396 changed files with 46606 additions and 45005 deletions
+36
View File
@@ -0,0 +1,36 @@
#ifdef arm_physics
physics_world_t *physics_world_create() {
asim_world_create();
physics_world_t *world = GC_ALLOC_INIT(physics_world_t, {0});
gc_unroot(physics_world_active);
physics_world_active = world;
gc_root(physics_world_active);
return world;
}
void physics_world_update(physics_world_t *world) {
asim_world_update(sys_delta());
i32_array_t *keys = imap_keys(physics_body_object_map);
for (i32 i = 0; i < keys->length; ++i) {
physics_body_t *body = any_imap_get(physics_body_object_map, keys->buffer[i]);
physics_body_update(body);
}
}
physics_pair_t_array_t *physics_world_get_contact_pairs(physics_world_t *world, physics_body_t *body) {
physics_pair_t_array_t *pairs = any_array_create_from_raw((any[]){}, 0);
physics_pair_t *p = asim_world_get_contact();
any_array_push(pairs, p);
return pairs;
}
void physics_world_destroy() {
if (physics_world_active != null) {
asim_world_destroy();
}
}
#endif