Преглед на файлове

Change kinematic update to pre-simulation (#583)

Signed-off-by: Michał Pełka <[email protected]>
Adam Dąbrowski преди 1 година
родител
ревизия
a330c729ca

+ 4 - 4
Gems/WarehouseAutomation/Code/Source/ConveyorBelt/ConveyorBeltComponent.cpp

@@ -80,7 +80,7 @@ namespace WarehouseAutomation
         if (splinePtr)
         {
             m_splineConsPtr = splinePtr;
-            m_sceneFinishSimHandler = AzPhysics::SceneEvents::OnSceneSimulationFinishHandler(
+            m_sceneSimStartHandler = AzPhysics::SceneEvents::OnSceneSimulationStartHandler (
                 [this]([[maybe_unused]] AzPhysics::SceneHandle sceneHandle, float fixedDeltaTime)
                 {
                     SpawnSegments(fixedDeltaTime);
@@ -88,7 +88,7 @@ namespace WarehouseAutomation
                     DespawnSegments();
                 },
                 aznumeric_cast<int32_t>(AzPhysics::SceneEvents::PhysicsStartFinishSimulationPriority::Components));
-            sceneInterface->RegisterSceneSimulationFinishHandler(defaultSceneHandle, m_sceneFinishSimHandler);
+            sceneInterface->RegisterSceneSimulationStartHandler(defaultSceneHandle, m_sceneSimStartHandler);
             const auto& [startPoint, endPoint] = GetStartAndEndPointOfBelt(splinePtr);
             m_startPoint = startPoint;
             m_endPoint = endPoint;
@@ -114,9 +114,9 @@ namespace WarehouseAutomation
 
     void ConveyorBeltComponent::Deactivate()
     {
-        if (m_sceneFinishSimHandler.IsConnected())
+        if (m_sceneSimStartHandler.IsConnected())
         {
-            m_sceneFinishSimHandler.Disconnect();
+            m_sceneSimStartHandler.Disconnect();
         }
         ConveyorBeltRequestBus::Handler::BusDisconnect();
         AZ::EntityBus::Handler::BusDisconnect();

+ 1 - 1
Gems/WarehouseAutomation/Code/Source/ConveyorBelt/ConveyorBeltComponent.h

@@ -104,7 +104,7 @@ namespace WarehouseAutomation
 
         ConveyorBeltComponentConfiguration m_configuration; //!< Configuration of the component
 
-        AzPhysics::SceneEvents::OnSceneSimulationFinishHandler m_sceneFinishSimHandler; //!< Handler called after every physics sub-step
+        AzPhysics::SceneEvents::OnSceneSimulationStartHandler m_sceneSimStartHandler; //!< Handler called after every physics sub-step
         AZStd::deque<AZStd::pair<float, AzPhysics::SimulatedBodyHandle>> m_conveyorSegments; //!< Cache of created segments
         float m_textureOffset = 0.0f; //!< Current offset of the texture during animation
         AZ::ConstSplinePtr m_splineConsPtr{ nullptr }; //!< Pointer to the spline