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
@@ -27,8 +27,9 @@
#include <Components/ClothComponentMesh/ClothDebugDisplay.h>
#include <Components/ClothComponentMesh/ClothComponentMesh.h>
#include <AzFramework/Physics/World.h>
#include <AzFramework/Physics/PhysicsScene.h>
#include <AzFramework/Physics/WindBus.h>
#include <AzFramework/Physics/Common/PhysicsTypes.h>
namespace NvCloth
{
@@ -637,8 +638,15 @@ namespace NvCloth
// Gravity and scale
if (m_config.IsUsingWorldBusGravity())
{
AZ::Vector3 gravity(0.0f, 0.0f, -9.81f);
Physics::WorldRequestBus::EventResult(gravity, Physics::DefaultPhysicsWorldId, &Physics::WorldRequests::GetGravity);
AZ::Vector3 gravity = AzPhysics::DefaultGravity;
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
{
AzPhysics::SceneHandle defaultScene = sceneInterface->GetSceneHandle(AzPhysics::DefaultPhysicsSceneName);
if (defaultScene != AzPhysics::InvalidSceneHandle)
{
gravity = sceneInterface->GetGravity(defaultScene);
}
}
clothConfig->SetGravity(gravity * m_config.m_gravityScale);
}
else