示例#1
0
    public void ImpartMomentum(MyPhysics otherbody, MyVector3 ContactPoint)
    {
        MyVector3 otherMomentum  = otherbody.GetMomentumAtPoint(ContactPoint); //Get momentum of contact point for the other object
        MyVector3 thisMomentum   = GetMomentumAtPoint(ContactPoint);           //Get momentum of contact point for this object
        MyVector3 SummedMomentum = thisMomentum + otherMomentum;               //Add momentums together

        ApplyMomentum(SummedMomentum);                                         //Apply momentum to object
        otherbody.ApplyMomentum(SummedMomentum);                               //Apply momentum to other object
    }