projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bugs
[carveJwlIkooP6JGAAIwe30JlM.git]
/
player.h
diff --git
a/player.h
b/player.h
index 2c6ee19ef51b94e21e9df556a6ce0bb6a51f2d4c..82381c27b84e14fbb0f706c62dc151e7f06fa04e 100644
(file)
--- a/
player.h
+++ b/
player.h
@@
-12,8
+12,8
@@
#include "bvh.h"
static float
#include "bvh.h"
static float
- k_walkspeed =
7
.0f, /* no longer used */
- k_runspeed =
14
.0f,
+ k_walkspeed =
20
.0f, /* no longer used */
+ k_runspeed =
20
.0f,
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,
@@
-27,11
+27,12
@@
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_look_speed = 2.0f,
k_jump_charge_speed = (1.0f/1.0f),
k_jump_force = 5.0f,
k_pitch_limit = 1.5f,
k_look_speed = 2.0f,
- k_walk_accel =
5
.0f,
+ k_walk_accel =
150
.0f,
k_walk_friction = 8.0f;
static int freecam = 0;
k_walk_friction = 8.0f;
static int freecam = 0;
@@
-69,7
+70,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];
@@
-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,
@@
-232,9
+239,10
@@
static void player_update_pre(void)
{
struct player_phys *phys = &player.phys;
{
struct player_phys *phys = &player.phys;
- if( vg_get_
axis("grabl")>0.0f
)
+ if( vg_get_
button_down( "reset" )
)
{
player.is_dead = 0;
{
player.is_dead = 0;
+ player.death_tick_allowance = 30;
player_restore_frame();
if( !phys->on_board )
player_restore_frame();
if( !phys->on_board )
@@
-252,11
+260,19
@@
static void player_update_pre(void)
if( vg_get_button_down( "switchmode" ) )
{
phys->on_board ^= 0x1;
if( vg_get_button_down( "switchmode" ) )
{
phys->on_board ^= 0x1;
+
+ if( phys->on_board )
+ {
+ v3_muladds( phys->rb.v, phys->rb.forward, 0.2f, phys->rb.v );
+ }
}
}
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 )
@@
-334,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)