blob: dea5a20ceab6973a0eeb68c9e4d5dbbd7563f333 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
using System;
using System.Collections.Generic;
class Program
{
public static void Main()
{
}
private static IEnumerable<float> FindIntersections<TVector>(
IBezier<TVector> bezier,
Ray<TVector> ray,
float epsilon,
Range<float> t1,
int depth) where TVector : IVector<TVector>
{
var bounds = bezier.GetBounds();
if (Intersect.s(ray, bounds))
{
var intersections1 = new float[] { };
var intersections2 = new float[] { };
foreach (var t in intersections1) { yield return t; }
foreach (var t in intersections2) { yield return t; }
}
}
public static class Intersect
{
public static bool s<TVector>(Ray<TVector> ray, BoundingBoxN<TVector> box) where TVector : IVector<TVector>
{
throw new NotImplementedException();
}
}
public struct Range<T>
{
}
public class Ray<TVector> where TVector : IVector<TVector>
{
}
public interface IBezier<TVector>
where TVector : IVector<TVector>
{
BoundingBoxN<TVector> GetBounds();
}
public interface IVector<T> : IEpsilonEquatable<T, float>
where T : IVector<T>
{
}
public interface IEpsilonEquatable<TType, TEpsilon> // ReSharper enable TypeParameterCanBeVariant
{
}
public struct BoundingBoxN<T>
where T : IVector<T>
{
}
}
|