29#ifndef GU_INTERSECTION_RAY_CAPSULE_H
30#define GU_INTERSECTION_RAY_CAPSULE_H
33#include "GuDistancePointSegment.h"
34#include "GuIntersectionRay.h"
40 PxU32 intersectRayCapsuleInternal(
const PxVec3& origin,
const PxVec3& dir,
const PxVec3& p0,
const PxVec3& p1,
float radius, PxReal s[2]);
42 PX_FORCE_INLINE bool intersectRayCapsule(
const PxVec3& origin,
const PxVec3& dir,
const PxVec3& p0,
const PxVec3& p1,
float radius, PxReal& t)
48 PxReal l = distancePointSegmentSquaredInternal(p0, p1 - p0, origin);
62 if(l>GU_RAY_SURFACE_OFFSET)
63 l -= GU_RAY_SURFACE_OFFSET;
69 const PxU32 nbHits = Gu::intersectRayCapsuleInternal(origin + l*dir, dir, p0, p1, radius, s);
77 t = (s[0] < s[1]) ? s[0] : s[1];
84 PX_FORCE_INLINE bool intersectRayCapsule(
const PxVec3& origin,
const PxVec3& dir,
const Gu::Capsule& capsule, PxReal& t)
86 return Gu::intersectRayCapsule(origin, dir, capsule.p0, capsule.p1, capsule.radius, t);
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxSqrt(float a)
Square root.
Definition PxMath.h:146