Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
RayCapsule.h File Reference

Go to the source code of this file.

Functions

JPH_NAMESPACE_BEGIN JPH_INLINE float RayCapsule (Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCapsuleHalfHeight, float inCapsuleRadius)
 

Function Documentation

◆ RayCapsule()

JPH_NAMESPACE_BEGIN JPH_INLINE float RayCapsule ( Vec3Arg  inRayOrigin,
Vec3Arg  inRayDirection,
float  inCapsuleHalfHeight,
float  inCapsuleRadius 
)

Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection against a capsule centered around the origin with its axis along the Y axis and half height specified.

Returns
FLT_MAX if there is no intersection, otherwise the fraction along the ray.
Parameters
inRayDirectionRay direction. Does not need to be normalized.
inRayOriginOrigin of the ray. If the ray starts inside the capsule, the returned fraction will be 0.
inCapsuleHalfHeightDistance from the origin to the center of the top sphere (or that of the bottom)
inCapsuleRadiusRadius of the top/bottom sphere