Skip to main content

MathExtensions.PointInQuad

Declaration#

public static bool PointInQuad(Vector2 point, Vector2 topLeft, Vector2 topRight, Vector2 bottomLeft, Vector2 bottomRight)

Parameters#

NameDescription
pointPoint to check
topLeftQuad's top-left
topRightQuad's top-right
bottomLeftQuad's bottom-left
bottomRightQuad's bottom-right

Description#

Check if a point is inside of a quad

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod()    {        Vector2 point = new Vector2(90, 20);        bool result = point.PointInQuad(new Vector2(-100, -100), new Vector2(100, -100), new Vector2(-100, 100), new Vector2(100, 100));    }
}