v3_muls( v, newspeed, v );
}
+VG_STATIC void player_walk_custom_filter( world_instance *world,
+ rb_ct *man, int len, f32 w ){
+ for( int i=0; i<len; i++ ){
+ rb_ct *ci = &man[i];
+ if( ci->type == k_contact_type_disabled ||
+ ci->type == k_contact_type_edge )
+ continue;
+
+
+ float d1 = v3_dot( ci->co, ci->n );
+
+ for( int j=0; j<len; j++ ){
+ if( j == i )
+ continue;
+
+ rb_ct *cj = &man[j];
+ if( cj->type == k_contact_type_disabled )
+ continue;
+
+ struct world_surface *si = world_contact_surface( world, ci ),
+ *sj = world_contact_surface( world, cj );
+
+ if( (sj->info.flags & k_material_flag_walking) &&
+ !(si->info.flags & k_material_flag_walking)){
+ continue;
+ }
+
+ float d2 = v3_dot( cj->co, ci->n ),
+ d = d2-d1;
+
+ if( fabsf( d ) <= w ){
+ cj->type = k_contact_type_disabled;
+ }
+ }
+ }
+}
+
VG_STATIC void player__walk_update( player_instance *player ){
struct player_walk *w = &player->_walk;
v3_copy( player->rb.co, w->state.prev_pos );
len = rb_capsule__scene( mtx, &w->collider, NULL,
&world->rb_geo.inf.scene, manifold );
- rb_manifold_filter_coplanar( manifold, len, 0.01f );
+ player_walk_custom_filter( world, manifold, len, 0.01f );
len = rb_manifold_apply_filtered( manifold, len );
v3f surface_avg = { 0.0f, 0.0f, 0.0f };
VG_STATIC void player__walk_transition( player_instance *player ){
struct player_walk *w = &player->_walk;
w->state.activity = k_walk_activity_air;
+ w->state.outro_type = k_walk_outro_none;
+ w->state.outro_start_time = 0.0;
+ w->state.jump_queued = 0;
+ w->state.jump_input_time = 0.0;
+ w->state.walk_timer = 0.0f;
+ w->state.step_phase = 0;
v3f fwd = { 0.0f, 0.0f, 1.0f };
q_mulv( player->rb.q, fwd, fwd );