LDKRay
typedef struct LDKRay{
Vec3 origin;
Vec3 direction;
}LDKRay;
typedef struct LDKRay{
Vec3 origin;
Vec3 direction;
}LDKRay;
typedef struct LDKRaycastHit{
Vec3 position;
Vec3 normal;
float distance;
u32 triangle_index;
}LDKRaycastHit;
Compute the 3D position along a ray at the specified distance.
LDK_API Vec3 ldk_ray_at(
LDKRay ray,
float distance
);
LDKRay rayfloat distanceThe requested value.
Construct a 3D ray from origin and direction.
LDK_API bool ldk_ray_make(
Vec3 origin,
Vec3 direction,
LDKRay *out_ray
);
Vec3 originVec3 directionLDKRay *out_rayTrue if the operation succeeds; false otherwise.
Transform a ray using a matrix.
LDK_API bool ldk_ray_transform(
LDKRay ray,
Mat4 transform,
LDKRay *out_ray
);
True if the operation succeeds; false otherwise.
Test the intersection of a ray with a plane.
LDK_API bool ldk_raycast_plane(
LDKRay ray,
Vec3 plane_point,
Vec3 plane_normal,
LDKRaycastHit *out_hit
);
LDKRay rayVec3 plane_pointVec3 plane_normalLDKRaycastHit *out_hitTrue if the operation succeeds; false otherwise.
Test the intersection of a ray with a triangle.
LDK_API bool ldk_raycast_triangle(
LDKRay ray,
Vec3 a,
Vec3 b,
Vec3 c,
LDKRaycastHit *out_hit
);
LDKRay rayVec3 aVec3 bVec3 cLDKRaycastHit *out_hitTrue if the operation succeeds; false otherwise.