UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IntrRay3OrientedBox3.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "BoxTypes.h"
7#include "OrientedBoxTypes.h"
8#include "VectorUtil.h"
9
10namespace UE
11{
12namespace Geometry
13{
14
15using namespace UE::Math;
16
20template <typename RealType>
22{
23public:
24
36 static bool FindIntersection(
37 const TRay<RealType>& Ray,
39 RealType& RayParamOut)
40 {
41 const TVector<RealType> OriginOffset = Ray.Origin - Box.Frame.Origin;
42
43 const TVector<RealType> Axis0 = Box.Frame.GetAxis(0);
44 const TVector<RealType> Axis1 = Box.Frame.GetAxis(1);
45 const TVector<RealType> Axis2 = Box.Frame.GetAxis(2);
46
51
52 const TVector<RealType> Direction = TVector<RealType>(
56
57 const TRay<RealType> AdjustedRay(Origin, Direction);
58
59 const TAxisAlignedBox3<RealType> AxisAlignedBox(
60 TVector<RealType>(-Box.Extents.X, -Box.Extents.Y, -Box.Extents.Z),
61 TVector<RealType>(Box.Extents.X, Box.Extents.Y, Box.Extents.Z));
62
64 }
65};
66
69
70} // end namespace UE::Geometry
71} // end namespace UE
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
static bool FindIntersection(const TRay< RealType > &Ray, const TAxisAlignedBox3< RealType > &Box, RealType &RayParamOut)
Definition IntrRay3AxisAlignedBox3.h:110
Definition IntrRay3OrientedBox3.h:22
static bool FindIntersection(const TRay< RealType > &Ray, const TOrientedBox3< RealType > &Box, RealType &RayParamOut)
Definition IntrRay3OrientedBox3.h:36
TIntrRay3OrientedBox3< double > FIntrRay3OrientedBox3d
Definition IntrRay3OrientedBox3.h:68
TIntrRay3OrientedBox3< float > FIntrRay3OrientedBox3f
Definition IntrRay3OrientedBox3.h:67
Definition Sphere.cpp:10
Definition AdvancedWidgetsModule.cpp:13
Definition BoxTypes.h:247
Definition OrientedBoxTypes.h:25
Definition Ray.h:19
TVector< T > Origin
Definition Ray.h:24
TVector< T > Direction
Definition Ray.h:27
Definition Vector.h:51