diff --git a/Modified fragsurf/TraceUtil/Tracer.cs b/Modified fragsurf/TraceUtil/Tracer.cs index a1eb97a..df6743a 100644 --- a/Modified fragsurf/TraceUtil/Tracer.cs +++ b/Modified fragsurf/TraceUtil/Tracer.cs @@ -66,7 +66,15 @@ namespace Fragsurf.TraceUtil { result.hitPoint = hit.point; result.planeNormal = hit.normal; result.distance = hit.distance; + + RaycastHit normalHit; + Ray normalRay = new Ray (hit.point - direction * 0.001f, direction); + if (hit.collider.Raycast (normalRay, out normalHit, 0.002f)) { + + result.planeNormal = normalHit.normal; + } + } else result.fraction = 1; @@ -105,7 +113,15 @@ namespace Fragsurf.TraceUtil { result.hitPoint = hit.point; result.planeNormal = hit.normal; result.distance = hit.distance; + + RaycastHit normalHit; + Ray normalRay = new Ray (hit.point - direction * 0.001f, direction); + if (hit.collider.Raycast (normalRay, out normalHit, 0.002f)) { + + result.planeNormal = normalHit.normal; + } + } else result.fraction = 1; @@ -114,4 +130,4 @@ namespace Fragsurf.TraceUtil { } } -} \ No newline at end of file +}