示例#1
0
 /// <summary>
 /// Removes a <see cref="RigidBody"/> from the world.
 /// </summary>
 /// <param name="body">The body which should be removed.</param>
 /// <returns>Returns false if the body could not be removed from the world.</returns>
 public bool RemoveSpring(Spring spring)
 {
     // remove the body from the world list
     return springs.Remove(spring);
 }
示例#2
0
        /// <summary>
        /// Adds a <see cref="RigidBody"/> to the world.
        /// </summary>
        /// <param name="body">The body which should be added.</param>
        public void AddSpring(Spring spring)
        {
            if (spring == null) throw new ArgumentNullException("body", "body can't be null.");
            if (springs.Contains(spring)) throw new ArgumentException("The body was already added to the world.", "body");

            //events.RaiseAddedRigidBody(body);

            //this.CollisionSystem.AddEntity(body);

            springs.Add(spring);
        }