public void Destroy(BroadPhase broadPhase) { // Remove proxy from the broad-phase. if (ProxyId != BroadPhase.NullProxy) { broadPhase.DestroyProxy(ProxyId); ProxyId = BroadPhase.NullProxy; } // Free the child shape. switch (Shape.Type) { case ShapeType.CircleShape: { //CircleShape s = (CircleShape)Shape; //s->~b2CircleShape(); //allocator->Free(s, sizeof(b2CircleShape)); } break; case ShapeType.PolygonShape: { //b2PolygonShape* s = (b2PolygonShape*)m_shape; //s->~b2PolygonShape(); //allocator->Free(s, sizeof(b2PolygonShape)); } break; default: Box2DXDebug.Assert(false); break; } Shape = null; }
internal void DestroyProxies(BroadPhase broadPhase) { // Destroy proxies in the broad-phase. for (int i = 0; i < ProxyCount; ++i) { broadPhase.DestroyProxy(Proxies[i].ProxyId); Proxies[i].ProxyId = BroadPhase.NullProxy; } ProxyCount = 0; }
/// <summary> /// Internal method /// </summary> /// <param name="broadPhase"></param> public void DestroyProxies(BroadPhase broadPhase) { // Destroy proxies in the broad-phase. for (int i = 0; i < ProxyCount; ++i) { FixtureProxy proxy = Proxies[i]; broadPhase.DestroyProxy(proxy.ProxyId); proxy.ProxyId = BroadPhase.NULL_PROXY; } ProxyCount = 0; }
public void Destroy(BroadPhase broadPhase) { // Remove proxy from the broad-phase. if (_proxyId != PairManager.NullProxy) { broadPhase.DestroyProxy(_proxyId); _proxyId = PairManager.NullProxy; } // Free the child shape. _shape.Dispose(); _shape = null; }
private void DestroyProxy() { Random rnd = new Random(888); for (int i = 0; i < k_actorCount; ++i) { int j = (rnd.Next() % k_actorCount); Actor actor = _actors[j]; if (actor.proxyId != PairManager.NullProxy) { _broadPhase.DestroyProxy(actor.proxyId); actor.proxyId = PairManager.NullProxy; actor.overlapCount = 0; return; } } }
internal void RefilterProxy(BroadPhase broadPhase, XForm transform) { if (_proxyId == PairManager.NullProxy) { return; } broadPhase.DestroyProxy(_proxyId); AABB aabb; _shape.ComputeAABB(out aabb, transform); bool inRange = broadPhase.InRange(aabb); _proxyId = inRange ? broadPhase.CreateProxy(aabb, this) : PairManager.NullProxy; }
internal void RefilterProxy(BroadPhase broadPhase, Transform Transform) { if (_proxyId == PairManager.NullProxy) { return; } broadPhase.DestroyProxy(_proxyId); AABB aabb; _shape.ComputeAABB(out aabb, Transform); bool inRange = broadPhase.InRange(aabb); if (inRange) { _proxyId = broadPhase.CreateProxy(aabb, this); } else { _proxyId = PairManager.NullProxy; } }
/// <summary> /// Refilters the proxy using the specified broad phase /// </summary> /// <param name="broadPhase">The broad phase</param> /// <param name="transform">The transform</param> internal void RefilterProxy(BroadPhase broadPhase, XForm transform) { if (ProxyId == PairManager.NullProxy) { return; } broadPhase.DestroyProxy(ProxyId); Aabb aabb; Shape.ComputeAabb(out aabb, transform); bool inRange = broadPhase.InRange(aabb); if (inRange) { ProxyId = broadPhase.CreateProxy(aabb, this); } else { ProxyId = PairManager.NullProxy; } }
internal void Destroy(BroadPhase broadPhase) { // Remove proxy from the broad-phase. if (_proxyId != BroadPhase.NullProxy) { broadPhase.DestroyProxy(_proxyId); _proxyId = BroadPhase.NullProxy; } _shape = null; }
internal void DestroyProxy(BroadPhase broadPhase) { if (_proxyId == BroadPhase.NullProxy) { return; } // Destroy proxy in the broad-phase. broadPhase.DestroyProxy(_proxyId); _proxyId = BroadPhase.NullProxy; }