Update Vector3.cpp

This commit is contained in:
Norite SC
2024-04-03 06:16:46 +02:00
parent f6f1f0023a
commit 58d4bad400

View File

@@ -324,12 +324,6 @@ float Float3::Angle(const Float3& from, const Float3& to)
return Math::Acos(dot);
}
template<>
Float3 Float3::SnapToRotatedGridWithOffset(const Float3& InPoint, const Float3& InCenterPoint, const Float3& InOffset, const Quaternion& InOrientation, const Float3& InGridSize)
{
return (InOrientation * (InOrientation.Conjugated() * Float3::SnapToGrid((InPoint - InCenterPoint), InGridSize) + InOffset)) + InCenterPoint;
}
template<>
Float3 Float3::SnapToGrid(const Float3& pos, const Float3& gridSize)
{
@@ -338,6 +332,12 @@ Float3 Float3::SnapToGrid(const Float3& pos, const Float3& gridSize)
Math::Ceil((pos.Z - (gridSize.Z * 0.5f)) / gridSize.Z) * gridSize.Z);
}
template<>
Float3 Float3::SnapToRotatedGridWithOffset(const Float3& InPoint, const Float3& InCenterPoint, const Float3& InOffset, const Quaternion& InOrientation, const Float3& InGridSize)
{
return (InOrientation * (InOrientation.Conjugated() * Float3::SnapToGrid((InPoint - InCenterPoint), InGridSize) + InOffset)) + InCenterPoint;
}
template<>
Float3 Float3::SnapToRotatedGrid(const Float3& InPoint, const Float3& InCenterPoint, const Quaternion& InOrientation, const Float3& InGridSize)
{
@@ -658,12 +658,6 @@ double Double3::Angle(const Double3& from, const Double3& to)
return Math::Acos(dot);
}
template<>
Double3 Double3::SnapToRotatedGridWithOffset(const Double3& InPoint, const Double3& InCenterPoint, const Double3& InOffset, const Quaternion& InOrientation, const Double3& InGridSize)
{
return (InOrientation * (InOrientation.Conjugated() * Float3::SnapToGrid((InPoint - InCenterPoint), InGridSize) + InOffset)) + InCenterPoint;
}
template<>
Double3 Double3::SnapToGrid(const Double3& pos, const Double3& gridSize)
{
@@ -672,6 +666,12 @@ Double3 Double3::SnapToGrid(const Double3& pos, const Double3& gridSize)
Math::Ceil((pos.Z - (gridSize.Z * 0.5f)) / gridSize.Z) * gridSize.Z);
}
template<>
Double3 Double3::SnapToRotatedGridWithOffset(const Double3& InPoint, const Double3& InCenterPoint, const Double3& InOffset, const Quaternion& InOrientation, const Double3& InGridSize)
{
return (InOrientation * (InOrientation.Conjugated() * Float3::SnapToGrid((InPoint - InCenterPoint), InGridSize) + InOffset)) + InCenterPoint;
}
template<>
Double3 Double3::SnapToRotatedGrid(const Double3& InPoint, const Double3& InCenterPoint, const Quaternion& InOrientation, const Double3& InGridSize)
{
@@ -893,12 +893,6 @@ int32 Int3::Angle(const Int3& from, const Int3& to)
return 0;
}
template<>
Int3 Int3::SnapToRotatedGridWithOffset(const Int3& InPoint, const Int3& InCenterPoint, const Int3& InOffset, const Quaternion& InOrientation, const Int3& InGridSize)
{
return (InOrientation * (InOrientation.Conjugated() * Int3::SnapToGrid((InPoint - InCenterPoint), InGridSize) + InOffset)) + InCenterPoint;
}
template<>
Int3 Int3::SnapToGrid(const Int3& pos, const Int3& gridSize)
{
@@ -907,6 +901,12 @@ Int3 Int3::SnapToGrid(const Int3& pos, const Int3& gridSize)
Math::Ceil((pos.Z - (gridSize.Z * 0.5f)) / gridSize.Z) * gridSize.Z);
}
template<>
Int3 Int3::SnapToRotatedGridWithOffset(const Int3& InPoint, const Int3& InCenterPoint, const Int3& InOffset, const Quaternion& InOrientation, const Int3& InGridSize)
{
return (InOrientation * (InOrientation.Conjugated() * Int3::SnapToGrid((InPoint - InCenterPoint), InGridSize) + InOffset)) + InCenterPoint;
}
template<>
Int3 Int3::SnapToRotatedGrid(const Int3& InPoint, const Int3& InCenterPoint, const Quaternion& InOrientation, const Int3& InGridSize)
{