override protected void AddRoot(IMyReplicable replicable) { System.Diagnostics.Debug.Assert(!replicable.HasToBeChild, "Cannot add children replicables to root!"); m_roots.Add(replicable); BoundingBoxD aabb = replicable.GetAABB(); m_proxies.Add(replicable, m_rootsAABB.AddProxy(ref aabb, replicable, 0)); replicable.OnAABBChanged += OnRootMoved; }
void OnRootMoved(IMyReplicable replicable) { BoundingBoxD aabb = replicable.GetAABB(); m_rootsAABB.MoveProxy(m_proxies[replicable], ref aabb, Vector3D.One); }