internal static extern IntPtr ExportAndReturnNextContact( IntPtr contactHandle, ref PContactExport3D export, ref PConvexCacheExport3D convexExport, ref PManifoldExport3D manifoldExport3D1, ref PManifoldExport3D manifoldExport3D2, ref PManifoldExport3D manifoldExport3D3);
public static void AddExternalConvexCache(PInternalState3D state) { for (int i = 0; i < state.contactCount; i++) { PContactExport3D export = state.contactExports[i]; PConvexCacheExport3D convexExport = state.convexExports[i]; NativeParallel3D.AddExternalConvexCacheData(export.id, convexExport); } }
public static void ExportContacts() { if (!initialized) { Initialize(); } _contactCount = 0; int index = 0; IntPtr contactPtr = NativeParallel3D.GetContactList(internalWorld.IntPointer); while (contactPtr != IntPtr.Zero) { contactPtrs[index] = contactPtr; PContactExport3D export = contactExports[index]; PConvexCacheExport3D convexExport = convexExports[index]; int manifoldIndex = 3 * index; PManifoldExport3D m1 = manifoldExports[manifoldIndex]; PManifoldExport3D m2 = manifoldExports[manifoldIndex + 1]; PManifoldExport3D m3 = manifoldExports[manifoldIndex + 2]; contactPtr = NativeParallel3D.ExportAndReturnNextContact(contactPtr, ref export, ref convexExport, ref m1, ref m2, ref m3); contactExports[index] = export; convexExports[index] = convexExport; int manifoldCount = export.manifoldCount; if (manifoldCount == 1) { manifoldExports[manifoldIndex] = m1; } else if (manifoldCount == 2) { manifoldExports[manifoldIndex] = m1; manifoldExports[manifoldIndex + 1] = m2; } else if (manifoldCount == 3) { manifoldExports[manifoldIndex] = m1; manifoldExports[manifoldIndex + 1] = m2; manifoldExports[manifoldIndex + 2] = m3; } index++; } _contactCount = index; }
internal static extern void AddExternalConvexCacheData( UInt32 contactID, PConvexCacheExport3D convexExport);