internal void RefilterProxy(BroadPhase broadPhase, XForm transform) { if (this._proxyId != PairManager.NullProxy) { broadPhase.DestroyProxy((int)this._proxyId); AABB aabb; this.ComputeAABB(out aabb, transform); bool flag = broadPhase.InRange(aabb); if (flag) { this._proxyId = broadPhase.CreateProxy(aabb, this); } else { this._proxyId = PairManager.NullProxy; } } }
internal void CreateProxy(BroadPhase broadPhase, XForm transform) { Box2DXDebug.Assert(this._proxyId == PairManager.NullProxy); AABB aabb; this.ComputeAABB(out aabb, transform); bool flag = broadPhase.InRange(aabb); Box2DXDebug.Assert(flag); if (flag) { this._proxyId = broadPhase.CreateProxy(aabb, this); } else { this._proxyId = PairManager.NullProxy; } }
internal bool Synchronize(BroadPhase broadPhase, XForm transform1, XForm transform2) { if (_proxyId == PairManager.NullProxy) { return(false); } // Compute an AABB that covers the swept shape (may miss some rotation effect). AABB aabb; ComputeSweptAABB(out aabb, transform1, transform2); if (broadPhase.InRange(aabb)) { broadPhase.MoveProxy(_proxyId, aabb); return(true); } else { return(false); } }
internal void CreateProxy(BroadPhase broadPhase, XForm transform) { Box2DXDebug.Assert(_proxyId == PairManager.NullProxy); AABB aabb; ComputeAABB(out aabb, transform); bool inRange = broadPhase.InRange(aabb); // You are creating a shape outside the world box. Box2DXDebug.Assert(inRange); if (inRange) { _proxyId = broadPhase.CreateProxy(aabb, this); } else { _proxyId = PairManager.NullProxy; } }
internal bool Synchronize(BroadPhase broadPhase, XForm transform1, XForm transform2) { bool result; if (this._proxyId == PairManager.NullProxy) { result = false; } else { AABB aabb; this.ComputeSweptAABB(out aabb, transform1, transform2); if (broadPhase.InRange(aabb)) { broadPhase.MoveProxy((int)this._proxyId, aabb); result = true; } else { result = false; } } return(result); }
internal void RefilterProxy(BroadPhase broadPhase, XForm transform) { if (_proxyId == PairManager.NullProxy) { return; } broadPhase.DestroyProxy(_proxyId); AABB aabb; ComputeAABB(out aabb, transform); bool inRange = broadPhase.InRange(aabb); if (inRange) { _proxyId = broadPhase.CreateProxy(aabb, this); } else { _proxyId = PairManager.NullProxy; } }
internal bool Synchronize(BroadPhase broadPhase, XForm transform1, XForm transform2) { bool result; if (this._proxyId == PairManager.NullProxy) { result = false; } else { AABB aabb; this.ComputeSweptAABB(out aabb, transform1, transform2); if (broadPhase.InRange(aabb)) { broadPhase.MoveProxy((int)this._proxyId, aabb); result = true; } else { result = false; } } return result; }
internal bool Synchronize(BroadPhase broadPhase, XForm transform1, XForm transform2) { if (_proxyId == PairManager.NullProxy) { return false; } // Compute an AABB that covers the swept shape (may miss some rotation effect). AABB aabb1, aabb2; _shape.ComputeAABB(out aabb1, transform1); _shape.ComputeAABB(out aabb2, transform2); AABB aabb = new AABB(); aabb.Combine(aabb1, aabb2); if (broadPhase.InRange(aabb)) { broadPhase.MoveProxy(_proxyId, aabb); return true; } else { return false; } }
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; } }
public void Create(BroadPhase broadPhase, Body body, XForm xf, FixtureDef def) { UserData = def.UserData; Friction = def.Friction; Restitution = def.Restitution; Density = def.Density; _body = body; _next = null; Filter = def.Filter; _isSensor = def.IsSensor; _type = def.Type; // Allocate and initialize the child shape. switch (_type) { case ShapeType.CircleShape: { CircleShape circle = new CircleShape(); CircleDef circleDef = (CircleDef)def; circle._position = circleDef.LocalPosition; circle._radius = circleDef.Radius; _shape = circle; } break; case ShapeType.PolygonShape: { PolygonShape polygon = new PolygonShape(); PolygonDef polygonDef = (PolygonDef)def; polygon.Set(polygonDef.Vertices, polygonDef.VertexCount); _shape = polygon; } break; case ShapeType.EdgeShape: { EdgeShape edge = new EdgeShape(); EdgeDef edgeDef = (EdgeDef)def; edge.Set(edgeDef.Vertex1, edgeDef.Vertex2); _shape = edge; } break; default: Box2DXDebug.Assert(false); break; } // Create proxy in the broad-phase. AABB aabb; _shape.ComputeAABB(out aabb, xf); bool inRange = broadPhase.InRange(aabb); // You are creating a shape outside the world box. Box2DXDebug.Assert(inRange); if (inRange) { _proxyId = broadPhase.CreateProxy(aabb, this); } else { _proxyId = PairManager.NullProxy; } }