Skip to content

Commit e19cee4

Browse files
committed
Create Ray3n+Compatibility.swift
1 parent 0b8728c commit e19cee4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright © 2025 Dustin Collins (Strega's Gate)
3+
* All Rights Reserved.
4+
*
5+
* http://stregasgate.com
6+
*/
7+
8+
public extension Ray3n where Scalar: BinaryInteger {
9+
var oldRay: Ray3D {
10+
return Ray3D(from: self.origin.oldVector, toward: self.direction.oldVector)
11+
}
12+
}
13+
14+
public extension Ray3n where Scalar: BinaryFloatingPoint {
15+
var oldRay: Ray3D {
16+
return Ray3D(from: self.origin.oldVector, toward: self.direction.oldVector)
17+
}
18+
}
19+
20+
public extension Ray3n where Scalar: BinaryFloatingPoint {
21+
init(oldRay ray: Ray3D) {
22+
self.init(origin: .init(oldVector: ray.origin), direction: .init(oldVector: ray.direction))
23+
}
24+
}

0 commit comments

Comments
 (0)