Demos big update

-Added some more math functions
-fixed many memory leaks
-added AABB and BVHTree support to collision.d
 *BVHTree has only incrementally adding entities implemented by now (and bad BottomUp algorithm)
 *ECS Systems use two trees, one for static and one for dynamic entities, dynamic BVH is builded every frame from scratch by now
-BrickBreaker now uses BVHTree to collision detection
 *balls only use tree for checks (they aren't adding to tree)
-fixed bug leading to crash
This commit is contained in:
Mergul 2020-07-17 13:38:41 +02:00
parent 96bbcb9956
commit 64dc099e0a
9 changed files with 973 additions and 70 deletions

View file

@ -72,7 +72,7 @@ struct Snake
bool move_system = true;
bool draw_system = true;
const int map_size = 18;
enum int map_size = 18;
MapElement[map_size * map_size] map;
@ -83,7 +83,7 @@ struct Snake
if(apple_tmpl)launcher.manager.freeTemplate(apple_tmpl);
if(snake_tmpl)launcher.manager.freeTemplate(snake_tmpl);
if(snake_destroy_particle)launcher.manager.freeTemplate(snake_destroy_particle);
texture.destory();
texture.destroy();
}
MapElement element(ivec2 pos)