// These support body activation/deactivation. internal void CreateProxies(BroadPhase broadPhase, Transform xf) //broadPhase was pointer { Utilities.Assert(m_proxies.Count() == 0); // Create proxies in the broad-phase. int m_proxyCount = m_shape.GetChildCount(); for (int i = 0; i < m_proxyCount; ++i) { FixtureProxy proxy = new FixtureProxy(); m_shape.ComputeAABB(out proxy.aabb, xf, i); proxy.proxyId = broadPhase.CreateProxy(proxy.aabb, proxy); proxy.fixture = this; proxy.childIndex = i; m_proxies.Add(proxy); } }
// We need separation create/destroy functions from the constructor/destructor because // the destructor cannot access the allocator (no destructor arguments allowed by C++). internal void Create(Body body, FixtureDef def) { m_userData = def.UserData; m_friction = def.friction; m_restitution = def.restitution; m_body = body; m_next = null; m_filter = def.Filter; m_isSensor = def.IsSensor; m_shape = def.shape.Clone(); // Reserve proxy space int childCount = m_shape.GetChildCount(); m_proxies = new List <FixtureProxy>(); m_Density = def.Density; }
// We need separation create/destroy functions from the constructor/destructor because // the destructor cannot access the allocator (no destructor arguments allowed by C++). internal void Create(Body body, FixtureDef def){ m_userData = def.UserData; m_friction = def.friction; m_restitution = def.restitution; m_body = body; m_next = null; m_filter = def.Filter; m_isSensor = def.IsSensor; m_shape = def.shape.Clone(); // Reserve proxy space int childCount = m_shape.GetChildCount(); m_proxies = new List<FixtureProxy>(); m_Density = def.Density; }