示例#1
0
        public virtual void DoAddBody(CCPhysicsBody body)
        {
            if (body.IsEnabled())
            {
                //is gravity enable
                if (!body.IsGravityEnabled())
                {
                    body.ApplyForce(-_gravity * body.GetMass());
                }

                // add body to space
                if (body.IsDynamic())
                {
                    Info.AddBody(body._info);
                }

                // add shapes to space
                foreach (CCPhysicsShape shape in body.GetShapes())
                {
                    AddShape(shape);
                }
            }
        }