Open 3D Engine AzFramework API Reference
2305.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <PhysicsSystem.h>
Public Member Functions | |
AZ_RTTI (SystemInterface,"{B6F4D92A-061B-4CB3-AAB5-984B599A53AE}") | |
AZ_DISABLE_COPY_MOVE (SystemInterface) | |
virtual void | Initialize (const SystemConfiguration *config)=0 |
virtual void | Reinitialize ()=0 |
virtual void | Shutdown ()=0 |
virtual void | Simulate (float deltaTime)=0 |
virtual SceneHandle | AddScene (const SceneConfiguration &config)=0 |
virtual SceneHandleList | AddScenes (const SceneConfigurationList &configs)=0 |
virtual SceneHandle | GetSceneHandle (const AZStd::string &sceneName)=0 |
virtual Scene * | GetScene (SceneHandle handle)=0 |
virtual SceneList | GetScenes (const SceneHandleList &handles)=0 |
virtual SceneList & | GetAllScenes ()=0 |
virtual void | RemoveScene (SceneHandle handle)=0 |
virtual void | RemoveScenes (const SceneHandleList &handles)=0 |
virtual void | RemoveAllScenes ()=0 |
Removes All Scenes. | |
virtual AZStd::pair < SceneHandle, SimulatedBodyHandle > | FindAttachedBodyHandleFromEntityId (AZ::EntityId entityId)=0 |
virtual const SystemConfiguration * | GetConfiguration () const =0 |
Get the current SystemConfiguration used to initialize the Physics system. | |
virtual void | UpdateConfiguration (const SystemConfiguration *newConfig, bool forceReinitialization=false)=0 |
virtual void | UpdateDefaultSceneConfiguration (const SceneConfiguration &sceneConfiguration)=0 |
virtual const SceneConfiguration & | GetDefaultSceneConfiguration () const =0 |
Gets the current default scene configuration. | |
void | RegisterSystemInitializedEvent (SystemEvents::OnInitializedEvent::Handler &handler) |
void | RegisterSystemReInitializedEvent (SystemEvents::OnReinitializedEvent::Handler &handler) |
void | RegisterSystemShutdownEvent (SystemEvents::OnShutdownEvent::Handler &handler) |
void | RegisterPreSimulateEvent (SystemEvents::OnPresimulateEvent::Handler &handler) |
void | RegisterPostSimulateEvent (SystemEvents::OnPostsimulateEvent::Handler &handler) |
void | RegisterSceneAddedEvent (SystemEvents::OnSceneAddedEvent::Handler &handler) |
void | RegisterSceneRemovedEvent (SystemEvents::OnSceneAddedEvent::Handler &handler) |
void | RegisterSystemConfigurationChangedEvent (SystemEvents::OnConfigurationChangedEvent::Handler &handler) |
void | RegisterOnDefaultSceneConfigurationChangedEventHandler (SystemEvents::OnDefaultSceneConfigurationChangedEvent::Handler &handler) |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Interface to access the Physics System.
|
pure virtual |
Add a scene to the physics simulation.
config | This is the Configuration of the scene to add. |
|
pure virtual |
Add multiple scenes to the physics simulation.
configs | This is the list of SceneConfiguration objects to add. |
|
pure virtual |
Helper to find the SceneHandle and SimulatedBodyHandle of a body related to the requested EntityId.
entityId | The entity to search for. |
|
pure virtual |
Retrieve all current Scenes.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Get multiple Scenes.
handles | A list of SceneHandle objects to retrieve. |
|
pure virtual |
Initialize the Physics system with the given configuration.
config | Contains the configuration options |
|
inline |
Register a handler to receive an event when the default SceneConfiguration changes.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the Physics System simulation ends.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the Physics System simulation begins.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the a new Scene is added to the simulation.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the a Scene is removed from the simulation.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the SystemConfiguration changes.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the Physics System is Initialized.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the Physics System is reinitialized.
handler | The handler to receive the event. |
|
inline |
Register to receive notifications when the Physics System shuts down.
handler | The handler to receive the event. |
|
pure virtual |
Will re-initialize the physics backend. Will preserve Scene and Simulation Body data along with any existing Handles.
|
pure virtual |
Remove the requested Scene if it exists.
handle | The handle to the scene to remove. |
|
pure virtual |
Remove many Scenes if they exist.
handles | A list of handles to each scene to remove. |
|
pure virtual |
Teardown the whole Physics system. This removes all Scene and Simulation Body data, then physics will stop running.
|
pure virtual |
Advance the Physics state. This will iterate the Scene list, update All simulation bodies and advance the physics state by the given delta time. It is recommended to call this function to run the physics tick. Advanced users may manually update each scene, if required to have finer control. This function will also signal the OnPresimulateEvent and OnPostsimulateEvent. The OnPresimulateEvent will have a parameter that will be the total time executed by the simulation. When SystemConfiguration::m_fixedTimestep is greater than zero, the simulation will run at the fixed time step and may run multiple steps per frame. This time can range from 0.0f to SystemConfiguration::m_maxTimestep. Where 0.0 time indicates that the simulation did not execute any steps this frame. When SystemConfiguration::m_fixedTimestep equal to or less than zero, the simulation will step once with a time between deltaTime and SystemConfiguration::m_maxTimestep. Example Advanced users might do to self manage Advancing the physics state.
deltaTime | This is the time in seconds to simulate physics for this tick (60fps = 0.01666667). Typically the frame deltaTime of the game loop. |
|
pure virtual |
Update the SystemConfiguration. This will apply the new configuration, some properties may require the reinitialization of the physics system and will tear down all Scenes and Simulation bodies.
newConfig | The new configuration to apply. |
forceReinitialization | Flag to force a reinitialization of the physics system. Default false. |
|
pure virtual |
Update the current default scene configuration. This is the configuration used to to create scenes without a custom configuration.
sceneConfiguration | The new configuration to apply. |