[LYN-3099] Fixed some issues with vegetation planting on surfaces (#1554)
* [LYN-3099] Fix vegetation raycasts to use bounded ray queries instead of FLT_MAX. Raycasts with a distance of FLT_MAX sometimes overflowed deep in IntersectSegmentTriangleCCW, so it's better to have strict start/end positional queries. We have specific starts and ends anyways, so it's a safer approach anyways. This also adds support for Non-Uniform Scale for meshes, since it was clearly not working correctly in vegetation when testing various scaled meshes. * Addressed PR feedback
This commit is contained in:
@@ -83,9 +83,9 @@ namespace SurfaceData
|
||||
|
||||
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);
|
||||
const AZ::Transform& meshTransformInverse, const AZ::Vector3& nonUniformScale,
|
||||
const AZ::Vector3& rayStart, const AZ::Vector3& rayEnd,
|
||||
AZ::Vector3& outPosition, AZ::Vector3& outNormal);
|
||||
|
||||
AZ_INLINE void AddMaxValueForMasks(SurfaceTagWeightMap& masks, const AZ::Crc32 tag, const float value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user