environment: Add stub for Get/SetPerformanceSettings
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

pull/89/head^2 0.11
Joshua Ashton 5 months ago committed by Joshie
parent 23bbdea910
commit 6c1ec77980

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

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

Loading…
Cancel
Save