X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=common.h;h=19b5a6fa5d84130b030ec431864fb0a911270aaa;hb=0ca7f5ca2560908de1a03db112df67e52b476107;hp=5e2f48298dbdafcb43c784d532b87b799f3c794e;hpb=1030b1e134d422a3cbc1e06102053447da59ceba;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/common.h b/common.h index 5e2f482..19b5a6f 100644 --- a/common.h +++ b/common.h @@ -1,29 +1,33 @@ +/* + * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved + */ + #ifndef COMMON_H #define COMMON_H +#define VG_TIMESTEP_FIXED (1.0/60.0) #define VG_3D +#define VG_GAME +//#define VG_STATIC static +#define VG_STATIC #define VG_FRAMEBUFFER_RESIZE 1 #include "vg/vg.h" +#include "submodules/anyascii/impl/c/anyascii.c" -/* TODO: he needs a home somewhere */ -static float ktimestep = 1.0f/60.0f; +#define RESET_MAX_TIME 45.0 +VG_STATIC v3f TEMP_BOARD_0, TEMP_BOARD_1; -/* TODO: he needs a home somewhere */ -enum classtype +enum menu_controller_type { - k_classtype_none = 0, - k_classtype_gate = 1, - k_classtype_block = 2, - k_classtype_spawn = 3, - k_classtype_water = 4, - k_classtype_car_path = 5, - k_classtype_instance = 6, - k_classtype_capsule = 7, - k_classtype_route_node = 8, - k_classtype_route = 9 + k_menu_controller_type_keyboard, + k_menu_controller_type_xbox, + k_menu_controller_type_playstation, + k_menu_controller_type_steam, + k_menu_controller_type_steam_deck }; -/* TODO: he needs a home somewhere */ +VG_STATIC enum menu_controller_type menu_display_controller; + typedef struct ray_hit ray_hit; struct ray_hit { @@ -32,16 +36,145 @@ struct ray_hit v3f pos, normal; }; -/* TODO: he needs a home somewhere */ -static void eval_bezier_time( v3f p0, v3f p1, v3f h0, v3f h1, float t, v3f p ) +VG_STATIC float + k_friction_lat = 12.0f, + k_friction_resistance = 0.01f, + + k_max_push_speed = 16.0f, + k_push_accel = 10.0f, + k_push_cycle_rate = 8.0f, + + k_steer_ground = 2.5f, + k_steer_air = 3.6f, + + k_jump_charge_speed = (1.0f/1.0f), + k_jump_force = 5.0f, + + k_pitch_limit = 1.5f, + k_look_speed = 2.0f, + + k_cog_spring = 0.2f, + k_cog_damp = 0.02f, + k_cog_mass_ratio = 0.9f, + + k_mmthrow_scale = 6.0f, + k_mmcollect_lat = 2.0f, + k_mmcollect_vert = 0.0f, + k_mmdecay = 12.0f, + k_spring_angular = 1.0f, + + k_spring_force = 300.0f, + k_spring_dampener = 5.0f, + + k_grind_spring = 50.0f, + k_grind_aligment = 10.0f, + k_grind_dampener = 5.0f, + + k_surface_spring = 100.0f, + k_surface_dampener = 40.0f, + k_manul_spring = 200.0f, + k_manul_dampener = 30.0f, + k_board_interia = 8.0f, + + k_grind_decayxy = 30.0f, + k_grind_axel_min_vel = 3.0f, + k_grind_axel_max_angle = 0.95f, /* cosine(|a|) */ + k_grind_axel_max_vangle = 0.4f, + k_grind_max_friction = 3.0f, + k_grind_max_edge_angle = 0.97f, + + k_board_length = 0.45f, + k_board_width = 0.13f, + k_board_end_radius = 0.1f, + k_board_radius = 0.14f; /* 0.07 */ + +VG_STATIC float + k_walkspeed = 10.0f, + k_airspeed = 1.2f, + k_stopspeed = 4.0f, + k_walk_accel = 10.0f, + k_walk_air_accel = 7.0f, + k_walk_friction = 10.0f, + k_walk_step_height = 0.2f; + +VG_STATIC float + k_cam_punch = -0.1f, + k_cam_spring = 20.0f, + k_cam_damp = 6.7f; + +VG_STATIC float + k_day_length = 30.0f; /* minutes */ + +VG_STATIC float k_ragdoll_floatyiness = 20.0f, + k_ragdoll_floatydrag = 1.0f, + k_ragdoll_limit_scale = 1.0f; + +VG_STATIC int k_ragdoll_div = 1, + ragdoll_frame = 0, + k_ragdoll_debug_collider = 1, + k_ragdoll_debug_constraints = 0; + +VG_STATIC int k_debug_light_indices = 0, + k_debug_light_complexity = 0, + k_light_preview = 0; + +VG_STATIC int freecam = 0; +VG_STATIC int walk_grid_iterations = 1; +VG_STATIC float fc_speed = 10.0f; +VG_STATIC int cl_thirdperson = 0; + +VG_STATIC void common_var_temp(void) { - float tt = t*t, - ttt = tt*t; + VG_VAR_F32( k_day_length ); + + VG_VAR_F32( k_cam_punch ); + VG_VAR_F32( k_cam_damp ); + VG_VAR_F32( k_cam_spring ); + + VG_VAR_F32( k_grind_dampener ); + VG_VAR_F32( k_grind_spring ); + VG_VAR_F32( k_grind_aligment ); + VG_VAR_F32( k_surface_spring ); + VG_VAR_F32( k_surface_dampener ); + VG_VAR_F32( k_board_interia ); + VG_VAR_F32( k_grind_decayxy ); + VG_VAR_F32( k_grind_axel_min_vel ); + VG_VAR_F32( k_grind_axel_max_angle ); + VG_VAR_F32( k_grind_max_friction ); + + VG_VAR_F32( k_walkspeed ); + VG_VAR_F32( k_stopspeed ); + VG_VAR_F32( k_airspeed ); + VG_VAR_F32( k_walk_friction ); + VG_VAR_F32( k_walk_air_accel ); + VG_VAR_F32( k_walk_accel ); + + VG_VAR_I32( freecam ); + VG_VAR_I32( cl_thirdperson ); + VG_VAR_F32_PERSISTENT( fc_speed ); + + VG_VAR_F32( k_ragdoll_limit_scale ); + VG_VAR_I32( k_ragdoll_div ); + VG_VAR_I32( k_ragdoll_debug_collider ); + VG_VAR_I32( k_ragdoll_debug_constraints ); + VG_VAR_I32( k_debug_light_indices ); + VG_VAR_I32( k_debug_light_complexity ); + VG_VAR_I32( k_light_preview ); + + VG_VAR_F32( k_friction_lat ); + + VG_VAR_F32( k_cog_spring ); + VG_VAR_F32( k_cog_damp ); + VG_VAR_F32( k_cog_mass_ratio ); + + VG_VAR_F32( k_spring_force ); + VG_VAR_F32( k_spring_dampener ); + VG_VAR_F32( k_spring_angular ); - v3_muls( p1, ttt, p ); - v3_muladds( p, h1, 3.0f*tt -3.0f*ttt, p ); - v3_muladds( p, h0, 3.0f*ttt -6.0f*tt +3.0f*t, p ); - v3_muladds( p, p0, 3.0f*tt -ttt -3.0f*t +1.0f, p ); + VG_VAR_F32( k_mmthrow_scale ); + VG_VAR_F32( k_mmcollect_lat ); + VG_VAR_F32( k_mmcollect_vert ); + VG_VAR_F32( k_mmdecay ); } #endif /* COMMON_H */