/// <inheritdoc /> public override float GetValueAt(Vector2 uv) { float directionSign = (direction == RayCastDirection.Outwards) ? 1.0f : -1.0f; Ray ray = new Ray(raycastSurface.GetPositionAt(uv), directionSign * Vector3.Normalize(raycastSurface.GetNormalAt(uv))); float intersectionRadius = moldSurface.RayIntersect(ray); if (Math.Abs(intersectionRadius) <= maxDistance) { return(intersectionRadius); } else { return(defaultRadius.GetValueAt(uv)); } }
/// <inheritdoc /> public override double GetValueAt(dvec2 uv) { DebugUtil.AssertAllFinite(uv, nameof(uv)); double directionSign = (direction == RayCastDirection.Outwards) ? 1.0 : -1.0; Ray ray = new Ray(raycastSurface.GetPositionAt(uv), directionSign * raycastSurface.GetNormalAt(uv).Normalized); double intersectionRadius = moldSurface.RayIntersect(ray); if (Math.Abs(intersectionRadius) <= maxDistance) { return(intersectionRadius); } else { return(defaultRadius.GetValueAt(uv)); } }