1
Vote

AddAABox() and UpdateWorldBoundingBox() do not account for empty boundingboxes

description

See: http://jiglibx.wikidot.com/forum/t-161751/bounding-boxes
 
In AABox.cs replace:
 
static public void AddAABox(AABox aabox, ref BoundingBox bb)
    {
        bb.Min = Vector3.Min(aabox.MinPos, bb.Min);
        bb.Max= Vector3.Max(aabox.MaxPos, bb.Max);
    }
 
With:
public void UpdateWorldBoundingBox()
 (...)
        WorldBoundingBox = BoundingBoxHelper.InitialBox;
        BoundingBoxHelper.AddPoint(ref temp.Min, ref WorldBoundingBox);
        BoundingBoxHelper.AddPoint(ref temp.Max, ref WorldBoundingBox);
    }
 
In Collisionskin.cs replace
 
public void UpdateWorldBoundingBox()
 (...)
        WorldBoundingBox = BoundingBoxHelper.InitialBox;
        BoundingBoxHelper.AddPoint(ref temp.Min, ref WorldBoundingBox);
        BoundingBoxHelper.AddPoint(ref temp.Max, ref WorldBoundingBox);
    }
with:
 
public void UpdateWorldBoundingBox()
 (...)
       WorldBoundingBox = BoundingBoxHelper.InitialBox;
       BoundingBoxHelper.AddBBox(temp,ref WorldBoundingBox);
    }

comments