im making a note here, huge success
[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_undefined,
17 k_skate_activity_grind_any,
18 k_skate_activity_grind_boardslide,
19 k_skate_activity_grind_noseslide,
20 k_skate_activity_grind_tailslide,
21 k_skate_activity_grind_back50,
22 k_skate_activity_grind_front50,
23 k_skate_activity_grind_5050
24 }
25 activity,
26 activity_prev;
27
28 float /* steery,
29 steerx,
30 steery_s,
31 steerx_s, */
32 reverse,
33 slip;
34
35 int manual_direction;
36
37 /* tricks */
38 v3f flip_axis;
39 float flip_time,
40 flip_rate;
41
42 v3f trick_vel, /* measured in units of TAU/s */
43 trick_euler; /* measured in units of TAU */
44 float trick_time;
45
46 #if 0
47 m3x3f velocity_bias,
48 velocity_bias_pstep;
49 v3f apex;
50 #endif
51
52 v3f up_dir;
53
54 v3f head_position;
55
56 int lift_frames;
57
58 v3f throw_v;
59 v3f cog_v, cog;
60
61 float grabbing;
62 v2f grab_mouse_delta;
63
64 int charging_jump, jump_dir;
65 float jump_charge;
66
67 double jump_time;
68 double start_push,
69 cur_push;
70
71 v3f prev_pos;
72
73 /* initial launch conditions */
74 double air_start;
75 v3f air_init_v,
76 air_init_co;
77 }
78 state,
79 state_gate_storage;
80
81
82 /* animation */
83 struct skeleton_anim *anim_stand, *anim_highg, *anim_slide,
84 *anim_air,
85 *anim_push, *anim_push_reverse,
86 *anim_ollie, *anim_ollie_reverse,
87 *anim_grabs, *anim_stop;
88 v3f
89 board_trick_residualv,
90 board_trick_residuald;
91
92 float blend_slide,
93 blend_z,
94 blend_x,
95 blend_fly,
96 blend_stand,
97 blend_push,
98 blend_jump,
99 blend_airdir;
100
101 v2f wobble;
102
103 /*
104 * Physics
105 * ----------------------------------------------------
106 */
107
108 float substep,
109 substep_delta;
110
111 struct land_prediction
112 {
113 v3f log[50];
114 v3f n;
115 v3f apex;
116 v3f v;
117
118 int log_length;
119 float score,
120 land_dist;
121
122 enum prediction_type
123 {
124 k_prediction_none,
125 k_prediction_land,
126 k_prediction_grind
127 }
128 type;
129
130 u32 colour;
131 }
132 predictions[22];
133 u32 prediction_count;
134 float land_dist;
135 v3f land_normal;
136
137 v3f surface_picture,
138 weight_distribution,
139 grind_vec,
140 grind_dir;
141
142 float grind_strength;
143
144 struct grind_limit
145 {
146 v3f ra, n;
147 float p;
148 }
149 limits[3];
150 u32 limit_count;
151 };
152
153 VG_STATIC void player__skate_bind ( player_instance *player );
154 VG_STATIC void player__skate_pre_update ( player_instance *player );
155 VG_STATIC void player__skate_update ( player_instance *player );
156 VG_STATIC void player__skate_post_update ( player_instance *player );
157 VG_STATIC void player__skate_im_gui ( player_instance *player );
158 VG_STATIC void player__skate_animate ( player_instance *player,
159 player_animation *anim );
160 VG_STATIC void player__skate_post_animate ( player_instance *player );
161 VG_STATIC void player__skate_reset ( player_instance *player,
162 struct respawn_point *rp );
163
164 VG_STATIC void player__skate_clear_mechanics( player_instance *player );
165 VG_STATIC void player__skate_reset_animator( player_instance *player );
166 VG_STATIC void player__approximate_best_trajectory( player_instance *player );
167 #endif /* PLAYER_SKATE_H */