Gems/PhysX
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -85,8 +85,7 @@ namespace PhysX::Benchmarks
|
||||
class PhysXCharactersBenchmarkFixture
|
||||
: public PhysX::Benchmarks::PhysXBaseBenchmarkFixture
|
||||
{
|
||||
public:
|
||||
virtual void SetUp([[maybe_unused]] const ::benchmark::State& state) override
|
||||
void internalSetUp()
|
||||
{
|
||||
PhysX::Benchmarks::PhysXBaseBenchmarkFixture::SetUpInternal();
|
||||
//need to get the Physics::System to be able to spawn the rigid bodies
|
||||
@@ -95,12 +94,31 @@ namespace PhysX::Benchmarks
|
||||
m_terrainEntity = PhysX::TestUtils::CreateFlatTestTerrain(m_testSceneHandle, CharacterConstants::TerrainSize, CharacterConstants::TerrainSize);
|
||||
}
|
||||
|
||||
virtual void TearDown([[maybe_unused]] const ::benchmark::State& state) override
|
||||
void internalTearDown()
|
||||
{
|
||||
m_terrainEntity = nullptr;
|
||||
PhysX::Benchmarks::PhysXBaseBenchmarkFixture::TearDownInternal();
|
||||
}
|
||||
|
||||
public:
|
||||
void SetUp(const benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
void SetUp(benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
|
||||
void TearDown(const benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
void TearDown(benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
// PhysXBaseBenchmarkFixture Overrides ...
|
||||
AzPhysics::SceneConfiguration GetDefaultSceneConfiguration() override
|
||||
|
||||
@@ -70,8 +70,7 @@ namespace PhysX::Benchmarks
|
||||
class PhysXCharactersRagdollBenchmarkFixture
|
||||
: public PhysX::Benchmarks::PhysXBaseBenchmarkFixture
|
||||
{
|
||||
public:
|
||||
virtual void SetUp([[maybe_unused]] const ::benchmark::State& state) override
|
||||
void internalSetUp()
|
||||
{
|
||||
PhysX::Benchmarks::PhysXBaseBenchmarkFixture::SetUpInternal();
|
||||
//need to get the Physics::System to be able to spawn the rigid bodies
|
||||
@@ -80,12 +79,31 @@ namespace PhysX::Benchmarks
|
||||
m_terrainEntity = PhysX::TestUtils::CreateFlatTestTerrain(m_testSceneHandle, RagdollConstants::TerrainSize, RagdollConstants::TerrainSize);
|
||||
}
|
||||
|
||||
virtual void TearDown([[maybe_unused]] const ::benchmark::State& state) override
|
||||
void internalTearDown()
|
||||
{
|
||||
m_terrainEntity = nullptr;
|
||||
PhysX::Benchmarks::PhysXBaseBenchmarkFixture::TearDownInternal();
|
||||
}
|
||||
|
||||
public:
|
||||
void SetUp(const benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
void SetUp(benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
|
||||
void TearDown(const benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
void TearDown(benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
// PhysXBaseBenchmarkFixture Overrides ...
|
||||
AzPhysics::SceneConfiguration GetDefaultSceneConfiguration() override
|
||||
|
||||
@@ -184,17 +184,36 @@ namespace PhysX::Benchmarks
|
||||
: public PhysXBaseBenchmarkFixture
|
||||
{
|
||||
public:
|
||||
virtual void SetUp([[maybe_unused]] const ::benchmark::State &state) override
|
||||
void internalSetUp()
|
||||
{
|
||||
PhysXBaseBenchmarkFixture::SetUpInternal();
|
||||
}
|
||||
|
||||
virtual void TearDown([[maybe_unused]] const ::benchmark::State &state) override
|
||||
void internalTearDown()
|
||||
{
|
||||
PhysXBaseBenchmarkFixture::TearDownInternal();
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
void SetUp(const benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
void SetUp(benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
|
||||
void TearDown(const benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
void TearDown(benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
|
||||
// PhysXBaseBenchmarkFixture Interface ---------
|
||||
AzPhysics::SceneConfiguration GetDefaultSceneConfiguration() override
|
||||
{
|
||||
|
||||
@@ -136,8 +136,8 @@ namespace PhysX::Benchmarks
|
||||
class PhysXRigidbodyBenchmarkFixture
|
||||
: public PhysXBaseBenchmarkFixture
|
||||
{
|
||||
public:
|
||||
virtual void SetUp([[maybe_unused]] const ::benchmark::State &state) override
|
||||
protected:
|
||||
virtual void internalSetUp()
|
||||
{
|
||||
PhysXBaseBenchmarkFixture::SetUpInternal();
|
||||
//need to get the Physics::System to be able to spawn the rigid bodies
|
||||
@@ -146,11 +146,29 @@ namespace PhysX::Benchmarks
|
||||
m_terrainEntity = PhysX::TestUtils::CreateFlatTestTerrain(m_testSceneHandle, RigidBodyConstants::TerrainSize, RigidBodyConstants::TerrainSize);
|
||||
}
|
||||
|
||||
virtual void TearDown([[maybe_unused]] const ::benchmark::State &state) override
|
||||
virtual void internalTearDown()
|
||||
{
|
||||
m_terrainEntity = nullptr;
|
||||
PhysXBaseBenchmarkFixture::TearDownInternal();
|
||||
}
|
||||
public:
|
||||
void SetUp(const benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
void SetUp(benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
|
||||
void TearDown(const benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
void TearDown(benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
// PhysXBaseBenchmarkFixture Interface ---------
|
||||
@@ -312,10 +330,9 @@ namespace PhysX::Benchmarks
|
||||
class PhysXRigidbodyCollisionsBenchmarkFixture
|
||||
: public PhysXRigidbodyBenchmarkFixture
|
||||
{
|
||||
public:
|
||||
void SetUp(const ::benchmark::State& state) override
|
||||
void internalSetUp() override
|
||||
{
|
||||
PhysXRigidbodyBenchmarkFixture::SetUp(state);
|
||||
PhysXRigidbodyBenchmarkFixture::internalSetUp();
|
||||
|
||||
m_collisionBeginCount = 0;
|
||||
m_collisionPersistCount = 0;
|
||||
@@ -346,11 +363,30 @@ namespace PhysX::Benchmarks
|
||||
m_defaultScene->RegisterSceneCollisionEventHandler(m_onSceneCollisionHandler);
|
||||
}
|
||||
|
||||
void TearDown(const ::benchmark::State& state) override
|
||||
void internalTearDown() override
|
||||
{
|
||||
m_onSceneCollisionHandler.Disconnect();
|
||||
|
||||
PhysXRigidbodyBenchmarkFixture::TearDown(state);
|
||||
PhysXRigidbodyBenchmarkFixture::internalTearDown();
|
||||
}
|
||||
|
||||
public:
|
||||
void SetUp(const benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
void SetUp(benchmark::State&) override
|
||||
{
|
||||
internalSetUp();
|
||||
}
|
||||
|
||||
void TearDown(const benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
void TearDown(benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -47,14 +47,12 @@ namespace PhysX::Benchmarks
|
||||
, public PhysX::GenericPhysicsFixture
|
||||
|
||||
{
|
||||
public:
|
||||
|
||||
//! Spawns box entities in unique locations in 1/8 of sphere with all non-negative dimensions between radii[2, max radius].
|
||||
//! Accepts 2 parameters from \state.
|
||||
//!
|
||||
//! \state.range(0) - number of box entities to spawn
|
||||
//! \state.range(1) - max radius
|
||||
void SetUp(const ::benchmark::State& state) override
|
||||
void internalSetUp(const ::benchmark::State& state)
|
||||
{
|
||||
PhysX::GenericPhysicsFixture::SetUpInternal();
|
||||
|
||||
@@ -100,13 +98,32 @@ namespace PhysX::Benchmarks
|
||||
}
|
||||
}
|
||||
|
||||
void TearDown([[maybe_unused]] const ::benchmark::State& state) override
|
||||
void internalTearDown()
|
||||
{
|
||||
m_boxes.clear();
|
||||
m_entities.clear();
|
||||
PhysX::GenericPhysicsFixture::TearDownInternal();
|
||||
}
|
||||
|
||||
public:
|
||||
void SetUp(const benchmark::State& state) override
|
||||
{
|
||||
internalSetUp(state);
|
||||
}
|
||||
void SetUp(benchmark::State& state) override
|
||||
{
|
||||
internalSetUp(state);
|
||||
}
|
||||
|
||||
void TearDown(const benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
void TearDown(benchmark::State&) override
|
||||
{
|
||||
internalTearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
std::vector<EntityPtr> m_entities;
|
||||
std::vector<AZ::Vector3> m_boxes;
|
||||
|
||||
Reference in New Issue
Block a user