Go to the source code of this file.
◆ RaySphere() [1/2]
Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection against a sphere,
- Returns
- FLT_MAX if there is no intersection, otherwise the fraction along the ray.
- Parameters
-
inRayOrigin | Ray origin. If the ray starts inside the sphere, the returned fraction will be 0. |
inRayDirection | Ray direction. Does not need to be normalized. |
inSphereCenter | Position of the center of the sphere |
inSphereRadius | Radius of the sphere |
◆ RaySphere() [2/2]
JPH_INLINE int RaySphere |
( |
Vec3Arg |
inRayOrigin, |
|
|
Vec3Arg |
inRayDirection, |
|
|
Vec3Arg |
inSphereCenter, |
|
|
float |
inSphereRadius, |
|
|
float & |
outMinFraction, |
|
|
float & |
outMaxFraction |
|
) |
| |
Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection against a sphere. Outputs entry and exit points (outMinFraction and outMaxFraction) along the ray (which could be negative if the hit point is before the start of the ray).
- Parameters
-
inRayOrigin | Ray origin. If the ray starts inside the sphere, the returned fraction will be 0. |
inRayDirection | Ray direction. Does not need to be normalized. |
inSphereCenter | Position of the center of the sphere. |
inSphereRadius | Radius of the sphere. |
outMinFraction | Returned lowest intersection fraction |
outMaxFraction | Returned highest intersection fraction |
- Returns
- The amount of intersections with the sphere. If 1 intersection is returned outMinFraction will be equal to outMaxFraction