1c082121026d50934fc01958a9739e35588c99cf
6 VG_STATIC
void player__drive_pre_update( player_instance
*player
)
8 struct player_drive
*drive
= &player
->_drive
;
9 drivable_vehicle
*vehc
= drive
->vehicle
;
11 vehc
->steer
= vg_lerpf( vehc
->steer
,
12 player
->input_walkh
->axis
.value
* 0.4f
,
14 vehc
->drive
= player
->input_walkv
->axis
.value
;
17 VG_STATIC
void player__drive_update( player_instance
*player
)
21 VG_STATIC
void player__drive_post_update( player_instance
*player
)
23 struct player_drive
*drive
= &player
->_drive
;
24 v3_copy( drive
->vehicle
->obj
.rb
.co
, player
->rb
.co
);
25 v3_copy( drive
->vehicle
->obj
.rb
.v
, player
->rb
.v
);
26 v4_copy( drive
->vehicle
->obj
.rb
.q
, player
->rb
.q
);
27 v3_copy( drive
->vehicle
->obj
.rb
.w
, player
->rb
.w
);
30 VG_STATIC
void player__drive_animate( player_instance
*player
,
31 player_animation
*dest
)
33 struct player_drive
*drive
= &player
->_drive
;
34 struct skeleton
*sk
= &player
->playeravatar
->sk
;
35 skeleton_sample_anim( sk
, drive
->anim_drive
, 0.0f
, dest
->pose
);
36 v3_copy( player
->rb
.co
, dest
->root_co
);
37 v4_copy( player
->rb
.q
, dest
->root_q
);
40 VG_STATIC
void player__drive_post_animate( player_instance
*player
)
42 if( player
->camera_mode
== k_cam_firstperson
)
43 player
->cam_velocity_influence
= 0.0f
;
45 player
->cam_velocity_influence
= 1.0f
;
47 rigidbody
*rb
= &gzoomer
.obj
.rb
;
48 float yaw
= atan2f( -rb
->to_world
[2][0], rb
->to_world
[2][2] ),
54 rb
->to_world
[2][0]*rb
->to_world
[2][0] +
55 rb
->to_world
[2][2]*rb
->to_world
[2][2]
59 player
->angles
[0] = yaw
;
60 player
->angles
[1] = pitch
;
63 VG_STATIC
void player__drive_im_gui( player_instance
*player
)
65 player__debugtext( 1, "Nothing here" );
68 VG_STATIC
void player__drive_bind( player_instance
*player
)
70 struct player_drive
*drive
= &player
->_drive
;
71 struct player_avatar
*av
= player
->playeravatar
;
72 struct skeleton
*sk
= &av
->sk
;
74 drive
->vehicle
= &gzoomer
;
75 drive
->anim_drive
= skeleton_get_anim( sk
, "idle_cycle+y" );
78 VG_STATIC
void player__drive_reset( player_instance
*player
, ent_spawn
*rp
)
82 #endif /* PLAYER_DRIVE_C */