Пример #1
0
        public bool IntersectsRay(Ray3D ray, out float t)
        {
            Ray3D circleSpaceRay      = TransformRayInEllipseCircleSpace(ray);
            XZOrientedCircle3D circle = TransformToCircleLocalSpace();

            return(circle.IntersectsRay(circleSpaceRay, out t));
        }
Пример #2
0
        private XZOrientedCircle3D TransformToCircleLocalSpace()
        {
            var circle = new XZOrientedCircle3D();

            circle.Rotation = Quaternion.identity;
            circle.SetScale(1.0f);
            circle.ModelSpaceRadius = 1.0f;
            circle.Center           = Vector3.zero;

            return(circle);
        }
Пример #3
0
        public bool ContainsAllPoints(List <Vector3> points)
        {
            XZOrientedCircle3D circle = TransformToCircleLocalSpace();

            foreach (Vector3 point in points)
            {
                if (!circle.ContainsPoint(TransformPointInEllipseCircleLocalSpace(point)))
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #4
0
        public bool ContainsPoint(Vector3 point)
        {
            XZOrientedCircle3D circle = TransformToCircleLocalSpace();

            return(circle.ContainsPoint(TransformPointInEllipseCircleLocalSpace(point)));
        }
Пример #5
0
 public XZOrientedCircle3D(XZOrientedCircle3D source)
 {
     Center           = source.Center;
     ModelSpaceRadius = source.ModelSpaceRadius;
     Rotation         = source.Rotation;
 }