Beispiel #1
0
        private static void GetAABB_Test(ref double min, ref double max, RotateTransform3D transform, Point3D point, Vector3D scale, Axis axis)
        {
            double half = scale.Coord(axis) / 2d;

            double dist1 = (point + transform.Transform(Math3D.GetNewVector(axis, half))).Coord(axis);
            double dist2 = (point + transform.Transform(Math3D.GetNewVector(axis, -half))).Coord(axis);

            if (dist1 < min)
            {
                min = dist1;
            }

            if (dist2 < min)
            {
                min = dist2;
            }

            if (dist1 > max)
            {
                max = dist1;
            }

            if (dist2 > max)
            {
                max = dist2;
            }
        }