Example #1
0
        public override float IntersectDistance(vec3 rayOrigin, vec3 rayDir)
        {
            float distance;

            GeometryMath.intersectRayPlane(rayOrigin, glm.normalize(rayDir), origin, normal, out distance);
            return(distance);
        }
Example #2
0
        public override float IntersectDistance(vec3 rayOrigin, vec3 rayDir)
        {
            float distance;

            GeometryMath.intersectRaySphere(rayOrigin, glm.normalize(rayDir), center, radius * radius, out distance);
            return(distance);
        }
Example #3
0
        public override bool Intersects(vec3 rayOrigin, vec3 rayDir)
        {
            float distance;

            return(GeometryMath.intersectRayPlane(rayOrigin, glm.normalize(rayDir), origin, normal, out distance));
        }