# Chaos::GJKRaycast2

## Sweeps one geometry against the other The first geometry The second geometry B's starting configuration in A's local space The ray's direction (normalized) The ray's length The time along the ray when the objects first overlap The first point of impact (in A's local space) when the objects first overlap.

References

 Module Header /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/GJK.h Include #include "Chaos/GJK.h"

Syntax

namespace Chaos
{
template<typename T, typename TGeometryA, typename TGeometryB>
bool Chaos::GJKRaycast2
(
const TGeometryA & A,
const TGeometryB & B,
const TRigidTransform < T, 3 > & StartTM,
const TVector < T, 3 > & RayDir,
const T RayLength,
T & OutTime,
TVector < T, 3 > & OutPosition,
TVector < T, 3 > & OutNormal,
const T GivenThicknessA,
bool bComputeMTD,
const TVector < T, 3 > & InitialDir,
const T GivenThicknessB
)
}

Remarks

Sweeps one geometry against the other The first geometry The second geometry B's starting configuration in A's local space The ray's direction (normalized) The ray's length The time along the ray when the objects first overlap The first point of impact (in A's local space) when the objects first overlap. Invalid if time of impact is 0 The impact normal (in A's local space) when the objects first overlap. Invalid if time of impact is 0 The amount of geometry inflation for Geometry A (for example a capsule with radius 5 could pass in its core segnment and a thickness of 5) The first direction we use to search the CSO The amount of geometry inflation for Geometry B (for example a sphere with radius 5 could pass in its center point and a thickness of 5)

If A overlaps B at the start of the ray ("initial overlap" condition) then this function returns true, and sets OutTime = 0, but does not set any other output variables.

Returns

True if the geometries overlap during the sweep, False otherwise

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.