Integrating github/staging through commit ab87ed9

This commit is contained in:
alexpete
2021-04-09 11:27:37 -07:00
parent ae62a97894
commit 1044dc3da1
1582 changed files with 29374 additions and 519051 deletions
@@ -17,10 +17,16 @@
#include <AzCore/Math/IntersectSegment.h>
#include <AzCore/Math/Transform.h>
#include <AzCore/Math/Vector3.h>
#include <LmbrCentral/Rendering/MeshAsset.h>
#include <IStatObj.h>
#include <MathConversion.h>
namespace AZ
{
namespace RPI
{
class ModelAsset;
}
}
namespace SurfaceData
{
AZ_INLINE bool GetQuadListRayIntersection(
@@ -79,37 +85,12 @@ namespace SurfaceData
return false;
}
AZ_INLINE bool GetMeshRayIntersection(
const LmbrCentral::MeshAsset& meshAsset,
const AZ::Transform& meshTransform,
const AZ::Transform& meshTransformInverse,
const AZ::Vector3& rayOrigin,
const AZ::Vector3& rayDirection,
AZ::Vector3& outPosition,
AZ::Vector3& outNormal)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity);
IStatObj* pStatObj = meshAsset.m_statObj.get();
if (pStatObj)
{
const Vec3 rayOriginLocal = AZVec3ToLYVec3(meshTransformInverse.TransformPoint(rayOrigin));
const Vec3 rayDirectionLocal = AZVec3ToLYVec3(meshTransformInverse.TransformVector(rayDirection).GetNormalized());
SRayHitInfo hitInfo = {};
hitInfo.inReferencePoint = rayOriginLocal;
hitInfo.inRay = Ray(rayOriginLocal, rayDirectionLocal);
if (pStatObj->RayIntersection(hitInfo))
{
outPosition = meshTransform.TransformPoint(LYVec3ToAZVec3(hitInfo.vHitPos));
outNormal = meshTransform.TransformVector(LYVec3ToAZVec3(hitInfo.vHitNormal)).GetNormalized();
return true;
}
}
return false;
}
bool GetMeshRayIntersection(
const AZ::RPI::ModelAsset& meshAsset, const AZ::Transform& meshTransform,
const AZ::Transform& meshTransformInverse, const AZ::Vector3& rayOrigin,
const AZ::Vector3& rayDirection, AZ::Vector3& outPosition,
AZ::Vector3& outNormal);
AZ_INLINE void AddMaxValueForMasks(SurfaceTagWeightMap& masks, const AZ::Crc32 tag, const float value)
{