Type Definition steam_audio::ffi::IPLClosestHitCallback [] [src]

type IPLClosestHitCallback = Option<unsafe extern "C" fn(_: *const IPLfloat32, _: *const IPLfloat32, _: IPLfloat32, _: IPLfloat32, _: *mut IPLfloat32, _: *mut IPLfloat32, _: *mut *mut IPLMaterial, _: *mut IPLvoid)>;

A callback that is called to calculate the closest hit along a ray. Strictly speaking, the intersection is calculated with a ray interval (equivalent to a line segment). Any ray interval may have multiple points of intersection with scene geometry; this function must return information about the point of intersection that is closest to the ray's origin.

\param origin Array containing the x, y, z coordinates (in that order) of the ray's origin. \param direction Array containing the x, y, z coordinates (in that order) of a unit-length vector along the ray's direction. \param minDistance The minimum distance from the origin at which an intersection may occur for it to be considered. This function must not return any intersections closer to the origin than this value. \param maxDistance The maximum distance from the origin at which an intersection may occur for it to be considered. This function must not return any intersections farther from the origin than this value. \param hitDistance [out] Distance between the origin and the closest intersection point on the ray. \param hitNormal [out] Array containing the x, y, z coordinates (in that order) of the unit-length surface normal of the geometry at the closest intersection point. \param hitMaterial [out] Address of a pointer to the material properties of the surface at the closest intersection point. The array contains the low-, mid-, and high-frequency absorption coefficients, the scattering coefficient, and the low-, mid-, and high-frequency transmission coefficients, in that order. \param userData Pointer a block of memory containing arbitrary data, specified during the call to \c ::iplSetRayTracerCallbacks.