X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_drive.c;h=230e7bdb0970c2ebc94242a211c024ca73327558;hb=HEAD;hp=1c83205e0f5529fc65014d03984a216ba2063040;hpb=3e59ac7081ea3005060b56449bc77c8f73cdc6b6;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_drive.c b/player_drive.c deleted file mode 100644 index 1c83205..0000000 --- a/player_drive.c +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef PLAYER_DRIVE_C -#define PLAYER_DRIVE_C - -#include "player.h" -#include "input.h" - -VG_STATIC void player__drive_pre_update( player_instance *player ) -{ - struct player_drive *drive = &player->_drive; - drivable_vehicle *vehc = drive->vehicle; - - v2f steer; - joystick_state( k_srjoystick_steer, steer ); - - vehc->steer = vg_lerpf( vehc->steer, steer[0] * 0.4f, k_rb_delta * 8.0f ); - vehc->drive = steer[1]; -} - -VG_STATIC void player__drive_update( player_instance *player ) -{ -} - -VG_STATIC void player__drive_post_update( player_instance *player ) -{ - struct player_drive *drive = &player->_drive; - v3_copy( drive->vehicle->obj.rb.co, player->rb.co ); - v3_copy( drive->vehicle->obj.rb.v, player->rb.v ); - v4_copy( drive->vehicle->obj.rb.q, player->rb.q ); - v3_copy( drive->vehicle->obj.rb.w, player->rb.w ); -} - -VG_STATIC void player__drive_animate( player_instance *player ){} - -VG_STATIC void player__drive_pose( player_instance *player, player_pose *pose ){ - struct player_drive *drive = &player->_drive; - struct skeleton *sk = &player->playeravatar->sk; - - skeleton_sample_anim( sk, drive->anim_drive, 0.0f, pose->keyframes ); - v3_copy( player->rb.co, pose->root_co ); - v4_copy( player->rb.q, pose->root_q ); -} - -VG_STATIC void player__drive_post_animate( player_instance *player ) -{ - if( player->cam_control.camera_mode == k_cam_firstperson ) - player->cam_velocity_influence = 0.0f; - else - player->cam_velocity_influence = 1.0f; - - rigidbody *rb = &gzoomer.obj.rb; - float yaw = atan2f( -rb->to_world[2][0], rb->to_world[2][2] ), - pitch = atan2f - ( - -rb->to_world[2][1], - sqrtf - ( - rb->to_world[2][0]*rb->to_world[2][0] + - rb->to_world[2][2]*rb->to_world[2][2] - ) - ); - - player->angles[0] = yaw; - player->angles[1] = pitch; -} - -VG_STATIC void player__drive_im_gui( player_instance *player ) -{ - player__debugtext( 1, "Nothing here" ); -} - -VG_STATIC void player__drive_bind( player_instance *player ) -{ - struct player_drive *drive = &player->_drive; - struct player_avatar *av = player->playeravatar; - struct skeleton *sk = &av->sk; - - drive->vehicle = &gzoomer; - drive->anim_drive = skeleton_get_anim( sk, "idle_cycle+y" ); -} - -VG_STATIC void player__drive_reset( player_instance *player, ent_spawn *rp ) -{ -} - -#endif /* PLAYER_DRIVE_C */