Add **Physics Statistics and profiler**

This commit is contained in:
Wojtek Figat
2023-03-13 12:31:51 +01:00
parent af54b907d7
commit 34629d46f3
9 changed files with 210 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "Types.h"
#include "Engine/Scripting/ScriptingType.h"
/// <summary>
/// Physics simulation statistics container for profiler.
/// </summary>
API_STRUCT(NoDefault) struct FLAXENGINE_API PhysicsStatistics
{
DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicsStatistics);
// Number of active dynamic bodies for the current simulation step. Does not include active kinematic bodies.
API_FIELD() uint32 ActiveDynamicBodies;
// Number of active kinematic bodies for the current simulation step.
API_FIELD() uint32 ActiveKinematicBodies;
// Number of active joints object for the current simulation step.
API_FIELD() uint32 ActiveJoints;
// Number of static bodies for the current simulation step.
API_FIELD() uint32 StaticBodies;
// Number of dynamic bodies for the current simulation step.
API_FIELD() uint32 DynamicBodies;
// Number of kinematic bodies for the current simulation step.
API_FIELD() uint32 KinematicBodies;
// Number of new pairs found during this frame.
API_FIELD() uint32 NewPairs;
// Number of lost pairs during this frame.
API_FIELD() uint32 LostPairs;
// Number of new touches found during this frame.
API_FIELD() uint32 NewTouches;
// Number of lost touches during this frame.
API_FIELD() uint32 LostTouches;
PhysicsStatistics()
{
Platform::MemoryClear(this, sizeof(PhysicsStatistics));
}
};