#pragma once

#include "math/float_types.hpp"

namespace demo::world {

  using vec2i = vec<2, int>;

  struct platform {
    vec3 position;
    vec3 scale;
    bool touched;
  };

  struct level {
    platform * platforms;
    int platforms_length;
  };

  constexpr int lookup_table_dim = 256;

  struct platform_lookup {
    vec2i xz_offset;
    vec2i size;
    platform * table[lookup_table_dim * lookup_table_dim];
  };

  void table_build(const level& level);
  platform * table_lookup(float x, float z);
}
