Example #1
0
            /// <summary>
            /// Adds the given Vollider to its corresponding collection.
            /// </summary>
            /// <param name="collider">The Collider to be added.</param>
            public void Add(Collider collider)
            {
                switch (collider.GetDerivedType())
                {
                case Collider.Derived.Sphere:
                    spheres.Add(collider as SphereCollider);
                    break;

                case Collider.Derived.Plane:
                    planes.Add(collider as PlaneCollider);
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
Example #2
0
 /// <summary>
 /// Attaches a Collider to the Rigidbody, this causes a reset of the inertia tensor.
 /// </summary>
 /// <param name="collider">The collider to be attached.</param>
 public void Attach(Collider collider)
 {
     m_colliders.Add(collider);
     ResetInertiaTensor();
     ResetCentreOfMass();
 }
Example #3
0
 /// <summary>
 /// Registers the given Rigidbody to be simulated by the system. This will cause forces to apply which will
 /// cause the attached GameObject to move and rotate freely.
 /// </summary>
 /// <param name="rigidbody">The Rigidbody to be registered.</param>
 public override void Register(Rigidbody rigidbody)
 {
     m_rigidbodies.Add(rigidbody);
 }