Class MeshRaycast
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
Returns
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
Returns
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
Returns
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
cameraPerspectiveCameraviewportViewportmouseXfloatmouseYfloat