示例#1
0
        private void RemoveBodyInternal(VoltBody body)
        {
            this.bodies.Remove(body);
            if (body.IsStatic)
            {
                this.staticBroadphase.RemoveBody(body);
            }
            else
            {
                this.dynamicBroadphase.RemoveBody(body);
            }

            body.FreeHistory();
            body.AssignWorld(null);
        }
示例#2
0
        private void AddBodyInternal(VoltBody body)
        {
            this.bodies.Add(body);
            if (body.IsStatic)
            {
                this.staticBroadphase.AddBody(body);
            }
            else
            {
                this.dynamicBroadphase.AddBody(body);
            }

            body.AssignWorld(this);
            if ((this.HistoryLength > 0) && (body.IsStatic == false))
            {
                body.AssignHistory(this.AllocateHistory());
            }
        }