Пример #1
0
        /**
         * Gets the center of the box, computed as (min + max) / 2.
         *
         * @return a reference to the center of the box
         */
        public Vector3D getCenter()
        {
            center.set(minimum);
            center.add(maximum);
            center.scale(1.0 / 2.0);

            return(center);
        }
Пример #2
0
        public override Vector3D normal(Vector3D intersectionPoint, Vector3D viewPoint)
        {
            Vector3D normal = intersectionPoint.subNew(position());

            normal.scale(invRadius());

            if (viewPoint.subNew(intersectionPoint).dot(normal) < 0.0)
            {
                normal.neg();
            }

            return(normal);
        }