Ejemplo n.º 1
0
            /// <summary>
            /// Removes the given Collider from its corresponding collection.
            /// </summary>
            /// <returns>Whether the Collider was successfully removed.</returns>
            /// <param name="collider">The Collider to be removed.</param>
            public bool Remove(Collider collider)
            {
                switch (collider.GetDerivedType())
                {
                case Collider.Derived.Sphere:
                    return(spheres.Remove(collider as SphereCollider));

                case Collider.Derived.Plane:
                    return(planes.Remove(collider as PlaneCollider));

                default:
                    throw new NotImplementedException();
                }
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Detaches a Collider from the Rigidbody, this causes a reset of the inertia tensor.
 /// </summary>
 /// <param name="collider">The collider to be detached.</param>
 public void Detach(Collider collider)
 {
     m_colliders.Remove(collider);
     ResetInertiaTensor();
 }