16 [Tooltip(
"The LeapProvider whose output hand data will be copied, modified, " +
17 "and output by this post-processing provider.")]
19 [OnEditorChange(
"inputLeapProvider")]
41 public enum DataUpdateMode { UpdateOnly, FixedUpdateOnly, UpdateAndFixedUpdate }
42 [Tooltip(
"Whether this post-processing provider should process data received from " +
43 "Update frames, FixedUpdate frames, or both. Processing both kinds of " +
44 "frames is only recommended if your post-process is stateless.")]
52 [Tooltip(
"When this setting is enabled, frame data is passed from this provider's "
53 +
"input directly to its output without performing any post-processing.")]
56 private Frame _cachedUpdateFrame =
new Frame();
66 return _cachedUpdateFrame;
77 return _cachedFixedFrame;
92 private void validateInput() {
95 Debug.LogError(
"The input to the post-process provider on " + gameObject.name
96 +
" causes an infinite cycle, so its input has been set to null.");
100 private bool detectCycle() {
104 if (providerA == providerB) {
return true; }
105 else if (!(providerB is PostProcessProvider)) {
return false; }
108 if (!(providerB is PostProcessProvider)) {
return false; }
113 private void processUpdateFrame(Frame inputFrame) {
118 _cachedUpdateFrame.CopyFrom(inputFrame);
125 private void processFixedFrame(Frame inputFrame) {
130 _cachedFixedFrame.CopyFrom(inputFrame);
The Frame class represents a set of hand and finger tracking data detected in a single frame.
Provides Frame object data to the Unity application by firing events as soon as Frame data is availab...
Action< Frame > OnFixedFrame
void DispatchUpdateFrameEvent(Frame frame)
Action< Frame > OnUpdateFrame
abstract Frame CurrentFrame
The current frame for this update cycle, in world space.
abstract Frame CurrentFixedFrame
The current frame for this fixed update cycle, in world space.
void DispatchFixedFrameEvent(Frame frame)
virtual void OnValidate()
override Frame CurrentFrame
virtual bool implementerHandlesDispatch
Override this as true to have your PostProcessProvider handle its own Dispatch timing....
LeapProvider _inputLeapProvider
DataUpdateMode dataUpdateMode
override Frame CurrentFixedFrame
abstract void ProcessFrame(ref Frame inputFrame)
LeapProvider inputLeapProvider