public bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, IList<RayCastResult> outputCastResults)
{
var overlappedElements = PhysicsResources.GetBroadPhaseEntryList();
BoundingBox boundingBox;
castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);
BroadPhase.QueryAccelerator.GetEntries(boundingBox, overlappedElements);
for (int i = 0; i < overlappedElements.Count; ++i)
{
RayHit hit;
if (overlappedElements.Elements[i].ConvexCast(castShape, ref startingTransform, ref sweep, filter, out hit))
{
outputCastResults.Add(new RayCastResult { HitData = hit, HitObject = overlappedElements.Elements[i] });
}
}
PhysicsResources.GiveBack(overlappedElements);
return outputCastResults.Count > 0;
}