Skip to content

Commit

Permalink
environment: Add stub for Get/SetPerformanceSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua-Ashton committed Sep 9, 2022
1 parent 23bbdea commit 6c1ec77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions vphysics_jolt/vjolt_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ JoltBPLayerInterfaceImpl JoltPhysicsEnvironment::s_BPLayerInterface;
JoltPhysicsEnvironment::JoltPhysicsEnvironment()
: m_ContactListener( m_PhysicsSystem )
{
m_PerformanceParams.Defaults();

m_PhysicsSystem.Init(
kMaxBodies, kNumBodyMutexes, kMaxBodyPairs, kMaxContactConstraints,
s_BPLayerInterface, JoltBroadPhaseCanCollide, JoltObjectCanCollide );
Expand Down Expand Up @@ -1176,12 +1178,20 @@ void JoltPhysicsEnvironment::SweepCollideable( const CPhysCollide *pCollide, con

void JoltPhysicsEnvironment::GetPerformanceSettings( physics_performanceparams_t *pOutput ) const
{
Log_Stub( LOG_VJolt );
if ( pOutput )
*pOutput = m_PerformanceParams;
}

void JoltPhysicsEnvironment::SetPerformanceSettings( const physics_performanceparams_t *pSettings )
{
Log_Stub( LOG_VJolt );
if ( pSettings )
{
m_PerformanceParams = *pSettings;

// Normalize these values to match VPhysics behaviour.
m_PerformanceParams.minFrictionMass = Clamp( m_PerformanceParams.minFrictionMass, 1.0f, VPHYSICS_MAX_MASS );
m_PerformanceParams.maxFrictionMass = Clamp( m_PerformanceParams.maxFrictionMass, 1.0f, VPHYSICS_MAX_MASS );
}
}

//-------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions vphysics_jolt/vjolt_environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,6 @@ class JoltPhysicsEnvironment final : public IPhysicsEnvironment
bool m_EnableConstraintNotify = false;

mutable bool m_bActiveObjectCountFirst = true;

physics_performanceparams_t m_PerformanceParams;
};

0 comments on commit 6c1ec77

Please sign in to comment.