case PhysicsShapes.Circle: Vector3 Norm = new Vector3(); Vector3 Norm1 = new Vector3(); Vector3 Norm2 = new Vector3(); Vector3 Tang1 = new Vector3(); Vector3 Tang2 = new Vector3(); Norm = cObject.position - this.position; Norm.Normalize(); Norm1 = (Vector3.Dot(velocity, -Norm)) * -Norm; Norm2 = (Vector3.Dot(cObject.velocity, Norm)) * Norm; Tang1 = velocity - Norm1; Tang2 = cObject.velocity - Norm2; mVector1 = Norm2 + Tang1; mVector2 = Norm1 + Tang2; if (Norm1.X == 0 && Norm1.Y == 0) mVector2 = mVector1; else if (Norm2.X == 0 && Norm2.Y == 0) mVector1 = mVector2; mVector1.Normalize(); mVector2.Normalize(); float MyVel1 = ((((mElasticCoefficient + 1) * cObject.mMass * -cObject.velocity.Length()) + (velocity.Length() * (mMass - (mElasticCoefficient * cObject.mMass)))) / (mMass + cObject.mMass)); float MyVel2 = ((((cObject.mElasticCoefficient + 1) * mMass * velocity.Length()) + (-cObject.velocity.Length() * (cObject.mMass - (cObject.mElasticCoefficient * mMass)))) / (mMass + cObject.mMass)); mVector1.Scale(Math.Abs(MyVel1)); mVector2.Scale(Math.Abs(MyVel2)); velocity = mVector1; //* MyVel1; cObject.velocity = mVector2; //* MyVel2; break;