shits fucked
[carveJwlIkooP6JGAAIwe30JlM.git] / player_skate.h
1 #ifndef PLAYER_SKATE_H
2 #define PLAYER_SKATE_H
3
4 #include "player_api.h"
5
6 #define SKATE_CCD
7
8 struct player_skate
9 {
10 struct
11 {
12 enum skate_activity
13 {
14 k_skate_activity_air,
15 k_skate_activity_ground,
16 k_skate_activity_grind
17 }
18 activity,
19 activity_prev;
20
21 float /* steery,
22 steerx,
23 steery_s,
24 steerx_s, */
25 reverse,
26 slip;
27
28 int manual_direction;
29
30 /* tricks */
31 v3f flip_axis;
32 float flip_time,
33 flip_rate;
34
35 v3f trick_vel, /* measured in units of TAU/s */
36 trick_euler; /* measured in units of TAU */
37 float trick_time;
38
39 m3x3f velocity_bias,
40 velocity_bias_pstep;
41 v3f apex;
42 v3f up_dir;
43
44 v3f head_position;
45
46 int lift_frames;
47
48 v3f throw_v;
49 v3f cog_v, cog;
50
51 float grabbing;
52 v2f grab_mouse_delta;
53
54 int charging_jump, jump_dir;
55 float jump_charge;
56 double jump_time;
57
58 double start_push,
59 cur_push;
60
61 v3f prev_pos;
62 }
63 state,
64 state_gate_storage;
65
66 struct land_prediction
67 {
68 v3f log[50];
69 v3f n;
70 v3f apex;
71 u32 log_length;
72 float score,
73 land_dist;
74
75 enum prediction_type
76 {
77 k_prediction_none,
78 k_prediction_land,
79 k_prediction_grind
80 }
81 type;
82
83 u32 colour;
84 }
85 predictions[22];
86 u32 prediction_count;
87 float land_dist;
88 v3f land_normal;
89
90 /* animation */
91 struct skeleton_anim *anim_stand, *anim_highg, *anim_slide,
92 *anim_air,
93 *anim_push, *anim_push_reverse,
94 *anim_ollie, *anim_ollie_reverse,
95 *anim_grabs, *anim_stop;
96 v3f board_offset,
97 board_trick_residualv,
98 board_trick_residuald;
99 v4f board_rotation;
100
101 float blend_slide,
102 blend_z,
103 blend_x,
104 blend_fly,
105 blend_stand,
106 blend_push,
107 blend_jump,
108 blend_airdir;
109
110 float substep,
111 substep_delta;
112
113 v2f wobble;
114
115 float debug_normal_pressure;
116 u32 device_id_walk;
117 };
118
119 VG_STATIC void player__skate_bind ( player_instance *player );
120 VG_STATIC void player__skate_pre_update ( player_instance *player );
121 VG_STATIC void player__skate_update ( player_instance *player );
122 VG_STATIC void player__skate_post_update ( player_instance *player );
123 VG_STATIC void player__skate_im_gui ( player_instance *player );
124 VG_STATIC void player__skate_animate ( player_instance *player,
125 player_animation *anim );
126 VG_STATIC void player__skate_post_animate ( player_instance *player );
127 VG_STATIC void player__skate_reset ( player_instance *player,
128 struct respawn_point *rp );
129
130 VG_STATIC void player__skate_clear_mechanics( player_instance *player );
131 VG_STATIC void player__skate_reset_animator( player_instance *player );
132 VG_STATIC void player__approximate_best_trajectory( player_instance *player );
133 #endif /* PLAYER_SKATE_H */