+#if 0
+ VG_STATIC int in_zone = 0;
+
+ int in_zone_this_time = 0;
+
+ for( int i=0; i<world.achievement_zones_count; i++ )
+ {
+ struct achievement_zone *zone = &world.achievement_zones[i];
+
+ v3f local;
+ m4x3_mulv( zone->inv_transform, pos, local );
+
+ if( (fabsf(local[0]) <= 1.0f) &&
+ (fabsf(local[1]) <= 1.0f) &&
+ (fabsf(local[2]) <= 1.0f) )
+ {
+ in_zone_this_time = 1;
+
+ if( !in_zone && zone->ptarget )
+ {
+ audio_lock();
+ audio_player_playclip( &zone->ptarget->player,
+ &zone->ptarget->temp_embedded_clip );
+ audio_unlock();
+ }
+
+ if( !zone->triggered )
+ {
+ steam_set_achievement( zone->name );
+ steam_store_achievements();
+ }
+
+ zone->triggered = 1;
+ }
+
+ vg_line_boxf_transformed( zone->transform, (boxf){{-1.0f,-1.0f,-1.0f},
+ { 1.0f, 1.0f, 1.0f}},
+ 0xff00ff00 );
+ }
+
+ in_zone = in_zone_this_time;
+#endif
+
+ sfd_update();
+}
+
+/*
+ * -----------------------------------------------------------------------------
+ * API implementation
+ * -----------------------------------------------------------------------------
+ */
+
+VG_STATIC void ray_world_get_tri( ray_hit *hit, v3f tri[3] )
+{
+ for( int i=0; i<3; i++ )
+ v3_copy( world.scene_geo->arrvertices[ hit->tri[i] ].co, tri[i] );
+}
+
+VG_STATIC int ray_world( v3f pos, v3f dir, ray_hit *hit )
+{
+ return scene_raycast( world.scene_geo, world.geo_bh, pos, dir, hit );
+}
+
+VG_STATIC int ray_hit_is_terrain( ray_hit *hit )
+{
+ u32 valid_start = 0,
+ valid_end = world.sm_terrain.vertex_count;
+
+ return (hit->tri[0] >= valid_start) &&
+ (hit->tri[0] < valid_end);
+}
+
+VG_STATIC int ray_hit_is_ramp( ray_hit *hit )
+{
+ u32 valid_start = world.sm_geo_std.vertex_start,
+ valid_end = world.sm_geo_vb.vertex_start;
+
+ return (hit->tri[0] >= valid_start) &&
+ (hit->tri[0] < valid_end);