Class Raycast2D
Inherited Members
Namespace: Genesis.Physics
Assembly: Genesis.dll
Syntax
public class Raycast2D
Constructors
Raycast2D()
Declaration
public Raycast2D()
Methods
RayIntersects(Ray2D, Vec3, Vec3, out Vec3)
Performs the actual intersection test between a 2D ray and an AABB defined by its minimum and maximum points.
Declaration
public static bool RayIntersects(Ray2D ray, Vec3 min, Vec3 max, out Vec3 intersectionPoint)
Parameters
Type | Name | Description |
---|---|---|
Ray2D | ray | The 2D ray to test. |
Vec3 | min | The minimum point of the AABB. |
Vec3 | max | The maximum point of the AABB. |
Vec3 | intersectionPoint | If there is an intersection, this will contain the intersection point. |
Returns
Type | Description |
---|---|
bool | True if the ray intersects with the AABB, false otherwise. |
RayIntersectsAABB(Ray2D, Aabb, out Vec3)
Checks if a 2D ray intersects with an Axis-Aligned Bounding Box (AABB).
Declaration
public static bool RayIntersectsAABB(Ray2D ray, Aabb aabb, out Vec3 intersectionPoint)
Parameters
Type | Name | Description |
---|---|---|
Ray2D | ray | The 2D ray to test. |
Aabb | aabb | The AABB defined by its minimum and maximum points. |
Vec3 | intersectionPoint | If there is an intersection, this will contain the intersection point. |
Returns
Type | Description |
---|---|
bool | True if the ray intersects with the AABB, false otherwise. |