Open 3D Engine AzFramework API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
Interface to access a Physics Scene with a SceneHandle. More...
#include <PhysicsScene.h>
Public Member Functions | |
AZ_RTTI (SceneInterface, "{912CE8D1-7E3E-496F-B7BE-D17F8B30C228}") | |
AZ_DISABLE_COPY_MOVE (SceneInterface) | |
virtual SceneHandle | GetSceneHandle (const AZStd::string &sceneName)=0 |
virtual Scene * | GetScene (SceneHandle handle)=0 |
virtual void | StartSimulation (SceneHandle sceneHandle, float deltatime)=0 |
virtual void | FinishSimulation (SceneHandle sceneHandle)=0 |
virtual void | SetEnabled (SceneHandle sceneHandle, bool enable)=0 |
virtual bool | IsEnabled (SceneHandle sceneHandle) const =0 |
virtual SimulatedBodyHandle | AddSimulatedBody (SceneHandle sceneHandle, const SimulatedBodyConfiguration *simulatedBodyConfig)=0 |
virtual SimulatedBodyHandleList | AddSimulatedBodies (SceneHandle sceneHandle, const SimulatedBodyConfigurationList &simulatedBodyConfigs)=0 |
virtual SimulatedBody * | GetSimulatedBodyFromHandle (SceneHandle sceneHandle, SimulatedBodyHandle bodyHandle)=0 |
virtual SimulatedBodyList | GetSimulatedBodiesFromHandle (SceneHandle sceneHandle, const SimulatedBodyHandleList &bodyHandles)=0 |
virtual void | RemoveSimulatedBody (SceneHandle sceneHandle, SimulatedBodyHandle &bodyHandle)=0 |
virtual void | RemoveSimulatedBodies (SceneHandle sceneHandle, SimulatedBodyHandleList &bodyHandles)=0 |
virtual void | EnableSimulationOfBody (SceneHandle sceneHandle, SimulatedBodyHandle bodyHandle)=0 |
virtual void | DisableSimulationOfBody (SceneHandle sceneHandle, SimulatedBodyHandle bodyHandle)=0 |
virtual JointHandle | AddJoint (SceneHandle sceneHandle, const JointConfiguration *jointConfig, SimulatedBodyHandle parentBody, SimulatedBodyHandle childBody)=0 |
virtual Joint * | GetJointFromHandle (SceneHandle sceneHandle, JointHandle jointHandle)=0 |
virtual void | RemoveJoint (SceneHandle sceneHandle, JointHandle jointHandle)=0 |
virtual SceneQueryHits | QueryScene (SceneHandle sceneHandle, const SceneQueryRequest *request)=0 |
virtual bool | QueryScene (SceneHandle sceneHandle, const SceneQueryRequest *request, SceneQueryHits &result)=0 |
virtual SceneQueryHitsList | QuerySceneBatch (SceneHandle sceneHandle, const SceneQueryRequests &requests)=0 |
virtual bool | QuerySceneAsync (SceneHandle sceneHandle, SceneQuery::AsyncRequestId requestId, const SceneQueryRequest *request, SceneQuery::AsyncCallback callback)=0 |
virtual bool | QuerySceneAsyncBatch (SceneHandle sceneHandle, SceneQuery::AsyncRequestId requestId, const SceneQueryRequests &requests, SceneQuery::AsyncBatchCallback callback)=0 |
virtual void | SuppressCollisionEvents (SceneHandle sceneHandle, const SimulatedBodyHandle &bodyHandleA, const SimulatedBodyHandle &bodyHandleB)=0 |
virtual void | UnsuppressCollisionEvents (SceneHandle sceneHandle, const SimulatedBodyHandle &bodyHandleA, const SimulatedBodyHandle &bodyHandleB)=0 |
virtual void | SetGravity (SceneHandle sceneHandle, const AZ::Vector3 &gravity)=0 |
virtual AZ::Vector3 | GetGravity (SceneHandle sceneHandle) const =0 |
virtual void | RegisterSceneConfigurationChangedEventHandler (SceneHandle sceneHandle, SceneEvents::OnSceneConfigurationChanged::Handler &handler)=0 |
virtual void | RegisterSimulationBodyAddedHandler (SceneHandle sceneHandle, SceneEvents::OnSimulationBodyAdded::Handler &handler)=0 |
virtual void | RegisterSimulationBodyRemovedHandler (SceneHandle sceneHandle, SceneEvents::OnSimulationBodyRemoved::Handler &handler)=0 |
virtual void | RegisterSimulationBodySimulationEnabledHandler (SceneHandle sceneHandle, SceneEvents::OnSimulationBodySimulationEnabled::Handler &handler)=0 |
virtual void | RegisterSimulationBodySimulationDisabledHandler (SceneHandle sceneHandle, SceneEvents::OnSimulationBodySimulationDisabled::Handler &handler)=0 |
virtual void | RegisterSceneSimulationStartHandler (SceneHandle sceneHandle, SceneEvents::OnSceneSimulationStartHandler &handler)=0 |
virtual void | RegisterSceneSimulationFinishHandler (SceneHandle sceneHandle, SceneEvents::OnSceneSimulationFinishHandler &handler)=0 |
virtual void | RegisterSceneActiveSimulatedBodiesHandler (SceneHandle sceneHandle, SceneEvents::OnSceneActiveSimulatedBodiesEvent::Handler &handler)=0 |
virtual void | RegisterSceneCollisionEventHandler (SceneHandle sceneHandle, SceneEvents::OnSceneCollisionsEvent::Handler &handler)=0 |
virtual void | RegisterSceneTriggersEventHandler (SceneHandle sceneHandle, SceneEvents::OnSceneTriggersEvent::Handler &handler)=0 |
virtual void | RegisterSceneGravityChangedEvent (SceneHandle sceneHandle, SceneEvents::OnSceneGravityChangedEvent::Handler &handler)=0 |
Interface to access a Physics Scene with a SceneHandle.
|
pure virtual |
Add a joint to the Scene.
sceneHandle | A handle to the scene to add / remove the joint. |
jointConfig | The config of the joint. |
parentBody | The parent body of the joint. |
childBody | The child body of the joint |
|
pure virtual |
Add a set of simulated bodied to the Scene.
sceneHandle | A handle to the scene to Add the simulated bodies to. |
simulatedBodyConfigs | The list of simulated body configs. |
|
pure virtual |
Add a simulated body to the Scene.
sceneHandle | A handle to the scene to add the requested simulated body. |
simulatedBodyConfig | The config of the simulated body. |
|
pure virtual |
Enable / Disable simulation of the requested body. By default all bodies added are enabled. Disabling simulation the body will no longer be affected by any forces, collisions, or found with scene queries.
sceneHandle | A handle to the scene to enable / disable the requested simulated body. |
bodyHandle | The handle of the simulated body to enable / disable. |
|
pure virtual |
Complete the simulation process. As an example, this is a good place to wait for any work to complete that was triggered in StartSimulation, or swap buffers if double buffering.
sceneHandle | The SceneHandle of the scene to use. |
|
pure virtual |
|
pure virtual |
Get the Raw pointer to the requested joint.
sceneHandle | A handle to the scene to get the simulated bodies from. |
jointHandle | A handle to the joint to retrieve the raw pointer. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Get the Raw pointer to the set of requested simulated bodies.
sceneHandle | A handle to the scene to get the simulated bodies from. |
bodyHandles | A list of simulated body handles to retrieve the raw pointers. |
|
pure virtual |
Get the Raw pointer to the requested simulated body.
sceneHandle | A handle to the scene to get the simulated bodies from. |
bodyHandle | A handle to the simulated body to retrieve the raw pointer. |
|
pure virtual |
|
pure virtual |
Make a blocking query into the scene.
sceneHandle | A handle to the scene to make the scene query with. |
request | The request to make. Should be one of RayCastRequest || ShapeCastRequest || OverlapRequest |
|
pure virtual |
Make a blocking query into the scene.
sceneHandle | A handle to the scene to make the scene query with. |
request | The request to make. Should be one of RayCastRequest || ShapeCastRequest || OverlapRequest |
result | A structure that contains a list of Hits. Depending on flags set in the request, this may only contain 1 result. |
|
pure virtual |
Make a non-blocking query into the scene.
sceneHandle | A handle to the scene to make the scene query with. |
requestId | A user defined value to identify the request when the callback is called. |
request | The request to make. Should be one of RayCastRequest || ShapeCastRequest || OverlapRequest |
callback | The callback to trigger when the request is complete. |
|
pure virtual |
Make a non-blocking query into the scene.
sceneHandle | A handle to the scene to make the scene query with. |
requestId | A user defined valid to identify the request when the callback is called. |
requests | A list of requests to make. Each entry should be one of RayCastRequest || ShapeCastRequest || OverlapRequest |
callback | The callback to trigger when all the request are complete. |
|
pure virtual |
Make many blocking queries into the scene.
sceneHandle | A handle to the scene to make the scene query with. |
requests | A list of requests to make. Each entry should be one of RayCastRequest || ShapeCastRequest || OverlapRequest |
|
pure virtual |
Register a handler to receive an event with a list of SimulatedBodyHandles that updated this scene tick.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive all collision events in the scene.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive an event when the SceneConfiguration changes.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive a notification when the Scene's gravity has changed.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive an event when Scene::FinishSimulation is called.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive an event when Scene::StartSimulation is called.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive all trigger events in the scene.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive an event when a Simulated body is added to the Scene.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive an event when a Simulated body is removed from the Scene.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive an event when a Simulated body has its simulation disabled in the Scene.
sceneHandle | A handle to the scene to register the event with. |
handler | The handler to receive the event. |
|
pure virtual |
Register a handler to receive an event when a Simulated body has its simulation enabled in the Scene.
sceneHandle | A handle to the scene to register the event with. This will only trigger if the simulated body was disabled, when first added to a scene SceneEvents::OnAnySimulationBodyCreated will trigger instead. |
handler | The handler to receive the event. |
|
pure virtual |
Remove a joint from the Scene.
sceneHandle | A handle to the scene to add / remove the joint. |
jointHandle | A handle to the joint being removed. |
|
pure virtual |
Remove a list of simulated bodies from the Scene.
sceneHandle | A handle to the scene to remove the simulated bodies from. |
bodyHandles | A list of simulated body handles to be removed. All handles will be set to AzPhysics::InvalidSimulatedBodyHandle as they're no longer valid. |
|
pure virtual |
Remove a simulated body from the Scene.z
sceneHandle | A handle to the scene to remove the requested simulated body. |
bodyHandle | A handle to the simulated body being removed. This will be set to AzPhysics::InvalidSimulatedBodyHandle as they're no longer valid. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Start the simulation process. As an example, this is a good place to trigger and queue any long running work in separate threads.
sceneHandle | The SceneHandle of the scene to use. |
deltatime | The time in seconds to step the simulation for. |
|
pure virtual |
Registers a pair of simulated bodies for which collisions should be suppressed. Making multiple requests with the same pair result are dropped. To remove the suppression call UnsuppressCollisionEvents with the pair. The order of the bodies do not matter, {body0, body1} collision pair is equal to {body1, body0}.
sceneHandle | A handle to the scene to register the collision pair with. |
bodyHandleA | A handle to a simulated body. |
bodyHandleB | A handle to a simulated body. |
|
pure virtual |
Unregisters a pair of simulated bodies for which collisions should be suppressed. Making multiple requests with the same pair result are dropped. To add a suppression call SuppressCollisionEvents with the pair. The order of the bodies do not matter, {body0, body1} collision pair is equal to {body1, body0}.
sceneHandle | A handle to the scene to unregister the collision pair with. |
bodyHandleA | A handle to a simulated body. |
bodyHandleB | A handle to a simulated body. |