2019-12-27 09:26:59 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2019-09-10 11:35:20 -04:00
|
|
|
|
2019-09-16 11:50:08 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-09-10 11:35:20 -04:00
|
|
|
#include "VectorTypes.h"
|
|
|
|
|
#include "LineTypes.h"
|
|
|
|
|
#include "CircleTypes.h"
|
|
|
|
|
|
2020-09-01 14:07:48 -04:00
|
|
|
THIRD_PARTY_INCLUDES_START
|
|
|
|
|
#include "ThirdParty/GTEngine/Mathematics/GteVector2.h"
|
2019-09-10 11:35:20 -04:00
|
|
|
#include "ThirdParty/GTEngine/Mathematics/GteVector3.h"
|
|
|
|
|
#include "ThirdParty/GTEngine/Mathematics/GteLine.h"
|
|
|
|
|
#include "ThirdParty/GTEngine/Mathematics/GteCircle3.h"
|
2020-09-01 14:07:48 -04:00
|
|
|
THIRD_PARTY_INCLUDES_END
|
2019-09-10 11:35:20 -04:00
|
|
|
|
2021-03-09 19:33:56 -04:00
|
|
|
namespace UE
|
|
|
|
|
{
|
|
|
|
|
namespace Geometry
|
|
|
|
|
{
|
|
|
|
|
|
2020-09-01 14:07:48 -04:00
|
|
|
template<typename Real>
|
|
|
|
|
gte::Vector2<Real> Convert(const FVector2<Real>& Vec)
|
|
|
|
|
{
|
|
|
|
|
return gte::Vector2<Real>({ Vec.X, Vec.Y});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename Real>
|
|
|
|
|
FVector2<Real> Convert(const gte::Vector2<Real>& Vec)
|
|
|
|
|
{
|
|
|
|
|
return FVector2<Real>(Vec[0], Vec[1]);
|
|
|
|
|
}
|
2019-09-10 11:35:20 -04:00
|
|
|
|
|
|
|
|
template<typename Real>
|
|
|
|
|
gte::Vector3<Real> Convert(const FVector3<Real>& Vec)
|
|
|
|
|
{
|
|
|
|
|
return gte::Vector3<Real>({ Vec.X, Vec.Y, Vec.Z });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename Real>
|
|
|
|
|
FVector3<Real> Convert(const gte::Vector3<Real>& Vec)
|
|
|
|
|
{
|
|
|
|
|
return FVector3<Real>(Vec[0], Vec[1], Vec[2]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename Real>
|
|
|
|
|
gte::Line3<Real> Convert(const TLine3<Real>& Line)
|
|
|
|
|
{
|
|
|
|
|
return gte::Line3<Real>(Convert(Line.Origin), Convert(Line.Direction));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename Real>
|
|
|
|
|
gte::Circle3<Real> Convert(const TCircle3<Real>& Circle)
|
|
|
|
|
{
|
|
|
|
|
return gte::Circle3<Real>(
|
|
|
|
|
Convert(Circle.Frame.Origin), Convert(Circle.GetNormal()), Circle.Radius);
|
|
|
|
|
}
|
2021-03-09 19:33:56 -04:00
|
|
|
|
|
|
|
|
} // end namespace UE::Geometry
|
|
|
|
|
} // end namespace UE
|