projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
menu stuff
[carveJwlIkooP6JGAAIwe30JlM.git]
/
player.h
diff --git
a/player.h
b/player.h
index 25054e03f38db5040af9c9437364e99d9a4adc71..c9502a32493d780a6504663af4423c78a3a38d63 100644
(file)
--- a/
player.h
+++ b/
player.h
@@
-17,7
+17,8
@@
static float
k_board_radius = 0.3f,
k_board_length = 0.45f,
k_board_allowance = 0.04f,
k_board_radius = 0.3f,
k_board_length = 0.45f,
k_board_allowance = 0.04f,
- k_friction_lat = 8.8f,
+ //k_friction_lat = 8.8f,
+ k_friction_lat = 12.0f,
k_friction_resistance = 0.01f,
k_max_push_speed = 16.0f,
k_push_accel = 10.0f,
k_friction_resistance = 0.01f,
k_max_push_speed = 16.0f,
k_push_accel = 10.0f,
@@
-27,6
+28,7
@@
static float
k_steer_air_lerp = 0.3f,
k_pump_force = 0.0f,
k_downforce = 5.0f,
k_steer_air_lerp = 0.3f,
k_pump_force = 0.0f,
k_downforce = 5.0f,
+ k_walk_downforce = 8.0f,
k_jump_charge_speed = (1.0f/1.0f),
k_jump_force = 5.0f,
k_pitch_limit = 1.5f,
k_jump_charge_speed = (1.0f/1.0f),
k_jump_force = 5.0f,
k_pitch_limit = 1.5f,
@@
-69,7
+71,10
@@
static struct gplayer
phys,
phys_gate_frame;
phys,
phys_gate_frame;
- int is_dead;
+ m4x3f visual_transform,
+ inv_visual_transform;
+
+ int is_dead, death_tick_allowance;
v3f land_target;
v3f land_target_log[22];
v3f land_target;
v3f land_target_log[22];
@@
-84,7
+89,6
@@
static struct gplayer
v3f camera_pos, smooth_localcam;
v2f angles;
v3f camera_pos, smooth_localcam;
v2f angles;
- m4x3f camera, camera_inverse;
/* animation */
double jump_time;
/* animation */
double jump_time;
@@
-97,8
+101,10
@@
static struct gplayer
fsetup,
walk_timer,
fjump,
fsetup,
walk_timer,
fjump,
- fonboard;
+ fonboard,
+ frun;
+ float walk;
int step_phase;
/* player model */
int step_phase;
/* player model */
@@
-113,7
+119,8
@@
static struct gplayer
*anim_push, *anim_push_reverse,
*anim_ollie, *anim_ollie_reverse,
*anim_grabs, *anim_stop,
*anim_push, *anim_push_reverse,
*anim_ollie, *anim_ollie_reverse,
*anim_grabs, *anim_stop,
- *anim_walk, *anim_run, *anim_idle;
+ *anim_walk, *anim_run, *anim_idle,
+ *anim_jump;
u32 id_hip,
id_ik_hand_l,
u32 id_hip,
id_ik_hand_l,
@@
-235,6
+242,7
@@
static void player_update_pre(void)
if( vg_get_button_down( "reset" ) )
{
player.is_dead = 0;
if( vg_get_button_down( "reset" ) )
{
player.is_dead = 0;
+ player.death_tick_allowance = 30;
player_restore_frame();
if( !phys->on_board )
player_restore_frame();
if( !phys->on_board )
@@
-262,6
+270,9
@@
static void player_update_pre(void)
static void player_update_fixed(void) /* 2 */
{
static void player_update_fixed(void) /* 2 */
{
+ if( player.death_tick_allowance )
+ player.death_tick_allowance --;
+
struct player_phys *phys = &player.phys;
if( player.is_dead )
struct player_phys *phys = &player.phys;
if( player.is_dead )
@@
-272,11
+283,6
@@
static void player_update_fixed(void) /* 2 */
{
player_do_motion();
}
{
player_do_motion();
}
-
- player_audio(); /* FUTURE: can probably move this to post()
- BUT, it uses deltas from fixed step physics,
- AND this *might* be what we want for realtime
- audio, anyway. */
}
static void player_update_post(void)
}
static void player_update_post(void)
@@
-303,10
+309,15
@@
static void player_update_post(void)
if( freecam )
player_freecam();
if( freecam )
player_freecam();
- player_camera_update();
+ /* CAMERA POSITIONING: LAYER 0 */
+ v2_copy( player.angles, camera_angles );
+ v3_copy( player.camera_pos, camera_pos );
+ camera_update();
+
+ player_audio();
}
}
-static void draw_player(
void) /* 3 */
+static void draw_player(
m4x3f cam )
{
if( player.is_dead )
player_model_copy_ragdoll();
{
if( player.is_dead )
player_model_copy_ragdoll();
@@
-314,7
+325,7
@@
static void draw_player(void) /* 3 */
shader_viewchar_use();
vg_tex2d_bind( &tex_characters, 0 );
shader_viewchar_uTexMain( 0 );
shader_viewchar_use();
vg_tex2d_bind( &tex_characters, 0 );
shader_viewchar_uTexMain( 0 );
- shader_viewchar_uCamera(
player.camera
[3] );
+ shader_viewchar_uCamera(
cam
[3] );
shader_viewchar_uPv( vg.pv );
shader_link_standard_ub( _shader_viewchar.id, 2 );
glUniformMatrix4x3fv( _uniform_viewchar_uTransforms,
shader_viewchar_uPv( vg.pv );
shader_link_standard_ub( _shader_viewchar.id, 2 );
glUniformMatrix4x3fv( _uniform_viewchar_uTransforms,
@@
-339,8
+350,11
@@
static float *player_get_pos(void)
static void player_kill(void)
{
static void player_kill(void)
{
- player.is_dead = 1;
- player_ragdoll_copy_model( player.phys.rb.v );
+ if( player.death_tick_allowance == 0 )
+ {
+ player.is_dead = 1;
+ player_ragdoll_copy_model( player.phys.rb.v );
+ }
}
static float *player_cam_pos(void)
}
static float *player_cam_pos(void)