GetHitPos() public méthode

public GetHitPos ( ) : float3
Résultat float3
Exemple #1
0
        // 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;
        }
Exemple #2
0
        // 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);
        }