projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed drop in jitter
[carveJwlIkooP6JGAAIwe30JlM.git]
/
player_walk.c
diff --git
a/player_walk.c
b/player_walk.c
index 45c2d0ae1e4c72a57ff0a04643650c91b3044c83..b37095da28ded733db41f629dfad1a3d2a61cf45 100644
(file)
--- a/
player_walk.c
+++ b/
player_walk.c
@@
-88,7
+88,7
@@
VG_STATIC void player_walk_drop_in_to_skate( player_instance *player )
v3_muladds( player->rb.co, player->rb.to_world[1], 1.0f, s->state.cog );
v3_copy( init_velocity, s->state.cog_v );
v3_copy( init_velocity, player->rb.v );
v3_muladds( player->rb.co, player->rb.to_world[1], 1.0f, s->state.cog );
v3_copy( init_velocity, s->state.cog_v );
v3_copy( init_velocity, player->rb.v );
- v3_copy( init_velocity, player->cam_velocity_smooth );
+ v3_copy( init_velocity, player->cam_
control.cam_
velocity_smooth );
v3_copy( (v3f){1.0f,0.0f,0.0f}, s->state.trick_euler );
}
v3_copy( (v3f){1.0f,0.0f,0.0f}, s->state.trick_euler );
}
@@
-147,7
+147,7
@@
VG_STATIC int player_walk_scan_for_drop_in( player_instance *player )
if( ray_world( world, pos, ray_dir, ray ) )
{
vg_line( pos, ray->pos, VG__RED );
if( ray_world( world, pos, ray_dir, ray ) )
{
vg_line( pos, ray->pos, VG__RED );
- vg_line_p
t3
( ray->pos, 0.025f, VG__BLACK );
+ vg_line_p
oint
( ray->pos, 0.025f, VG__BLACK );
sample_count ++;
}
sample_count ++;
}
@@
-225,7
+225,7
@@
VG_STATIC int player_walk_scan_for_drop_in( player_instance *player )
if( ray_world( world, va, v0, &ray ) )
{
vg_line( va, vb, VG__RED );
if( ray_world( world, va, v0, &ray ) )
{
vg_line( va, vb, VG__RED );
- vg_line_p
t3
( ray.pos, 0.1f, VG__RED );
+ vg_line_p
oint
( ray.pos, 0.1f, VG__RED );
vg_error( "invalidated\n" );
return 0;
}
vg_error( "invalidated\n" );
return 0;
}
@@
-234,7
+234,7
@@
VG_STATIC int player_walk_scan_for_drop_in( player_instance *player )
if( ray_world( world, vb, v0, &ray ) )
{
vg_line( va, vb, VG__RED );
if( ray_world( world, vb, v0, &ray ) )
{
vg_line( va, vb, VG__RED );
- vg_line_p
t3
( ray.pos, 0.1f, VG__RED );
+ vg_line_p
oint
( ray.pos, 0.1f, VG__RED );
vg_error( "invalidated\n" );
return 0;
}
vg_error( "invalidated\n" );
return 0;
}
@@
-392,7
+392,7
@@
VG_STATIC void player__walk_update( player_instance *player )
m3x3_copy( player->rb.to_world, mtx );
v3_add( player->rb.co, player->basis[1], mtx[3] );
m3x3_copy( player->rb.to_world, mtx );
v3_add( player->rb.co, player->basis[1], mtx[3] );
-
debug
_capsule( mtx, w->collider.radius, w->collider.height, VG__WHITE );
+
vg_line
_capsule( mtx, w->collider.radius, w->collider.height, VG__WHITE );
rb_ct manifold[64];
int len;
rb_ct manifold[64];
int len;
@@
-457,7
+457,7
@@
VG_STATIC void player__walk_update( player_instance *player )
v3_normalize( surface_avg );
v3f tx, ty;
v3_normalize( surface_avg );
v3f tx, ty;
-
rb
_tangent_basis( surface_avg, tx, ty );
+
v3
_tangent_basis( surface_avg, tx, ty );
if( v2_length2(steer) > 0.001f ){
/* clip movement to the surface */
if( v2_length2(steer) > 0.001f ){
/* clip movement to the surface */
@@
-559,7
+559,7
@@
VG_STATIC void player__walk_update( player_instance *player )
v3_muladds( player->rb.co, player->rb.v, k_rb_delta, player->rb.co );
v3_add( player->rb.co, player->basis[1], mtx[3] );
v3_muladds( player->rb.co, player->rb.v, k_rb_delta, player->rb.co );
v3_add( player->rb.co, player->basis[1], mtx[3] );
-
debug
_capsule( mtx, w->collider.radius, w->collider.height, VG__GREEN );
+
vg_line
_capsule( mtx, w->collider.radius, w->collider.height, VG__GREEN );
/*
* CCD routine
/*
* CCD routine
@@
-588,7
+588,7
@@
VG_STATIC void player__walk_update( player_instance *player )
rb_update_transform( &player->rb );
v3_add( player->rb.co, player->basis[1], mtx[3] );
rb_update_transform( &player->rb );
v3_add( player->rb.co, player->basis[1], mtx[3] );
-
debug
_capsule( mtx, w->collider.radius, w->collider.height, VG__RED );
+
vg_line
_capsule( mtx, w->collider.radius, w->collider.height, VG__RED );
}
}
}
}
@@
-626,7
+626,7
@@
VG_STATIC void player__walk_post_update( player_instance *player )
float substep = vg.time_fixed_extrapolate;
v3_muladds( mtx[3], player->rb.v, k_rb_delta*substep, mtx[3] );
float substep = vg.time_fixed_extrapolate;
v3_muladds( mtx[3], player->rb.v, k_rb_delta*substep, mtx[3] );
-
debug
_capsule( mtx, w->collider.radius, w->collider.height, VG__YELOW );
+
vg_line
_capsule( mtx, w->collider.radius, w->collider.height, VG__YELOW );
/* Calculate header */
/* Calculate header */
@@
-642,7
+642,7
@@
VG_STATIC void player__walk_post_update( player_instance *player )
q_normalize( player->rb.q );
}
q_normalize( player->rb.q );
}
- vg_line_p
t3
( w->state.drop_in_target, 0.1f, VG__GREEN );
+ vg_line_p
oint
( w->state.drop_in_target, 0.1f, VG__GREEN );
v3f p1;
v3_muladds( w->state.drop_in_target, w->state.drop_in_normal, 0.3f, p1 );
vg_line( w->state.drop_in_target, p1, VG__GREEN );
v3f p1;
v3_muladds( w->state.drop_in_target, w->state.drop_in_normal, 0.3f, p1 );
vg_line( w->state.drop_in_target, p1, VG__GREEN );
@@
-650,7
+650,7
@@
VG_STATIC void player__walk_post_update( player_instance *player )
vg_line( w->state.drop_in_target, p1, VG__GREEN );
vg_line( w->state.drop_in_target, w->state.drop_in_foot_anchor, VG__WHITE );
vg_line( w->state.drop_in_target, p1, VG__GREEN );
vg_line( w->state.drop_in_target, w->state.drop_in_foot_anchor, VG__WHITE );
- vg_line_p
t3
( w->state.drop_in_foot_anchor, 0.08f, VG__PINK );
+ vg_line_p
oint
( w->state.drop_in_foot_anchor, 0.08f, VG__PINK );
float a = player_get_heading_yaw( player );
float a = player_get_heading_yaw( player );
@@
-751,7
+751,12
@@
VG_STATIC void player__walk_animate( player_instance *player,
skeleton_lerp_pose( sk, apose, bpose, w->blend_fly, apose );
/* Create transform */
skeleton_lerp_pose( sk, apose, bpose, w->blend_fly, apose );
/* Create transform */
- rb_extrapolate( &player->rb, dest->root_co, dest->root_q );
+ if( !player->immobile )
+ rb_extrapolate( &player->rb, dest->root_co, dest->root_q );
+ else{
+ v3_copy( player->rb.co, dest->root_co );
+ v4_copy( player->rb.q, dest->root_q );
+ }
float walk_yaw = player_get_heading_yaw( player );
float walk_yaw = player_get_heading_yaw( player );