#include "utils.h" #include "assets.h" #include "entity.h" // This file is likely completely change. #ifndef WORLD_H #define WORLD_H // Max entities per node. #define BVH_MAX 4 #define WORLD_ENTITY_MAX 1000 #define WORLD_SIZE (Vector3){1000.0, 100.0, 1000.0} #define WORLD_IMAGE_WIDTH 100 #define WORLD_IMAGE_HEIGHT 100 #define WORLD_IMAGE_SCALE 5.0 // UID for anything in the world.x typedef int16_t WorldUID; typedef struct BVHNode { BoundingBox box; WorldUID entities[BVH_MAX]; struct BVHNode* branch1; struct BVHNode* branch2; } BVHNode; typedef struct { Vector3 size; Texture texture; Model heightmap; Entity entities[WORLD_ENTITY_MAX]; BVHNode bvh; BVHNode bvhTest[250]; } World; World createWorld(int seed); void updateWorld(World* world, Game* game); void freeWorld(World world); // Dam, I wanta live in a free world ): float getWorldHeightAtLocation(World world, float x, float y); #endif