157ef4069842d0d8bdd34af8ad1dc233a559a44c
7 VG_STATIC
void player__drive_pre_update( player_instance
*player
)
9 struct player_drive
*drive
= &player
->_drive
;
10 drivable_vehicle
*vehc
= drive
->vehicle
;
13 joystick_state( k_srjoystick_steer
, steer
);
15 vehc
->steer
= vg_lerpf( vehc
->steer
, steer
[0] * 0.4f
, k_rb_delta
* 8.0f
);
16 vehc
->drive
= steer
[1];
19 VG_STATIC
void player__drive_update( player_instance
*player
)
23 VG_STATIC
void player__drive_post_update( player_instance
*player
)
25 struct player_drive
*drive
= &player
->_drive
;
26 v3_copy( drive
->vehicle
->obj
.rb
.co
, player
->rb
.co
);
27 v3_copy( drive
->vehicle
->obj
.rb
.v
, player
->rb
.v
);
28 v4_copy( drive
->vehicle
->obj
.rb
.q
, player
->rb
.q
);
29 v3_copy( drive
->vehicle
->obj
.rb
.w
, player
->rb
.w
);
32 VG_STATIC
void player__drive_animate( player_instance
*player
){}
34 VG_STATIC
void player__drive_pose( player_instance
*player
){
35 struct player_drive
*drive
= &player
->_drive
;
36 struct skeleton
*sk
= &player
->playeravatar
->sk
;
37 player_pose
*pose
= &player
->pose
;
39 skeleton_sample_anim( sk
, drive
->anim_drive
, 0.0f
, pose
->keyframes
);
40 v3_copy( player
->rb
.co
, pose
->root_co
);
41 v4_copy( player
->rb
.q
, pose
->root_q
);
44 VG_STATIC
void player__drive_post_animate( player_instance
*player
)
46 if( player
->cam_control
.camera_mode
== k_cam_firstperson
)
47 player
->cam_velocity_influence
= 0.0f
;
49 player
->cam_velocity_influence
= 1.0f
;
51 rigidbody
*rb
= &gzoomer
.obj
.rb
;
52 float yaw
= atan2f( -rb
->to_world
[2][0], rb
->to_world
[2][2] ),
58 rb
->to_world
[2][0]*rb
->to_world
[2][0] +
59 rb
->to_world
[2][2]*rb
->to_world
[2][2]
63 player
->angles
[0] = yaw
;
64 player
->angles
[1] = pitch
;
67 VG_STATIC
void player__drive_im_gui( player_instance
*player
)
69 player__debugtext( 1, "Nothing here" );
72 VG_STATIC
void player__drive_bind( player_instance
*player
)
74 struct player_drive
*drive
= &player
->_drive
;
75 struct player_avatar
*av
= player
->playeravatar
;
76 struct skeleton
*sk
= &av
->sk
;
78 drive
->vehicle
= &gzoomer
;
79 drive
->anim_drive
= skeleton_get_anim( sk
, "idle_cycle+y" );
82 VG_STATIC
void player__drive_reset( player_instance
*player
, ent_spawn
*rp
)
86 #endif /* PLAYER_DRIVE_C */