MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / Sample

Method Sample

Examples/StereoKitTest/DebugToolWindow.cs:50–68  ·  view source on GitHub ↗
(float time)

Source from the content-addressed store, hash-verified

48 }
49
50 T Sample(float time)
51 {
52 if (time <= _frames[0].time)
53 return _frames[0].data;
54 if (time >= _frames[_frames.Length - 1].time)
55 return _frames[_frames.Length - 1].data;
56
57 int item = Array.BinarySearch(_frames, (time,default(T)), _comparer);
58 if (item > 0)
59 return _frames[item].data;
60 else
61 {
62 item = ~item;
63 var p1 = _frames[item - 1];
64 var p2 = _frames[item];
65 float pct = (time - p1.time) / (p2.time - p1.time);
66 return _lerp(p1.data, p2.data, pct);
67 }
68 }
69}
70
71class DebugToolWindow : IStepper

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected