projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grind phys
[carveJwlIkooP6JGAAIwe30JlM.git]
/
player_animation.h
diff --git
a/player_animation.h
b/player_animation.h
index 9d2c801fd7309340fded8d2aef52dc4f739568ed..b9e28de2b5ad10398acc75fc666fba18fb1efdcb 100644
(file)
--- a/
player_animation.h
+++ b/
player_animation.h
@@
-336,15
+336,21
@@
VG_STATIC void player_animate_camera(void)
/* Look angles */
v3_lerp( phys->vl, phys->rb.v, 0.05f, phys->vl );
/* Look angles */
v3_lerp( phys->vl, phys->rb.v, 0.05f, phys->vl );
+ player.fgrind = vg_lerpf( player.fgrind, phys->grind, vg.time_delta );
+
float yaw = atan2f( phys->vl[0], -phys->vl[2] ),
float yaw = atan2f( phys->vl[0], -phys->vl[2] ),
- pitch = atan2f( -phys->vl[1],
- sqrtf(
- phys->vl[0]*phys->vl[0] + phys->vl[2]*phys->vl[2]
- )) * 0.7f;
+ pitch = atan2f
+ (
+ -phys->vl[1],
+ sqrtf
+ (
+ phys->vl[0]*phys->vl[0] + phys->vl[2]*phys->vl[2]
+ )
+ )
+ * 0.7f + vg_lerpf( 0.30f, 0.90f, player.fgrind );
player.angles[0] = yaw;
player.angles[0] = yaw;
- player.angles[1] = vg_lerpf( player.angles[1], pitch + 0.30f,
- player.fonboard );
+ player.angles[1] = vg_lerpf( player.angles[1], pitch, player.fonboard );
/* Camera shake */
static v2f shake_damp = {0.0f,0.0f};
/* Camera shake */
static v2f shake_damp = {0.0f,0.0f};
@@
-383,7
+389,7
@@
VG_STATIC void player_animate_camera(void)
m4x3_mulv( mtx, player.mdl.cam_pos, cam_pos );
v3_add( cam_pos, forward_dir, player.camera_pos );
m4x3_mulv( mtx, player.mdl.cam_pos, cam_pos );
v3_add( cam_pos, forward_dir, player.camera_pos );
- v3_lerp( phys->vl, phys->rb.v,
0.3f
, phys->vl );
+ v3_lerp( phys->vl, phys->rb.v,
18.0f*vg.time_delta
, phys->vl );
}
}
}
}