Browse Source

revert me after

physx
nillerusr 1 year ago
parent
commit
ee6a6d0b37
  1. 6
      game/server/ai_basenpc.cpp
  2. 6
      game/shared/physics_shared.cpp
  3. 2
      game/shared/physics_shared.h
  4. 2
      game/shared/ragdoll_shared.cpp

6
game/server/ai_basenpc.cpp

@ -6586,7 +6586,7 @@ void CAI_BaseNPC::SetupVPhysicsHull()
#endif #endif
IPhysicsShadowController *pController = pPhysObj->GetShadowController(); IPhysicsShadowController *pController = pPhysObj->GetShadowController();
float avgsize = (WorldAlignSize().x + WorldAlignSize().y) * 0.5; float avgsize = (WorldAlignSize().x + WorldAlignSize().y) * 0.5;
pController->SetTeleportDistance( avgsize * 0.5 ); //pController->SetTeleportDistance( avgsize * 0.5 );
m_bCheckContacts = true; m_bCheckContacts = true;
} }
} }
@ -6598,6 +6598,8 @@ void CAI_BaseNPC::SetupVPhysicsHull()
ConVar ai_auto_contact_solver( "ai_auto_contact_solver", "1" ); ConVar ai_auto_contact_solver( "ai_auto_contact_solver", "1" );
void CAI_BaseNPC::CheckPhysicsContacts() void CAI_BaseNPC::CheckPhysicsContacts()
{ {
return;
if ( gpGlobals->frametime <= 0.0f || !ai_auto_contact_solver.GetBool() ) if ( gpGlobals->frametime <= 0.0f || !ai_auto_contact_solver.GetBool() )
return; return;
@ -6616,6 +6618,8 @@ void CAI_BaseNPC::CheckPhysicsContacts()
while ( pSnapshot->IsValid() ) while ( pSnapshot->IsValid() )
{ {
IPhysicsObject *pOther = pSnapshot->GetObject(1); IPhysicsObject *pOther = pSnapshot->GetObject(1);
if( !pOther )
continue;
pOtherEntity = static_cast<CBaseEntity *>(pOther->GetGameData()); pOtherEntity = static_cast<CBaseEntity *>(pOther->GetGameData());
if ( pOtherEntity && pGroundEntity != pOtherEntity ) if ( pOtherEntity && pGroundEntity != pOtherEntity )

6
game/shared/physics_shared.cpp

@ -603,7 +603,7 @@ IPhysicsObject *PhysCreateWorld_Shared( CBaseEntity *pWorld, vcollide_t *pWorldC
pWorldCollide->solids[0], surfaceData, vec3_origin, vec3_angle, &params ); pWorldCollide->solids[0], surfaceData, vec3_origin, vec3_angle, &params );
// hint - saves vphysics some work // hint - saves vphysics some work
pWorldPhysics->SetCallbackFlags( pWorldPhysics->GetCallbackFlags() | CALLBACK_NEVER_DELETED ); //pWorldPhysics->SetCallbackFlags( pWorldPhysics->GetCallbackFlags() | CALLBACK_NEVER_DELETED );
//PhysCheckAdd( world, "World" ); //PhysCheckAdd( world, "World" );
// walk the world keys in case there are some fluid volumes to create // walk the world keys in case there are some fluid volumes to create
@ -667,8 +667,8 @@ IPhysicsObject *PhysCreateWorld_Shared( CBaseEntity *pWorld, vcollide_t *pWorldC
IPhysicsObject *pWater = physenv->CreatePolyObjectStatic( pWorldCollide->solids[fluid.index], IPhysicsObject *pWater = physenv->CreatePolyObjectStatic( pWorldCollide->solids[fluid.index],
surfaceData, vec3_origin, vec3_angle, &solid.params ); surfaceData, vec3_origin, vec3_angle, &solid.params );
pWater->SetCallbackFlags( pWater->GetCallbackFlags() | CALLBACK_NEVER_DELETED ); //pWater->SetCallbackFlags( pWater->GetCallbackFlags() | CALLBACK_NEVER_DELETED );
physenv->CreateFluidController( pWater, &fluid.params ); //physenv->CreateFluidController( pWater, &fluid.params );
} }
} }
else if ( !strcmpi( pBlock, "materialtable" ) ) else if ( !strcmpi( pBlock, "materialtable" ) )

2
game/shared/physics_shared.h

@ -100,6 +100,8 @@ void PhysFrictionEffect( Vector &vecPos, Vector vecVel, float energy, int surfac
// ORs gameFlags with the physics object's current game flags // ORs gameFlags with the physics object's current game flags
inline unsigned short PhysSetGameFlags( IPhysicsObject *pPhys, unsigned short gameFlags ) inline unsigned short PhysSetGameFlags( IPhysicsObject *pPhys, unsigned short gameFlags )
{ {
return 0;
unsigned short flags = pPhys->GetGameFlags(); unsigned short flags = pPhys->GetGameFlags();
flags |= gameFlags; flags |= gameFlags;
pPhys->SetGameFlags( flags ); pPhys->SetGameFlags( flags );

2
game/shared/ragdoll_shared.cpp

@ -269,6 +269,8 @@ static void RagdollCreateObjects( IPhysicsEnvironment *pPhysEnv, ragdoll_t &ragd
memset( ragdoll.list, 0, sizeof(ragdoll.list) ); memset( ragdoll.list, 0, sizeof(ragdoll.list) );
memset( &ragdoll.animfriction, 0, sizeof(ragdoll.animfriction) ); memset( &ragdoll.animfriction, 0, sizeof(ragdoll.animfriction) );
return;
if ( !params.pCollide || params.pCollide->solidCount > RAGDOLL_MAX_ELEMENTS ) if ( !params.pCollide || params.pCollide->solidCount > RAGDOLL_MAX_ELEMENTS )
return; return;

Loading…
Cancel
Save