UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Point.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Core/Types.h"
5#include "Math/MathConst.h"
6
7namespace UE::CADKernel
8{
9
11
13{
14public:
17
18 static FVector2d FromVector(const FVector& Src)
19 {
20 return FVector2d(Src.X, Src.Y);
21 }
22
23 template<typename VectorType>
24 static double ComputeCosinus(const VectorType& Vec1, const VectorType& Vec2)
25 {
26 VectorType ThisNormalized(Vec1);
27 VectorType OtherNormalized(Vec2);
28
29 ThisNormalized.Normalize();
30 OtherNormalized.Normalize();
31
32 const double Cosinus = ThisNormalized | OtherNormalized;
33
34 return FMath::Max(-1.0, FMath::Min(Cosinus, 1.0));
35 }
36
37 template<typename VectorType>
38 static double ComputeAngle(const VectorType& Vec1, const VectorType& Vec2)
39 {
40 VectorType ThisNormalized(Vec1);
41 VectorType OtherNormalized(Vec2);
42
43 ThisNormalized.Normalize();
44 OtherNormalized.Normalize();
45
46 return FMath::Acos(ThisNormalized | OtherNormalized);
47 }
48
53 static double DiagonalAxisCoordinate(const FVector& Vec)
54 {
55 return Vec.X + Vec.Y + Vec.Z;
56 }
57
58 static double DiagonalAxisCoordinate(const FVector2d& Vec)
59 {
60 return Vec.X + Vec.Y;
61 }
62};
63
64}
65
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::Math::TVector2< double > FVector2d
Definition MathFwd.h:61
Definition Point.h:13
static FVector2d FromVector(const FVector &Src)
Definition Point.h:18
static double DiagonalAxisCoordinate(const FVector &Vec)
Definition Point.h:53
static CADKERNEL_API const FVector FarawayPoint3D
Definition Point.h:15
static double ComputeAngle(const VectorType &Vec1, const VectorType &Vec2)
Definition Point.h:38
static double ComputeCosinus(const VectorType &Vec1, const VectorType &Vec2)
Definition Point.h:24
static CADKERNEL_API const FVector2d FarawayPoint2D
Definition Point.h:16
static double DiagonalAxisCoordinate(const FVector2d &Vec)
Definition Point.h:58
Definition CADEntity.cpp:23
FVector2d FSurfacicTolerance
Definition Point.h:10
T Y
Definition Vector.h:65
T X
Definition Vector.h:62