Table of Contents

Class MeshRaycast

Namespace
LibGFX.Physics
Assembly
LibGFX.dll

Class for performing raycasts against a mesh without using a physics engine.

public class MeshRaycast
Inheritance
MeshRaycast
Inherited Members

Methods

IntersectsAABB(MeshRay, AABB, out float, out float)

Checks if a ray intersects with an Axis-Aligned Bounding Box (AABB).

public static bool IntersectsAABB(MeshRay ray, AABB aabb, out float tMin, out float tMax)

Parameters

ray MeshRay
aabb AABB
tMin float
tMax float

Returns

bool

IntersectsMesh(MeshRay, Transform, Mesh)

Checks if a ray intersects with a mesh by transforming the mesh vertices and checking each triangle.

public static MeshRayHit IntersectsMesh(MeshRay ray, Transform transform, Mesh mesh)

Parameters

ray MeshRay
transform Transform
mesh Mesh

Returns

MeshRayHit

PerformRaycast(MeshRay, Transform, AABB, Mesh)

Performs a raycast against a mesh, checking for intersection with an AABB first.

public static MeshRayHit PerformRaycast(MeshRay ray, Transform transform, AABB aabb, Mesh mesh)

Parameters

ray MeshRay
transform Transform
aabb AABB
mesh Mesh

Returns

MeshRayHit

ScreenPointToWorldRay(PerspectiveCamera, Viewport, float, float)

Converts screen coordinates to a world ray using the camera's projection and view matrices.

public static MeshRay ScreenPointToWorldRay(PerspectiveCamera camera, Viewport viewport, float mouseX, float mouseY)

Parameters

camera PerspectiveCamera
viewport Viewport
mouseX float
mouseY float

Returns

MeshRay