environment: Add stub for Get/SetPerformanceSettings

This commit is contained in:
Joshua Ashton 2022-09-09 02:10:17 +01:00
parent 23bbdea910
commit edf4efcb16
2 changed files with 14 additions and 2 deletions

View File

@ -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 );
@ -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 );
}
}
//-------------------------------------------------------------------------------------------------

View File

@ -225,4 +225,6 @@ private:
bool m_EnableConstraintNotify = false;
mutable bool m_bActiveObjectCountFirst = true;
physics_performanceparams_t m_PerformanceParams;
};