Integrating up through commit 90f050496

This commit is contained in:
alexpete
2021-04-07 14:03:29 -07:00
parent 8f2ed080a9
commit c2cbd430fe
2694 changed files with 285622 additions and 176874 deletions
@@ -20,7 +20,10 @@
#include <AzCore/Serialization/SerializeContext.h>
#include <AzFramework/Physics/RigidBodyBus.h>
#include <AzFramework/Physics/CharacterBus.h>
#include <AzFramework/Physics/PhysicsScene.h>
#include <AzFramework/Physics/Common/PhysicsTypes.h>
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Interface/Interface.h>
#ifdef LMBR_CENTRAL_EDITOR
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#endif
@@ -426,6 +429,13 @@ namespace LmbrCentral
, m_movementMethod(NavigationComponentRequests::MovementMethod::Physics)
, m_usesCharacterPhysics(false)
, m_allowVerticalNavigation(false)
, m_sceneStartSimHandler([this](
[[maybe_unused]] AzPhysics::SceneHandle sceneHandle,
float fixedDeltatime
)
{
this->MoveEntity(fixedDeltatime);
}, aznumeric_cast<int32_t>(AzPhysics::SceneEvents::PhysicsStartFinishSimulationPriority::Components))
{
}
@@ -619,7 +629,11 @@ namespace LmbrCentral
// Connect to physics bus if appropriate, else tick bus
if ((m_movementMethod == NavigationComponentRequests::MovementMethod::Physics))
{
Physics::WorldNotificationBus::Handler::BusConnect(Physics::DefaultPhysicsWorldId);
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
{
AzPhysics::SceneHandle sceneHandle = sceneInterface->GetSceneHandle(AzPhysics::DefaultPhysicsSceneName);
sceneInterface->RegisterSceneSimulationStartHandler(sceneHandle, m_sceneStartSimHandler);
}
}
else
{
@@ -838,14 +852,6 @@ namespace LmbrCentral
MoveEntity(deltaTime);
}
//////////////////////////////////////////////////////////////////////////
// Physics::WorldNotificationBus::Handler implementation
void NavigationComponent::OnPrePhysicsSubtick(float fixedDeltaTime)
{
MoveEntity(fixedDeltaTime);
}
//////////////////////////////////////////////////////////////////////////
// AZ::TransformNotificationBus::Handler implementation
// If the transform on the entity has changed
@@ -863,7 +869,7 @@ namespace LmbrCentral
// Disconnect from tick bus and physics bus
AZ::TickBus::Handler::BusDisconnect();
Physics::WorldNotificationBus::Handler::BusDisconnect();
m_sceneStartSimHandler.Disconnect();
}
PathfindRequest::NavigationRequestId NavigationComponent::FindPathToEntity(AZ::EntityId targetEntityId)