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)
2
2
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
5
5
w,h = a. width/ T (2 ), a. length
6
6
m = Vec {3,T} (a. middle)
7
7
B (m- Vec {3,T} (w,w,0 ), m+ Vec {3,T} (w, w, h))
8
8
end
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 ]))
12
12
13
13
14
- function (B:: Type{AABB{T}} ){T} (
14
+ function (B:: Type{AABB{T}} )(
15
15
positions, scale, rotation,
16
16
primitive:: AABB{T}
17
- )
17
+ ) where T
18
18
19
19
ti = TransformationIterator (positions, scale, rotation)
20
20
B (ti, primitive)
21
21
end
22
- function (B:: Type{AABB{T}} ){T} (instances:: Instances )
22
+ function (B:: Type{AABB{T}} )(instances:: Instances ) where T
23
23
ti = TransformationIterator (instances)
24
24
B (ti, B (instances. primitive))
25
25
end
@@ -38,9 +38,9 @@ function transform(translation, scale, rotation, points)
38
38
AABB {Float32} (_min, _max- _min)
39
39
end
40
40
41
- function (B:: Type{AABB{T}} ){T} (
41
+ function (B:: Type{AABB{T}} )(
42
42
ti:: TransformationIterator , primitive:: AABB{T}
43
- )
43
+ ) where T
44
44
state = start (ti)
45
45
if done (ti, state)
46
46
return primitive
0 commit comments