Skip to content

Commit

Permalink
Revert "Workaround for Gmod ConVars causing a crash"
Browse files Browse the repository at this point in the history
This reverts commit 1d4db16.
  • Loading branch information
RaphaelIT7 committed Dec 14, 2023
1 parent 17a5f97 commit d4da006
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 177 deletions.
2 changes: 1 addition & 1 deletion vphysics_jolt/cbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include "mathlib/vector.h"

// Tier1
#include "vjolt_convar.h" // Also includes tier1/tier1.h
#include "tier1/tier1.h"
#include "tier1/strtools.h"
#include "tier1/interface.h"
#ifndef GAME_L4D2_OR_NEWER
Expand Down
12 changes: 6 additions & 6 deletions vphysics_jolt/vjolt_collide_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ static constexpr float kCharacterPadding = 0.02f;
// Also in vjolt_collide.cpp, should unify or just remove entirely
static constexpr float kMaxConvexRadius = JPH::cDefaultConvexRadius;

static JoltConVar vjolt_trace_debug( "vjolt_trace_debug", "0", FCVAR_CHEAT );
static JoltConVar vjolt_trace_debug_castray( "vjolt_trace_debug_castray", "0", FCVAR_CHEAT );
static JoltConVar vjolt_trace_debug_collidepoint( "vjolt_trace_debug_collidepoint", "0", FCVAR_CHEAT );
static JoltConVar vjolt_trace_debug_castbox( "vjolt_trace_debug_castbox", "0", FCVAR_CHEAT );
static JoltConVar vjolt_trace_debug_collidebox( "vjolt_trace_debug_collidebox", "0", FCVAR_CHEAT );
static ConVar vjolt_trace_debug( "vjolt_trace_debug", "0", FCVAR_CHEAT );
static ConVar vjolt_trace_debug_castray( "vjolt_trace_debug_castray", "0", FCVAR_CHEAT );
static ConVar vjolt_trace_debug_collidepoint( "vjolt_trace_debug_collidepoint", "0", FCVAR_CHEAT );
static ConVar vjolt_trace_debug_castbox( "vjolt_trace_debug_castbox", "0", FCVAR_CHEAT );
static ConVar vjolt_trace_debug_collidebox( "vjolt_trace_debug_collidebox", "0", FCVAR_CHEAT );

// Josh: Enables a hack to make portals work. For some reason when we enable colliding with
// backfaces, the player gets easily stuck in all sorts of things!
// Slart and I have not been able to determine the root cause of this problem and have tried for a long time...
//
// Slart: Portal 2 probably passes in a bad winding order in the polyhedron or something, dunno if it affects Portal 1
static JoltConVar vjolt_trace_portal_hack( "vjolt_trace_portal_hack", "0", FCVAR_NONE );
static ConVar vjolt_trace_portal_hack( "vjolt_trace_portal_hack", "0", FCVAR_NONE );

//-------------------------------------------------------------------------------------------------
//
Expand Down
2 changes: 1 addition & 1 deletion vphysics_jolt/vjolt_constraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//-------------------------------------------------------------------------------------------------

static JoltConVar vjolt_ragdoll_hinge_optimization( "vjolt_ragdoll_hinge_optimization", "1", FCVAR_REPLICATED,
static ConVar vjolt_ragdoll_hinge_optimization( "vjolt_ragdoll_hinge_optimization", "1", FCVAR_REPLICATED,
"Optimizes ragdolls to use hinge constraints for joints with 1 degree of freedom. Additionally fixes legs going back on themselves. Currently breaks ragdolls of NPCs killed in a pose (they inherit the pose).");

//-------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion vphysics_jolt/vjolt_controller_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

//-------------------------------------------------------------------------------------------------

static JoltConVar vjolt_player_collision_tolerance( "vjolt_player_collision_tolerance", "0.05" );
static ConVar vjolt_player_collision_tolerance( "vjolt_player_collision_tolerance", "0.05" );

//-------------------------------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions vphysics_jolt/vjolt_controller_vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

//------------------------------------------------------------------------------------------------

static JoltConVar vjolt_vehicle_wheel_debug( "vjolt_vehicle_wheel_debug", "0", FCVAR_CHEAT );
static ConVar vjolt_vehicle_wheel_debug( "vjolt_vehicle_wheel_debug", "0", FCVAR_CHEAT );

static JoltConVar vjolt_vehicle_throttle_opposition_limit( "vjolt_vehicle_throttle_opposition_limit", "5", FCVAR_NONE,
static ConVar vjolt_vehicle_throttle_opposition_limit( "vjolt_vehicle_throttle_opposition_limit", "5", FCVAR_NONE,
"Below what speed should we be attempting to drive/climb with handbrake on to avoid falling down." );

//------------------------------------------------------------------------------------------------
Expand Down
87 changes: 0 additions & 87 deletions vphysics_jolt/vjolt_convar.cpp

This file was deleted.

72 changes: 0 additions & 72 deletions vphysics_jolt/vjolt_convar.h

This file was deleted.

2 changes: 1 addition & 1 deletion vphysics_jolt/vjolt_debugrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define JOLT_VERTEX_BUFFER_NAME "Jolt Debug Renderer Vertices"
#define JOLT_INDEX_BUFFER_NAME "Jolt Debug Renderer Indices"

static JoltConVar vjolt_debugrender( "vjolt_debugrender", "0", FCVAR_CHEAT );
static ConVar vjolt_debugrender( "vjolt_debugrender", "0", FCVAR_CHEAT );
#ifndef VJOLT_USE_PHYSICS_DEBUG_OVERLAY
static ConVar vjolt_debugrender_picture_in_picture( "vjolt_debugrender_picture_in_picture", "1" );
static ConVar vjolt_debugrender_clear_rt( "vjolt_debugrender_clear_rt", "1" );
Expand Down
8 changes: 4 additions & 4 deletions vphysics_jolt/vjolt_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ static constexpr uint kMaxBodyPairs = kMaxBodies;
// number then these contacts will be ignored and bodies will start interpenetrating / fall through the world.
static constexpr uint kMaxContactConstraints = kMaxBodies;

static JoltConVar vjolt_linearcast( "vjolt_linearcast", "1", FCVAR_NONE, "Whether bodies will be created with linear cast motion quality (only takes effect after map restart)." );
static JoltConVar vjolt_initial_simulation( "vjolt_initial_simulation", "0", FCVAR_NONE, "Whether to pre-settle physics objects on map load." );
static ConVar vjolt_linearcast( "vjolt_linearcast", "1", FCVAR_NONE, "Whether bodies will be created with linear cast motion quality (only takes effect after map restart)." );
static ConVar vjolt_initial_simulation( "vjolt_initial_simulation", "0", FCVAR_NONE, "Whether to pre-settle physics objects on map load." );

static JoltConVar vjolt_substeps_collision( "vjolt_substeps_collision", "1", FCVAR_NONE, "Number of collision steps to perform.", true, 0.0f, true, 4.0f );
static ConVar vjolt_substeps_collision( "vjolt_substeps_collision", "1", FCVAR_NONE, "Number of collision steps to perform.", true, 0.0f, true, 4.0f );

static JoltConVar vjolt_baumgarte_factor( "vjolt_baumgarte_factor", "0.2", FCVAR_NONE, "Baumgarte stabilization factor (how much of the position error to 'fix' in 1 update). Changing this may help with constraint stability. Requires a map restart to change.", true, 0.0f, true, 1.0f );
static ConVar vjolt_baumgarte_factor( "vjolt_baumgarte_factor", "0.2", FCVAR_NONE, "Baumgarte stabilization factor (how much of the position error to 'fix' in 1 update). Changing this may help with constraint stability. Requires a map restart to change.", true, 0.0f, true, 1.0f );

//-------------------------------------------------------------------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions vphysics_jolt/vphysics_jolt_inc.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ $Project "$PROJNAME"
$File "vjolt_controller_player.cpp"
$File "vjolt_controller_vehicle.cpp"
$File "vjolt_controller_shadow.cpp"
$File "vjolt_convar.cpp"
$File "vjolt_debugrender.cpp"
$File "vjolt_environment.cpp"
$File "vjolt_friction.cpp"
Expand Down Expand Up @@ -129,7 +128,6 @@ $Project "$PROJNAME"
$File "vjolt_controller_player.h"
$File "vjolt_controller_vehicle.h"
$File "vjolt_controller_shadow.h"
$File "vjolt_convar.h"
$File "vjolt_debugrender.h"
$File "vjolt_environment.h"
$File "vjolt_friction.h"
Expand Down

0 comments on commit d4da006

Please sign in to comment.