1- AbsoluteRectangle {N,T} (mini:: Vec{N,T} , maxi:: Vec{N,T} ) = HyperRectangle {N,T} (mini, maxi- mini)
1+ AbsoluteRectangle (mini:: Vec{N,T} , maxi:: Vec{N,T} ) where {N,T} = HyperRectangle {N,T} (mini, maxi- mini)
22
3- ( :: Type{ AABB} ) (a) = AABB {Float32} (a)
4- function (B:: Type{AABB{T}} ){T} (a:: Pyramid )
3+ AABB (a) = AABB {Float32} (a)
4+ function (B:: Type{AABB{T}} )(a:: Pyramid ) where T
55 w,h = a. width/ T (2 ), a. length
66 m = Vec {3,T} (a. middle)
77 B (m- Vec {3,T} (w,w,0 ), m+ Vec {3,T} (w, w, h))
88end
9- (B:: Type{AABB{T}} ){T} (a:: Cube ) = B (origin (a), widths (a))
10- (B:: Type{AABB{T}} ){T} (a:: AbstractMesh ) = B (vertices (a))
11- (B:: Type{AABB{T}} ){T} (a:: NativeMesh ) = B (gpu_data (a. data[:vertices ]))
9+ (B:: Type{AABB{T}} )(a:: Cube ) where {T} = B (origin (a), widths (a))
10+ (B:: Type{AABB{T}} )(a:: AbstractMesh ) where {T} = B (vertices (a))
11+ (B:: Type{AABB{T}} )(a:: NativeMesh ) where {T} = B (gpu_data (a. data[:vertices ]))
1212
1313
14- function (B:: Type{AABB{T}} ){T} (
14+ function (B:: Type{AABB{T}} )(
1515 positions, scale, rotation,
1616 primitive:: AABB{T}
17- )
17+ ) where T
1818
1919 ti = TransformationIterator (positions, scale, rotation)
2020 B (ti, primitive)
2121end
22- function (B:: Type{AABB{T}} ){T} (instances:: Instances )
22+ function (B:: Type{AABB{T}} )(instances:: Instances ) where T
2323 ti = TransformationIterator (instances)
2424 B (ti, B (instances. primitive))
2525end
@@ -38,9 +38,9 @@ function transform(translation, scale, rotation, points)
3838 AABB {Float32} (_min, _max- _min)
3939end
4040
41- function (B:: Type{AABB{T}} ){T} (
41+ function (B:: Type{AABB{T}} )(
4242 ti:: TransformationIterator , primitive:: AABB{T}
43- )
43+ ) where T
4444 state = start (ti)
4545 if done (ti, state)
4646 return primitive
0 commit comments