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

Go to the source code of this file.

Functions

JPH_NAMESPACE_BEGIN JPH_INLINE float RayCylinder (Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCylinderRadius)
 
JPH_INLINE float RayCylinder (Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCylinderHalfHeight, float inCylinderRadius)
 

Function Documentation

◆ RayCylinder() [1/2]

JPH_INLINE float RayCylinder ( Vec3Arg  inRayOrigin,
Vec3Arg  inRayDirection,
float  inCylinderHalfHeight,
float  inCylinderRadius 
)

Test a ray against a cylinder 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 cylinder, the returned fraction will be 0.
inCylinderRadiusRadius of the cylinder
inCylinderHalfHeightDistance from the origin to the top (or bottom) of the cylinder

◆ RayCylinder() [2/2]

JPH_NAMESPACE_BEGIN JPH_INLINE float RayCylinder ( Vec3Arg  inRayOrigin,
Vec3Arg  inRayDirection,
float  inCylinderRadius 
)

Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection against an infinite cylinder centered along the Y axis

Returns
FLT_MAX if there is no intersection, otherwise the fraction along the ray.
Parameters
inRayDirectionDirection of the ray. Does not need to be normalized.
inRayOriginOrigin of the ray. If the ray starts inside the cylinder, the returned fraction will be 0.
inCylinderRadiusRadius of the infinite cylinder