7 static void player__drive_pre_update(void){
8 drivable_vehicle
*vehc
= player_drive
.vehicle
;
11 joystick_state( k_srjoystick_steer
, steer
);
13 vehc
->steer
= vg_lerpf( vehc
->steer
, steer
[0] * 0.4f
, k_rb_delta
* 8.0f
);
14 vehc
->drive
= steer
[1];
17 static void player__drive_update(void){}
19 static void player__drive_post_update(void){
20 v3_copy( player_drive
.vehicle
->obj
.rb
.co
,localplayer
.rb
.co
);
21 v3_copy( player_drive
.vehicle
->obj
.rb
.v
, localplayer
.rb
.v
);
22 v4_copy( player_drive
.vehicle
->obj
.rb
.q
, localplayer
.rb
.q
);
23 v3_copy( player_drive
.vehicle
->obj
.rb
.w
, localplayer
.rb
.w
);
26 static void player__drive_animate(void){}
28 static void player__drive_pose( void *animator
, player_pose
*pose
){
29 struct skeleton
*sk
= &localplayer
.skeleton
;
31 skeleton_sample_anim( sk
, player_drive
.anim_drive
, 0.0f
, pose
->keyframes
);
32 v3_copy( localplayer
.rb
.co
, pose
->root_co
);
33 v4_copy( localplayer
.rb
.q
, pose
->root_q
);
36 static void player__drive_post_animate(void){
37 if( localplayer
.cam_control
.camera_mode
== k_cam_firstperson
)
38 localplayer
.cam_velocity_influence
= 0.0f
;
40 localplayer
.cam_velocity_influence
= 1.0f
;
42 rigidbody
*rb
= &gzoomer
.obj
.rb
;
43 float yaw
= atan2f( -rb
->to_world
[2][0], rb
->to_world
[2][2] ),
49 rb
->to_world
[2][0]*rb
->to_world
[2][0] +
50 rb
->to_world
[2][2]*rb
->to_world
[2][2]
54 localplayer
.angles
[0] = yaw
;
55 localplayer
.angles
[1] = pitch
;
58 static void player__drive_im_gui(void){
59 player__debugtext( 1, "Nothing here" );
62 static void player__drive_bind(void){
63 struct skeleton
*sk
= &localplayer
.skeleton
;
64 player_drive
.vehicle
= &gzoomer
;
65 player_drive
.anim_drive
= skeleton_get_anim( sk
, "idle_cycle+y" );
68 static void player__drive_reset( ent_spawn
*rp
){
71 #endif /* PLAYER_DRIVE_C */