Example #1
0
        public AxisAlignedBox3d ToAABB()
        {
            // [TODO] probably more efficient way to do this...at minimum can move center-shift
            // to after the containments...
            Vector3D         extAxis0 = Extent.x * AxisX;
            Vector3D         extAxis1 = Extent.y * AxisY;
            Vector3D         extAxis2 = Extent.z * AxisZ;
            AxisAlignedBox3d result   = new AxisAlignedBox3d(Center - extAxis0 - extAxis1 - extAxis2);

            result.Contain(Center + extAxis0 - extAxis1 - extAxis2);
            result.Contain(Center + extAxis0 + extAxis1 - extAxis2);
            result.Contain(Center - extAxis0 + extAxis1 - extAxis2);
            result.Contain(Center - extAxis0 - extAxis1 + extAxis2);
            result.Contain(Center + extAxis0 - extAxis1 + extAxis2);
            result.Contain(Center + extAxis0 + extAxis1 + extAxis2);
            result.Contain(Center - extAxis0 + extAxis1 + extAxis2);
            return(result);
        }
Example #2
0
 public void Contain(AxisAlignedBox3d box)
 {
     Contain(box.Min);
     Contain(box.Max);
 }