Body[] DoVolumeCastGeneral(dGeomID volumeCastGeomID, int contactGroup) { int count; IntPtr data; Ode.DoVolumeCast(neoAxisAdditionsID, volumeCastGeomID, contactGroup, out count, out data); if (count == 0) { return(emptyVolumeCastResult); } unsafe { int *pointer = (int *)data; for (int n = 0; n < count; n++) { int shapeDictionaryIndex = *pointer; ODEBody.GeomData geomData = shapesDictionary[shapeDictionaryIndex]; volumeCastResult.AddWithCheckAlreadyContained(geomData.shape.Body); pointer++; } } Body[] result = new Body[volumeCastResult.Count]; volumeCastResult.CopyTo(result, 0); volumeCastResult.Clear(); return(result); }