+ u32 indices_head;
+ u32 vertex_head;
+
+ struct route_ui_segment
+ {
+ float length;
+ u32 vertex_start, vertex_count,
+ index_start, index_count, notches;
+ }
+ segments[k_max_ui_segments];
+
+ u32 segment_start, segment_count, fade_start, fade_count;
+ double fade_timer_start;
+ float xpos;
+ }
+ ui_bars[16];
+
+ v3f render_gate_pos;
+ int active_route_board;
+ int in_trigger;
+
+ /* This is a small flag we use to changelevel.
+ * It will not be cleared until all sounds stop playing
+ */
+ int switching_to_new_world;
+ char world_name[ 64 ];
+
+ /*
+ * Dynamically allocated when world_load is called.
+ *
+ * the following arrays index somewhere into this linear
+ * allocator
+ *
+ * (world_gen.h)
+ * --------------------------------------------------------------------------
+ */
+ void *dynamic_vgl,
+ *audio_vgl; /* sub buffer of the audio buffer */
+
+ /*
+ * Main world .mdl
+ */
+ mdl_context *meta;
+
+ /*
+ * Materials / textures
+ */
+
+ GLuint *textures;
+ u32 texture_count;
+
+ struct world_material
+ {
+ mdl_material info;
+ mdl_submesh sm_geo,
+ sm_no_collide;
+ }
+ * materials;
+ u32 material_count;
+
+ /*
+ * Named safe places to respawn
+ */
+ struct respawn_point
+ {
+ v3f co;
+ v4f q;
+ const char *name;
+ }
+ * spawns;
+ u32 spawn_count;
+
+ /*
+ * Audio player entities
+ */
+ struct world_audio_thing
+ {
+ v3f pos;
+ float volume;
+ u32 flags;
+
+ audio_player player;
+ audio_clip temp_embedded_clip;
+ }
+ * audio_things;
+ u32 audio_things_count;
+
+ /*
+ * Relays
+ */
+ struct logic_relay
+ {
+ v3f pos;
+
+ struct relay_target
+ {
+ u32 sub_id;
+ enum classtype classtype;
+ }
+ targets[4];
+ u32 target_count;
+ }
+ * logic_relays;
+ u32 relay_count;
+
+ /*
+ * Box trigger entities
+ */
+ struct trigger_zone
+ {
+ m4x3f transform, inv_transform;
+
+ struct relay_target target;
+ }
+ * triggers;
+ u32 trigger_count;
+
+ /*
+ * Achievements
+ */
+ struct logic_achievement
+ {
+ v3f pos;
+ const char *achievement_id;
+ u32 achieved;
+ }
+ * logic_achievements;
+ u32 achievement_count;
+
+
+ /*
+ * Routes (world_routes.h)
+ * --------------------------------------------------------------------------
+ */
+ struct route_node
+ {
+ v3f co, right, up, h;
+ u32 next[2];
+
+ u32 special_type, special_id, current_refs, ref_count;
+ u32 route_ids[4]; /* Gates can be linked into up to four routes */
+ }
+ *nodes;
+ u32 node_count;
+
+ struct route
+ {
+ u32 track_id;
+ v4f colour;
+
+ u32 start;
+ mdl_submesh sm;
+
+ int active;
+ float factive;
+
+ double best_lap, latest_pass; /* Session */
+
+ m4x3f scoreboard_transform;
+ }
+ *routes;
+ u32 route_count;
+
+ struct route_gate
+ {
+ struct teleport_gate
+ {
+ v3f co[2];
+ v4f q[2];
+ v2f dims;
+
+ m4x3f to_world, recv_to_world, transport;
+ }
+ gate;
+
+ u32 node_id;
+
+ struct route_timing
+ {
+ u32 version; /* Incremented on every teleport */
+ double time;
+ }
+ timing;
+ }
+ *gates;
+ u32 gate_count;
+
+ struct route_collector
+ {
+ struct route_timing timing;
+ }
+ *collectors;
+ u32 collector_count;
+
+
+ /* logic
+ * ----------------------------------------------------
+ */
+
+ u32 active_gate,
+ current_run_version;
+ double time, rewind_from, rewind_to, last_use;
+
+ /* world geometry */
+ scene *scene_geo,
+ *scene_no_collide,
+ *scene_lines;
+
+ struct grind_edge
+ {
+ v3f p0, p1;
+ }
+ *grind_edges;
+ u32 grind_edge_count;
+
+ /* spacial mappings */
+ bh_tree *audio_bh,
+ *trigger_bh,
+ *geo_bh,
+ *grind_bh;
+
+ /* graphics */
+ glmesh mesh_route_lines;
+
+ glmesh mesh_geo,
+ mesh_no_collide,
+ mesh_water;
+
+ mdl_submesh sm_foliage_main;
+ rigidbody rb_geo;