protected virtual void Remove(int contactIndex) { Contact removing = contacts.Elements[contactIndex]; contacts.FastRemoveAt(contactIndex); OnRemoved(removing); unusedContacts.GiveBack(removing); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="list">List to return.</param> public static void GiveBack(RawList <Collidable> list) { if (SubPoolCollidableList == null) { SubPoolCollidableList = new UnsafeResourcePool <RawList <Collidable> >(); } list.Clear(); SubPoolCollidableList.GiveBack(list); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="list">List to return.</param> public static void GiveBack(RawList <BroadPhaseEntry> list) { if (SubPoolBroadPhaseEntryList == null) { SubPoolBroadPhaseEntryList = new UnsafeResourcePool <RawList <BroadPhaseEntry> >(); } list.Clear(); SubPoolBroadPhaseEntryList.GiveBack(list); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="list">List to return.</param> public static void GiveBack(RawList <RayCastResult> list) { if (SubPoolRayCastResultList == null) { SubPoolRayCastResultList = new UnsafeResourcePool <RawList <RayCastResult> >(); } list.Clear(); SubPoolRayCastResultList.GiveBack(list); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="connection">Connection to return.</param> public static void GiveBack(SimulationIslandConnection connection) { if (SimulationIslandConnections == null) { SimulationIslandConnections = new UnsafeResourcePool <SimulationIslandConnection>(); } connection.CleanUp(); SimulationIslandConnections.GiveBack(connection); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="triangle">Triangle collidable to return.</param> public static void GiveBack(TriangleCollidable triangle) { if (SubPoolTriangleCollidables == null) { SubPoolTriangleCollidables = new UnsafeResourcePool <TriangleCollidable>(); } triangle.CleanUp(); SubPoolTriangleCollidables.GiveBack(triangle); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="list">List to return.</param> public static void GiveBack(RawList <Entity> list) { if (SubPoolEntityRawList == null) { SubPoolEntityRawList = new UnsafeResourcePool <RawList <Entity> >(); } list.Clear(); SubPoolEntityRawList.GiveBack(list); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="list">List to return.</param> public static void GiveBack(RawList <CompoundChild> list) { if (SubPoolCompoundChildList == null) { SubPoolCompoundChildList = new UnsafeResourcePool <RawList <CompoundChild> >(); } list.Clear(); SubPoolCompoundChildList.GiveBack(list); }
/// <summary> /// Returns a resource to the pool. /// </summary> /// <param name="triangle">Triangle to return.</param> public static void GiveBack(TriangleShape triangle) { if (SubPoolTriangleShape == null) { SubPoolTriangleShape = new UnsafeResourcePool <TriangleShape>(); } triangle.collisionMargin = 0; triangle.sidedness = TriangleSidedness.DoubleSided; SubPoolTriangleShape.GiveBack(triangle); }
void GiveBackIsland(SimulationIsland island) { island.CleanUp(); islandPool.GiveBack(island); }