+enum audio_sprite_type
+{
+ k_audio_sprite_type_none,
+ k_audio_sprite_type_grass,
+ k_audio_sprite_type_water
+};
+
+/*
+ * Trace out a random point, near the player to try and determine water areas
+ */
+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] );
+
+
+ if( ray_world( pos, (v3f){0.0f,-1.0f,0.0f}, &contact ) )
+ {
+ if( ray_hit_is_ramp( &contact ) )
+ {
+ vg_line( pos, contact.pos, 0xff0000ff );
+ vg_line_pt3( contact.pos, 0.3f, 0xff0000ff );
+ return k_audio_sprite_type_none;
+ }
+
+ v3_copy( contact.pos, output );
+ return k_audio_sprite_type_grass;
+ }
+
+ output[0] = pos[0];
+ output[1] = 0.0f;
+ output[2] = pos[2];
+
+ return k_audio_sprite_type_water;
+}
+