mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
organise maths helpers
This commit is contained in:
12
Sources/Voxelotl/Math/VectorExtensions.swift
Normal file
12
Sources/Voxelotl/Math/VectorExtensions.swift
Normal file
@ -0,0 +1,12 @@
|
||||
extension SIMD3 where Scalar: FloatingPoint {
|
||||
@inline(__always) static var X: Self { Self(1, 0, 0) }
|
||||
@inline(__always) static var Y: Self { Self(0, 1, 0) }
|
||||
@inline(__always) static var Z: Self { Self(0, 0, 1) }
|
||||
|
||||
@inline(__always) static var up: Self { Y }
|
||||
@inline(__always) static var down: Self { -Y }
|
||||
@inline(__always) static var left: Self { -X }
|
||||
@inline(__always) static var right: Self { X }
|
||||
@inline(__always) static var forward: Self { -Z }
|
||||
@inline(__always) static var back: Self { Z }
|
||||
}
|
Reference in New Issue
Block a user