misc
authorhgn <hgodden00@gmail.com>
Fri, 3 Nov 2023 00:27:22 +0000 (00:27 +0000)
committerhgn <hgodden00@gmail.com>
Fri, 3 Nov 2023 00:27:22 +0000 (00:27 +0000)
maps_src/mp_mtzero/main.mdl
player_walk.c
player_walk.h
world_routes.c

index fc5d8649064b1693319d2a6125ffc5ec4b5a85e1..2f159869e9c401d4986b8414ee011daa2e7354d2 100644 (file)
Binary files a/maps_src/mp_mtzero/main.mdl and b/maps_src/mp_mtzero/main.mdl differ
index 99dee8ee7186d27fd9927a02244da3ec61b17603..3645e2dbda6ec1e355fd96243dd06818c5e2a496 100644 (file)
@@ -791,10 +791,10 @@ static void player__walk_animate(void){
    {
       f32 head_yaw = localplayer.angles[0] + VG_PIf,
           y = vg_angle_diff( head_yaw, -walk_yaw ),
-          mp = VG_PIf / 4.0f,
-          p = vg_clampf( localplayer.angles[1], -mp, mp );
+          p = vg_clampf( localplayer.angles[1], 
+                           -k_sit_pitch_limit, k_sit_pitch_limit );
 
-      if( fabsf(y) > VG_PIf/1.7f ){
+      if( fabsf(y) > k_sit_yaw_limit ){
          y = 0.0f;
          p = 0.0f;
       }
@@ -1044,6 +1044,9 @@ static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){
    bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->run );
    bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->walk );
    bitpack_qf32( ctx, 16, 0.0f, 120.0f, &animator->walk_timer );
+   bitpack_qf32( ctx, 8, -k_sit_yaw_limit, k_sit_yaw_limit, &animator->yaw );
+   bitpack_qf32( ctx, 8, -k_sit_pitch_limit, k_sit_pitch_limit, 
+                  &animator->pitch );
 
    bitpack_bytes( ctx, 8, &animator->outro_type );
    if( animator->outro_type ){
index 80cf5a9918e581f6c867768d85a709e1125f1af9..48be2ac6118f296e4e3b4dcb2f2703eba41118f9 100644 (file)
@@ -81,7 +81,10 @@ static f32
    k_walk_accel            = 10.0f,
    k_walk_air_accel        = 7.0f,
    k_walk_friction         = 10.0f,
-   k_walk_step_height      = 0.2f;
+   k_walk_step_height      = 0.2f,
+
+   k_sit_yaw_limit         = VG_PIf/1.7f,
+   k_sit_pitch_limit       = VG_PIf/4.0f;
 
 static void player__walk_register(void){
    VG_VAR_F32( k_walkspeed,      flags=VG_VAR_CHEAT );
index 52c2c2aa76ad4afad3d10211fcca13afb1e99c5b..75ebae8af66a92afdc58d81eb1f6971d3ba89cb1 100644 (file)
 #include "shaders/scene_route.h"
 #include "shaders/routeui.h"
 
-#if 0
-static 
-void world_routes_local_set_record( world_instance *world, ent_route *route,
-                                    f64 lap_time )
-{
-   vg_success( "  NEW LAP TIME: %f\n", lap_time );
-
-   if( route->anon.official_track_id != 0xffffffff ){
-      double time_centiseconds = lap_time * 100.0;
-      if( time_centiseconds > (float)0xfffe )   /* skill issue */
-         return;
-
-      struct track_info *ti = &track_infos[ route->anon.official_track_id ];
-      highscore_record *record = &ti->record;
-      record->trackid  = route->anon.official_track_id;
-      record->datetime = time(NULL);
-      record->playerid = 0;
-      record->points   = 0;
-      record->time     = time_centiseconds;
-      ti->push = 1;
-      
-      if( ti->achievement_id ){
-         steam_set_achievement( ti->achievement_id );
-         steam_store_achievements();
-      }
-   }
-   else{
-      vg_warn( "There is no associated track for this record...\n" );
-   }
-}
-#endif
-
 static void world_routes_clear( world_instance *world )
 {
    for( u32 i=0; i<mdl_arrcount( &world->ent_route ); i++ ){
@@ -870,7 +838,6 @@ static void world_gen_routes_generate( u32 instance_id ){
    if( instance_id <= 1 /*world_loader.generate_point_cloud*/ ){
       f64 area = 0.0;
 
-#if VG_RELEASE
       area = world_routes_scatter_surface_points( world, pcbuf, 16.0f );
       world_routes_surface_grid( world, pcbuf );
 
@@ -881,7 +848,6 @@ static void world_gen_routes_generate( u32 instance_id ){
                                         2.0f, 50.0f, 128, 
                                         (v4f){0.2f,0.2f,0.2f,1.0f} );
       }
-#endif
 
       vg_info( "Distributed %u points over %fkm^2!\n", 
                 pcbuf->count, area/1e6f );