Nez.Portable/ECS/Components/Physics/ArcadeRigidbody.cs
/// <summary>
/// separates two overlapping rigidbodies. Handles the case of either being immovable as well.
/// </summary>
/// <param name="other">Other.</param>
/// <param name="minimumTranslationVector"></param>
separates two overlapping rigidbodies. Handles the case of either being immovable as well.
separates two overlapping rigidbodies . Handles the case of either being immovable as well .
void processOverlap(ArcadeRigidbody other, ref Vector2 minimumTranslationVector)
        {
            if (isImmovable)
            {
                other.entity.transform.position += minimumTranslationVector;
            }
            else if (other.isImmovable)
            {
                entity.transform.position -= minimumTranslationVector;
            }
            else
            {
                entity.transform.position -= minimumTranslationVector * 0.5f;
                other.entity.transform.position += minimumTranslationVector * 0.5f;
            }
        }
void processOverlap ( ArcadeRigidbody other , ref Vector2 minimumTranslationVector ) { if ( isImmovable ) { other . entity . transform . position += minimumTranslationVector ; } else if ( other . isImmovable ) { entity . transform . position -= minimumTranslationVector ; } else { entity . transform . position -= minimumTranslationVector * 0.5f ; other . entity . transform . position += minimumTranslationVector * 0.5f ; } }
separates two overlapping rigidbodies.
separates two overlapping rigidbodies .
other
ArcadeRigidbody
None
Vector2
ref
minimumTranslationVector
None