{.path = "sound/step_concrete3.ogg" }
};
+audio_clip audio_footsteps_grass[] = {
+ {.path = "sound/step_bush0.ogg" },
+ {.path = "sound/step_bush1.ogg" },
+ {.path = "sound/step_bush2.ogg" },
+ {.path = "sound/step_bush3.ogg" },
+ {.path = "sound/step_bush4.ogg" },
+ {.path = "sound/step_bush5.ogg" }
+};
+
+audio_clip audio_footsteps_wood[] = {
+ {.path = "sound/step_wood0.ogg" },
+ {.path = "sound/step_wood1.ogg" },
+ {.path = "sound/step_wood2.ogg" },
+ {.path = "sound/step_wood3.ogg" },
+ {.path = "sound/step_wood4.ogg" },
+ {.path = "sound/step_wood5.ogg" }
+};
+
audio_clip audio_lands[] = {
{ .path = "sound/land0.ogg" },
{ .path = "sound/land1.ogg" },
audio_clip_loadn( audio_water, vg_list_size(audio_water), NULL );
audio_clip_loadn( audio_grass, vg_list_size(audio_grass), NULL );
audio_clip_loadn( audio_footsteps, vg_list_size(audio_footsteps), NULL );
+ audio_clip_loadn( audio_footsteps_grass,
+ vg_list_size(audio_footsteps_grass), NULL );
+ audio_clip_loadn( audio_footsteps_wood,
+ vg_list_size(audio_footsteps_wood), NULL );
audio_clip_loadn( audio_rewind, vg_list_size(audio_rewind), NULL );
audio_clip_loadn( audio_ui, vg_list_size(audio_ui), NULL );
{
d += contact.dist;
+#if 0
vg_line( origin, contact.pos, 0xff0000ff );
vg_line_pt3( contact.pos, 0.1f, 0xff0000ff );
if( lv )
vg_line( contact.pos, last, 0xffffffff );
+#endif
+
v3_copy( contact.pos, last );
lv = 1;
}
{
v3f p1;
v3_muladds( origin, dir, sample_dist, p1 );
+
+#if 0
vg_line( origin, p1, 0xffcccccc );
+#endif
d += sample_dist;
lv = 0;
* 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 output )
{
v3f chance = { (vg_randf()-0.5f) * 30.0f,
8.0f,
if( ray_world( pos, (v3f){0.0f,-1.0f,0.0f}, &contact ) )
{
- if( ray_hit_is_ramp( &contact ) )
+ struct world_material *mat = ray_hit_material( &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;
}
-
- 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;
+
+ if( world.water.enabled )
+ return k_audio_sprite_type_water;
+ else
+ return k_audio_sprite_type_none;
}
VG_STATIC void audio_debug_soundscapes(void)