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