Vector2DTests ReflectIfHittingBorderAtCorners Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Datatypes
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ReflectIfHittingBorderAtCorners()
Examples

[Test]
public void ReflectIfHittingBorderAtCorners()
{
    var direction = Vector2D.One;
    var borders = Rectangle.One;
    var bottomRightArea = new Rectangle(Vector2D.One, Size.Half);
    direction.ReflectIfHittingBorder(bottomRightArea, borders);
    Assert.AreEqual(-Vector2D.One, direction);
    var topLeftArea = new Rectangle(Vector2D.Zero, Size.Zero);
    direction.ReflectIfHittingBorder(topLeftArea, borders);
    Assert.AreEqual(Vector2D.One, direction);
}
See Also