Gems/PhysX

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-09-03 20:37:48 -07:00
parent 4a972d96f9
commit 27cdf174cf
5 changed files with 128 additions and 20 deletions
@@ -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;