glider stuff
[carveJwlIkooP6JGAAIwe30JlM.git] / vehicle.h
1 #ifndef VEHICLE_H
2 #define VEHICLE_H
3
4 #include "skaterift.h"
5 #include "vg/vg_rigidbody.h"
6 #include "player.h"
7 #include "world.h"
8 #include "world_physics.h"
9
10 static float k_car_spring = 1.0f,
11 k_car_spring_damp = 0.001f,
12 k_car_spring_length = 0.5f,
13 k_car_wheel_radius = 0.2f,
14 k_car_friction_lat = 0.6f,
15 k_car_friction_roll = 0.01f,
16 k_car_drive_force = 1.0f,
17 k_car_air_resistance = 0.1f,
18 k_car_downforce = 0.5f;
19
20 typedef struct drivable_vehicle drivable_vehicle;
21 struct drivable_vehicle
22 {
23 int alive, inside;
24 rigidbody rb;
25
26 v3f wheels[4];
27
28 float tangent_mass[4][2],
29 normal_forces[4],
30 tangent_forces[4][2];
31
32 float steer, drive;
33 v3f steerv;
34
35 v3f tangent_vectors[4][2];
36 v3f wheels_local[4];
37 }
38 static gzoomer =
39 {
40 .rb.co = {-2000,-2000,-2000}
41 };
42
43 static int spawn_car( int argc, const char *argv[] );
44 static void vehicle_init(void);
45 static void vehicle_wheel_force( int index );
46 static void vehicle_solve_friction(void);
47 static void vehicle_update_fixed(void);
48 static void vehicle_update_post(void);
49
50 #endif /* VEHICLE_H */