diff --git a/Mintfile b/Mintfile index ed0f2d2..2afd9bd 100644 --- a/Mintfile +++ b/Mintfile @@ -1,2 +1,2 @@ -realm/SwiftLint@0.63.2 -nicklockwood/SwiftFormat@0.59.1 \ No newline at end of file +realm/SwiftLint@0.65.0 +nicklockwood/SwiftFormat@0.62.1 \ No newline at end of file diff --git a/Sources/FirebladeMath/Functions/remap.swift b/Sources/FirebladeMath/Functions/remap.swift index f0f3b97..63be498 100644 --- a/Sources/FirebladeMath/Functions/remap.swift +++ b/Sources/FirebladeMath/Functions/remap.swift @@ -7,7 +7,8 @@ extension FloatingPoint { /// - Returns: The remapped value. @inlinable public func remaped(clampingIn rangeClamp: ClosedRange, - to rangeOut: ClosedRange) -> Self { + to rangeOut: ClosedRange) -> Self + { var v = clamped(to: rangeClamp) v = v.lerped(from: rangeClamp, to: rangeOut) return v @@ -19,7 +20,8 @@ extension FloatingPoint { /// - rangeOut: The output range to map to. @inlinable public mutating func remap(clampingIn rangeClamp: ClosedRange, - to rangeOut: ClosedRange) { + to rangeOut: ClosedRange) + { clamp(to: rangeClamp) lerp(from: rangeClamp, to: rangeOut) } diff --git a/Sources/FirebladeMath/Matrix/MatrixStorage+SIMD.swift b/Sources/FirebladeMath/Matrix/MatrixStorage+SIMD.swift index 8cb7a08..c470fad 100644 --- a/Sources/FirebladeMath/Matrix/MatrixStorage+SIMD.swift +++ b/Sources/FirebladeMath/Matrix/MatrixStorage+SIMD.swift @@ -11,7 +11,8 @@ import struct simd.matrix.simd_float4x4 /// Conformance to matrix storage protocols. extension simd_float2x2: Storage2x2Protocol, @retroactive @unchecked Sendable, @retroactive RandomAccessCollection, @retroactive MutableCollection, @retroactive RangeReplaceableCollection, @retroactive BidirectionalCollection, @retroactive Collection, - @retroactive Sequence { + @retroactive Sequence +{ /// The element type of the matrix storage. public typealias Element = Float /// The column vector type of the matrix. @@ -58,7 +59,8 @@ extension simd_float2x2: Storage2x2Protocol, @retroactive @unchecked Sendable, @ /// Conformance to matrix storage protocols. extension simd_double2x2: Storage2x2Protocol, @retroactive @unchecked Sendable, @retroactive RandomAccessCollection, @retroactive MutableCollection, @retroactive RangeReplaceableCollection, @retroactive BidirectionalCollection, @retroactive Collection, - @retroactive Sequence { + @retroactive Sequence +{ /// The element type of the matrix storage. public typealias Element = Double /// The column vector type of the matrix. @@ -107,7 +109,8 @@ extension simd_double2x2: Storage2x2Protocol, @retroactive @unchecked Sendable, /// Conformance to matrix storage protocols. extension simd_float3x3: Storage3x3Protocol, @retroactive @unchecked Sendable, @retroactive RandomAccessCollection, @retroactive MutableCollection, @retroactive RangeReplaceableCollection, @retroactive BidirectionalCollection, @retroactive Collection, - @retroactive Sequence { + @retroactive Sequence +{ /// The element type of the matrix storage. public typealias Element = Float /// The column vector type of the matrix. @@ -160,7 +163,8 @@ extension simd_float3x3: Storage3x3Protocol, @retroactive @unchecked Sendable, @ /// Conformance to matrix storage protocols. extension simd_double3x3: Storage3x3Protocol, @retroactive @unchecked Sendable, @retroactive RandomAccessCollection, @retroactive MutableCollection, @retroactive RangeReplaceableCollection, @retroactive BidirectionalCollection, @retroactive Collection, - @retroactive Sequence { + @retroactive Sequence +{ /// The element type of the matrix storage. public typealias Element = Double /// The column vector type of the matrix. @@ -215,7 +219,8 @@ extension simd_double3x3: Storage3x3Protocol, @retroactive @unchecked Sendable, /// Conformance to matrix storage protocols. extension simd_float4x4: Storage4x4Protocol, @retroactive @unchecked Sendable, @retroactive RandomAccessCollection, @retroactive MutableCollection, @retroactive RangeReplaceableCollection, @retroactive BidirectionalCollection, @retroactive Collection, - @retroactive Sequence { + @retroactive Sequence +{ /// The element type of the matrix storage. public typealias Element = Float /// The column vector type of the matrix. @@ -274,7 +279,8 @@ extension simd_float4x4: Storage4x4Protocol, @retroactive @unchecked Sendable, @ /// Conformance to matrix storage protocols. extension simd_double4x4: Storage4x4Protocol, @retroactive @unchecked Sendable, @retroactive RandomAccessCollection, @retroactive MutableCollection, @retroactive RangeReplaceableCollection, @retroactive BidirectionalCollection, @retroactive Collection, - @retroactive Sequence { + @retroactive Sequence +{ /// The element type of the matrix storage. public typealias Element = Double /// The column vector type of the matrix. diff --git a/Sources/FirebladeMath/Quat/Quat4f+Euler.swift b/Sources/FirebladeMath/Quat/Quat4f+Euler.swift index 8fe87e4..8432276 100644 --- a/Sources/FirebladeMath/Quat/Quat4f+Euler.swift +++ b/Sources/FirebladeMath/Quat/Quat4f+Euler.swift @@ -1,20 +1,3 @@ -// https://www.geometrictools.com/Documentation/EulerAngles.pdf -// https://ntrs.nasa.gov/api/citations/19770024290/downloads/19770024290.pdf -// https://marc-b-reynolds.github.io/math/2017/04/18/TaitEuler.html -// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/ -// https://github.com/godotengine/godot/blob/master/core/math/basis.cpp -// https://github.com/LinuxCNC/linuxcnc/blob/master/src/libnml/posemath/_posemath.c -// https://github.com/OGRECave/ogre/blob/84ae9396322a39f766b7acaeb9a1b15f4c51d261/OgreMain/src/OgreMatrix3.cpp#L858 -// https://github.com/g-truc/glm/blob/master/glm/gtx/euler_angles.inl -// https://github.com/bulletphysics/bullet3/blob/abea1a848411cf53385fb8288c89db05e5751ef7/src/Bullet3Common/b3Quaternion.h#L162 -// https://github.com/demianmnave/CML/blob/9ebc0ed72637959fe7323d2a6a12664236509031/cml/mathlib/quaternion/rotation.h#L101 -// http://de.mathworks.com/matlabcentral/fileexchange/20696-function-to-convert-between-dcm--euler-angles--quaternions--and-euler-vectors -// https://scholar.google.de/scholar?cluster=3204262265835591787 -// http://de.mathworks.com/help/robotics/ref/quat2eul.html -// https://math.stackexchange.com/a/1803746 -// https://hanspeterschaub.info/AVS-Code.html -// https://marc-b-reynolds.github.io/math/2017/04/18/TaitEuler.html - extension Quat4f { // public static func fromEulerAngles_121(_ e: Vec3f) -> Quat4f { // let e1 = e.x / 2