UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CoreSphere.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Chaos/Core.h"
5#include "Chaos/Raycasts.h"
6
7namespace Chaos
8{
9 template<class T, int d>
11 {
12 public:
13 TCoreSphere() = default;
14 TCoreSphere(const TCoreSphere&) = default;
17 : Center(InCenter)
18 , Radius(FRealSingle(InRadius))
19 {
20 }
21
22 TCoreSphere& operator=(const TCoreSphere&) = default;
24
26 {
27 return Radius;
28 }
29
31 {
32 Radius = InRadius;
33 }
34
35 const FVec3f& GetCenter() const
36 {
37 return Center;
38 }
39
41 {
42 Center = InCenter;
43 }
44
45 bool Raycast(const TVector<T, d>& StartPoint, const TVector<T, d>& Dir, const T Length, const T Thickness, T& OutTime, TVector<T, d>& OutPosition, TVector<T, d>& OutNormal) const
46 {
47 return Raycasts::RaySphere(StartPoint, Dir, Length, Thickness, Center, GetRadius(), OutTime, OutPosition, OutNormal);
48 }
49
50 private:
51 FVec3f Center;
52 FRealSingle Radius;
53 };
54
57} // namespace Chaos
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition CoreSphere.h:11
bool Raycast(const TVector< T, d > &StartPoint, const TVector< T, d > &Dir, const T Length, const T Thickness, T &OutTime, TVector< T, d > &OutPosition, TVector< T, d > &OutNormal) const
Definition CoreSphere.h:45
FRealSingle GetRadius() const
Definition CoreSphere.h:25
void SetCenter(const FVec3f &InCenter)
Definition CoreSphere.h:40
TCoreSphere(const TCoreSphere &)=default
TCoreSphere(TCoreSphere &&)=default
TCoreSphere & operator=(const TCoreSphere &)=default
const FVec3f & GetCenter() const
Definition CoreSphere.h:35
TCoreSphere()=default
void SetRadius(const FRealSingle InRadius)
Definition CoreSphere.h:30
TCoreSphere(const TVector< T, d > &InCenter, const T InRadius)
Definition CoreSphere.h:16
TCoreSphere & operator=(TCoreSphere &&)=default
Definition Vector.h:407
Definition Vector.h:41
bool RaySphere(const TVector< T, d > &RayStart, const TVector< T, d > &RayDir, const T RayLength, const T RayThickness, const FVec3f &SphereCenter, const FRealSingle SphereRadius, T &OutTime, TVector< T, d > &OutPosition, TVector< T, d > &OutNormal)
Definition Raycasts.h:72
Definition SkeletalMeshComponent.h:307
float FRealSingle
Definition Real.h:14