-/*
- * Trace out a random point, near the player to try and determine water areas
- */
-VG_STATIC enum audio_sprite_type audio_sample_sprite_random( v3f origin,
- v3f output )
-{
- v3f chance = { (vg_randf()-0.5f) * 30.0f,
- 8.0f,
- (vg_randf()-0.5f) * 30.0f };
-
- v3f pos;
- v3_add( chance, origin, pos );
-
- ray_hit contact;
- contact.dist = vg_minf( 16.0f, pos[1] );
-
- world_instance *world = get_active_world();
-
- if( ray_world( world, pos, (v3f){0.0f,-1.0f,0.0f}, &contact ) ){
- struct world_surface *mat = ray_hit_surface( world, &contact );
-
- if( mat->info.surface_prop == k_surface_prop_grass){
- v3_copy( contact.pos, output );
- return k_audio_sprite_type_grass;
- }
- else{
-#if 0
- vg_line( pos, contact.pos, 0xff0000ff );
- vg_line_pt3( contact.pos, 0.3f, 0xff0000ff );
-#endif
- return k_audio_sprite_type_none;
- }
- }
-
- output[0] = pos[0];
- output[1] = 0.0f;
- output[2] = pos[2];
-
- float dist = fabsf(output[1] - origin[1]);
-
- if( world->water.enabled && dist<=40.0f )
- return k_audio_sprite_type_water;
- else
- return k_audio_sprite_type_none;
-}
-
-VG_STATIC void audio_ambient_sprite_play( v3f co, audio_clip *clip )