// Helpers // Intersection between a plane and a ray public bool Intersect( Ray _Ray, ref float3 _intersection ) { float fGradient = n.Dot( _Ray.Aim ); if ( (float) System.Math.Abs( fGradient ) < float.Epsilon ) return false; // It cannot hit! (or very far away at least!) _Ray.Length = (-d - _Ray.Pos.Dot(n)) / fGradient; _intersection = _Ray.GetHitPos(); return true; }
// Helpers // Intersection between a plane and a ray public bool Intersect(Ray _Ray, ref float3 _intersection) { float fGradient = n.Dot(_Ray.Aim); if ((float)System.Math.Abs(fGradient) < float.Epsilon) { return(false); // It cannot hit! (or very far away at least!) } _Ray.Length = (-d - _Ray.Pos.Dot(n)) / fGradient; _intersection = _Ray.GetHitPos(); return(true); }