Interface of a Physics Scene. More...
#include <PhysicsScene.h>
Public Member Functions | |
AZ_RTTI (Scene, "{52BD8163-BDC4-4B09-ABB2-11DD1F601FFD}") | |
Scene (const SceneConfiguration &config) | |
const AZ::Crc32 & | GetId () const |
virtual void | StartSimulation (float deltatime)=0 |
virtual void | FinishSimulation ()=0 |
virtual void | SetEnabled (bool enable)=0 |
virtual bool | IsEnabled () const =0 |
virtual const SceneConfiguration & | GetConfiguration () const =0 |
virtual void | UpdateConfiguration (const SceneConfiguration &config)=0 |
virtual SimulatedBodyHandle | AddSimulatedBody (const SimulatedBodyConfiguration *simulatedBodyConfig)=0 |
virtual SimulatedBodyHandleList | AddSimulatedBodies (const SimulatedBodyConfigurationList &simulatedBodyConfigs)=0 |
virtual SimulatedBody * | GetSimulatedBodyFromHandle (SimulatedBodyHandle bodyHandle)=0 |
virtual SimulatedBodyList | GetSimulatedBodiesFromHandle (const SimulatedBodyHandleList &bodyHandles)=0 |
virtual void | RemoveSimulatedBody (SimulatedBodyHandle &bodyHandle)=0 |
virtual void | RemoveSimulatedBodies (SimulatedBodyHandleList &bodyHandles)=0 |
virtual void | EnableSimulationOfBody (SimulatedBodyHandle bodyHandle)=0 |
virtual void | DisableSimulationOfBody (SimulatedBodyHandle bodyHandle)=0 |
virtual JointHandle | AddJoint (const JointConfiguration *jointConfig, SimulatedBodyHandle parentBody, SimulatedBodyHandle childBody)=0 |
virtual Joint * | GetJointFromHandle (JointHandle jointHandle)=0 |
virtual void | RemoveJoint (JointHandle jointHandle)=0 |
virtual SceneQueryHits | QueryScene (const SceneQueryRequest *request)=0 |
virtual bool | QueryScene (const SceneQueryRequest *request, SceneQueryHits &result)=0 |
virtual SceneQueryHitsList | QuerySceneBatch (const SceneQueryRequests &requests)=0 |
virtual bool | QuerySceneAsync (SceneQuery::AsyncRequestId requestId, const SceneQueryRequest *request, SceneQuery::AsyncCallback callback)=0 |
virtual bool | QuerySceneAsyncBatch (SceneQuery::AsyncRequestId requestId, const SceneQueryRequests &requests, SceneQuery::AsyncBatchCallback callback)=0 |
virtual void | SuppressCollisionEvents (const SimulatedBodyHandle &bodyHandleA, const SimulatedBodyHandle &bodyHandleB)=0 |
virtual void | UnsuppressCollisionEvents (const SimulatedBodyHandle &bodyHandleA, const SimulatedBodyHandle &bodyHandleB)=0 |
virtual void | SetGravity (const AZ::Vector3 &gravity)=0 |
virtual AZ::Vector3 | GetGravity () const =0 |
virtual void * | GetNativePointer () const =0 |
void | RegisterSceneConfigurationChangedEventHandler (SceneEvents::OnSceneConfigurationChanged::Handler &handler) |
void | RegisterSimulationBodyAddedHandler (SceneEvents::OnSimulationBodyAdded::Handler &handler) |
void | RegisterSimulationBodyRemovedHandler (SceneEvents::OnSimulationBodyRemoved::Handler &handler) |
void | RegisterSimulationBodySimulationEnabledHandler (SceneEvents::OnSimulationBodySimulationEnabled::Handler &handler) |
void | RegisterSimulationBodySimulationDisabledHandler (SceneEvents::OnSimulationBodySimulationDisabled::Handler &handler) |
void | RegisterSceneSimulationStartHandler (SceneEvents::OnSceneSimulationStartHandler &handler) |
void | RegisterSceneSimulationFinishHandler (SceneEvents::OnSceneSimulationFinishHandler &handler) |
void | RegisterSceneActiveSimulatedBodiesHandler (SceneEvents::OnSceneActiveSimulatedBodiesEvent::Handler &handler) |
void | RegisterSceneCollisionEventHandler (SceneEvents::OnSceneCollisionsEvent::Handler &handler) |
void | RegisterSceneTriggersEventHandler (SceneEvents::OnSceneTriggersEvent::Handler &handler) |
void | RegisterSceneGravityChangedEvent (SceneEvents::OnSceneGravityChangedEvent::Handler &handler) |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Public Attributes | |
AZ_CLASS_ALLOCATOR_DECL | |
Interface of a Physics Scene.
|
pure virtual |
Add a joint to the Scene.
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.
simulatedBodyConfigs | The list of simulated body configs. |
|
pure virtual |
Add a simulated body to the Scene.
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.
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.
|
pure virtual |
Accessor to the Scenes Configuration.
|
pure virtual |
const AZ::Crc32 & AzPhysics::Scene::GetId | ( | ) | const |
Get the Id of the Scene.
|
pure virtual |
Get the Raw pointer to the requested joint.
jointHandle | A handle to the joint to retrieve the raw pointer. |
|
pure virtual |
Get the native pointer for a scene. Should be used with caution as it allows direct access to the lower level physics simulation.
|
pure virtual |
Get the Raw pointer to the set of requested simulated bodies.
bodyHandles | A list of simulated body handles to retrieve the raw pointers for. |
|
pure virtual |
Get the Raw pointer to the requested simulated body.
bodyHandle | A handle to the simulated body to retrieve the raw pointer for. |
|
pure virtual |
|
pure virtual |
Make a blocking query into the scene.
request | The request to make. Should be one of RayCastRequest || ShapeCastRequest || OverlapRequest |
|
pure virtual |
Make a blocking query into the scene.
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.
requestId | A user defined valid 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.
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.
requests | A list of requests to make. Each entry should be one of RayCastRequest || ShapeCastRequest || OverlapRequest |
|
inline |
Register a handler to receive an event with a list of SimulatedBodyHandles that updated this scene tick.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive all collision events in the scene.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive an event when the SceneConfiguration changes.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive a notification when the Scene's gravity has changed.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive an event when Scene::FinishSimulation is called.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive an event when Scene::StartSimulation is called.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive all trigger events in the scene.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive an event when a Simulated body is added to the Scene.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive an event when a Simulated body is removed from the Scene.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive an event when a Simulated body has its simulation disabled in the Scene.
handler | The handler to receive the event. |
|
inline |
Register a handler to receive an event when a Simulated body has its simulation enabled in the Scene. 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.
jointHandle | A handle to the joint being removed. |
|
pure virtual |
Remove a list of simulated bodies from the Scene.
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.
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.
deltatime | The time in seconds to run 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}.
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}.
bodyHandleA | A handle to a simulated body. |
bodyHandleB | A handle to a simulated body. |
|
pure virtual |
Update the SceneConfiguration.
config | The new configuration to apply. |