X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_glide.h;h=cbb1fb58076f32e6c3c77cb7715369625aa173be;hb=refs%2Fheads%2Fmaster;hp=fdf34bcabb5f2a80ddb4fa2529ada3a8b1684c24;hpb=0d211bc488751a2cbc380990492ec549e91b19ca;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_glide.h b/player_glide.h deleted file mode 100644 index fdf34bc..0000000 --- a/player_glide.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef PLAYER_GLIDE_H -#define PLAYER_GLIDE_H - -#include "player.h" -#include "trail.h" - -struct player_glide { - struct skeleton_anim *anim_glide; - - struct player_glide_animator { - v3f root_co; - v4f root_q; - } - animator; - - /* this sucks */ - struct remote_glider_animator { - v3f root_co; - v4f root_q; - f32 s; - } - remote_animator; - - v3f info_lift, - info_slip, - info_drag; - - u32 ticker; - - rigidbody rb; - - f32 t; - - struct { - v3f co, euler; - m4x3f mdl; - - union { - rb_capsule inf; - f32 r; - }; - - enum rb_shape shape; - bool is_damage; - } - parts[4]; - - u32 trail_count; - v3f trail_positions[2]; - - mdl_context glider; - GLuint *glider_textures; - glmesh glider_mesh; -} -static player_glide = { - .parts = { - { - .co = { 1.0f, 0.5f, -1.0f }, - .euler = { VG_TAUf*0.25f, VG_TAUf*0.125f, 0.0f }, - .shape = k_rb_shape_capsule, - .inf = { .h = 2.82842712475f, .r = 0.25f }, - }, - { - .co = { -1.0f, 0.5f, -1.0f }, - .euler = { VG_TAUf*0.25f, -VG_TAUf*0.125f, 0.0f }, - .shape = k_rb_shape_capsule, - .inf = { .h = 2.82842712475f, .r = 0.25f }, - }, - { - .co = { 0.0f, 0.5f, 1.0f }, - .euler = { VG_TAUf*0.25f, VG_TAUf*0.25f, 0.0f }, - .shape = k_rb_shape_capsule, - .inf = { .h = 6.0f, .r = 0.25f }, - }, - { - .co = { 0.0f, -0.5f, 0.0f }, - .euler = { VG_TAUf*0.25f, VG_TAUf*0.25f, 0.0f }, - .shape = k_rb_shape_capsule, - .inf = { .h = 2.0f, .r = 0.25f }, - .is_damage = 1, - }, - -#if 0 - { - .co = { 0.0f, 0.0f, 0.0f }, - .euler = { 0.0f, 0.0f, 0.0f }, - .shape = k_rb_shape_sphere, - .r = 0.5f - } -#endif - } -}; - -static trail_system trails_glider[] = { -{ - .width = 0.035f, - .lifetime = 5.0f, - .min_dist = 0.5f -}, -{ - .width = 0.035f, - .lifetime = 5.0f, - .min_dist = 0.5f -}, -}; - -static void player_glide_pre_update(void); -static void player_glide_update(void); -static void player_glide_post_update(void); -static void player_glide_animate(void); -static void player_glide_pose( void *animator, player_pose *pose ); - -static void player_glide_post_animate(void); -static void player_glide_im_gui(void); -static void player_glide_bind(void); -static void player_glide_transition(void); -static bool glider_physics( v2f steer ); -static void player_glide_animator_exchange( bitpack_ctx *ctx, void *data ); -static void player_glide_render( camera *cam, world_instance *world, - player_pose *pose ); -static void render_glider_model( camera *cam, world_instance *world, - m4x3f mmdl, enum board_shader shader ); -static void -player_glide_remote_animator_exchange( bitpack_ctx *ctx, void *data ); - -struct player_subsystem_interface static player_subsystem_glide = { - .pre_update = player_glide_pre_update, - .update = player_glide_update, - .post_update = player_glide_post_update, - .animate = player_glide_animate, - .pose = player_glide_pose, - .post_animate = player_glide_post_animate, - .network_animator_exchange = player_glide_animator_exchange, - .im_gui = player_glide_im_gui, - .bind = player_glide_bind, - - .animator_data = &player_glide.animator, - .animator_size = sizeof(player_glide.animator), - .name = "Glide" -}; - -#endif /* PLAYER_GLIDE_H */