Skip to content

Commit

Permalink
Fixed Measurement-related @availables for watchOS
Browse files Browse the repository at this point in the history
  • Loading branch information
capnslipp committed Dec 29, 2022
1 parent 5ae7f2f commit e151a84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Sources/Float3x3/Float3x3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extension Float3x3
Float3(0, 0, cosOfAngle) + ((1 - cosOfAngle) * axis.z * axis) + (sinOfAngle * Float3(axis.y, -axis.x, 0))
)
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
@_transparent public init(rotationAngle angleMeasurement:Measurement<UnitAngle>, axis:Float3) {
let angleMeasurement_radians = angleMeasurement.converted(to: .radians)
self.init(rotationAngle: Float(angleMeasurement_radians.value), axis: axis)
Expand Down Expand Up @@ -145,7 +145,7 @@ extension Float3x3

self = rotationsInOrder[2] * rotationsInOrder[1] * rotationsInOrder[0]
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
@_transparent public init(rotationEulerAngles eulerAnglesMeasurements:(x:Measurement<UnitAngle>,y:Measurement<UnitAngle>,z:Measurement<UnitAngle>), order:RotationOrder = .zxy) {
let eulerAnglesMeasurements_radians = (
x: eulerAnglesMeasurements.x.converted(to: .radians),
Expand Down
4 changes: 2 additions & 2 deletions Sources/Float4x4/Float4x4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ extension Float4x4
public init(rotationAngle angle_radians:Float, axis:Float3) {
self.init(Float3x3(rotationAngle: angle_radians, axis: axis))
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
@_transparent public init(rotationAngle angleMeasurement:Measurement<UnitAngle>, axis:Float3) {
self.init(Float3x3(rotationAngle: angleMeasurement, axis: axis))
}

public init(rotationEulerAngles eulerAngles_radians:Float3, order:RotationOrder = .zyx) {
self.init(Float3x3(rotationEulerAngles: eulerAngles_radians, order: order))
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
@_transparent public init(rotationEulerAngles eulerAnglesMeasurements:(x:Measurement<UnitAngle>,y:Measurement<UnitAngle>,z:Measurement<UnitAngle>), order:RotationOrder = .zyx) {
self.init(Float3x3(rotationEulerAngles: eulerAnglesMeasurements, order: order))
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/FloatQuaternion/FloatQuaternion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ extension FloatQuaternion
public init(angle angle_radians:Float, axis:Float3) {
self = FloatQuaternion(simd_quaternion(angle_radians, axis.simdValue))
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
public init(angle angleMeasurement:Measurement<UnitAngle>, axis:Float3) {
let angleRadiansMeasurement = angleMeasurement.converted(to: .radians)
self.init(angle: Float(angleRadiansMeasurement.value), axis: axis)
Expand All @@ -158,7 +158,7 @@ extension FloatQuaternion
self = FloatQuaternion(angle: newValue, axis: existingAxis)
}
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
public var angleMeasurement:Measurement<UnitAngle> {
get { return Measurement<UnitAngle>(value: Double(self.angle), unit: .radians) }
set {
Expand All @@ -179,7 +179,7 @@ extension FloatQuaternion
get { return ( self.angle, self.axis ) }
set { self = FloatQuaternion(angle: newValue.0, axis: newValue.1) }
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
public var angleMeasurementAxis:(Measurement<UnitAngle>, Float3) {
get { return ( self.angleMeasurement, self.axis ) }
set { self = FloatQuaternion(angle: newValue.0, axis: newValue.1) }
Expand All @@ -205,7 +205,7 @@ extension FloatQuaternion

self = rotationsInOrder[2] * rotationsInOrder[1] * rotationsInOrder[0]
}
@available(macOS 10.12, iOS 10.10, tvOS 10.10, *)
@available(macOS 10.12, iOS 10.10, tvOS 10.10, watchOS 3.0, *)
@_transparent public init(eulerAngles eulerAnglesMeasurements:(x:Measurement<UnitAngle>,y:Measurement<UnitAngle>,z:Measurement<UnitAngle>), order:RotationOrder = .zxy) {
let eulerAnglesMeasurements_radians = (
x: eulerAnglesMeasurements.x.converted(to: .radians),
Expand Down

0 comments on commit e151a84

Please sign in to comment.