MathExtensions.PointInQuad
Declaration#
public static bool PointInQuad(Vector2 point, Vector2 topLeft, Vector2 topRight, Vector2 bottomLeft, Vector2 bottomRight)Parameters#
| Name | Description |
|---|---|
| point | Point to check |
| topLeft | Quad's top-left |
| topRight | Quad's top-right |
| bottomLeft | Quad's bottom-left |
| bottomRight | Quad'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)); }
}