Tanoda
|
The LeapServiceProvider provides tracked Leap Hand data and images from the device via the Leap service running on the client machine. More...
Public Types | |
enum | InteractionVolumeVisualization { None , LeapMotionController , StereoIR170 , Automatic } |
enum | FrameOptimizationMode { None , ReuseUpdateForPhysics , ReusePhysicsForUpdate } |
enum | PhysicsExtrapolationMode { None , Auto , Manual } |
enum | TrackingOptimizationMode { Desktop , ScreenTop , HMD } |
Public Member Functions | |
float | CalculatePhysicsExtrapolation () |
Controller | GetLeapController () |
Returns the Leap Controller instance. More... | |
bool | IsConnected () |
Returns true if the Leap Motion hardware is plugged in and this application is connected to the Leap Motion service. More... | |
void | RetransformFrames () |
Retransforms hand data from Leap space to the space of the Unity transform. This is only necessary if you're moving the LeapServiceProvider around in a custom script and trying to access Hand data from it directly afterward. More... | |
void | CopySettingsToLeapXRServiceProvider (LeapXRServiceProvider leapXRServiceProvider) |
Copies property settings from this LeapServiceProvider to the target LeapXRServiceProvider where applicable. Does not modify any XR-specific settings that only exist on the LeapXRServiceProvider. More... | |
Protected Member Functions | |
virtual void | Reset () |
virtual void | Awake () |
virtual void | Start () |
virtual void | Update () |
virtual void | FixedUpdate () |
virtual void | OnDestroy () |
virtual void | OnApplicationPause (bool isPaused) |
virtual void | OnApplicationQuit () |
virtual long | CalculateInterpolationTime (bool endOfFrame=false) |
virtual void | initializeFlags () |
Initializes Leap Motion policy flags. More... | |
void | createController () |
Creates an instance of a Controller, initializing its policy flags and subscribing to its connection event. More... | |
void | destroyController () |
Stops the connection for the existing instance of a Controller, clearing old policy flags and resetting the Controller to null. More... | |
bool | checkConnectionIntegrity () |
Checks whether this provider is connected to a service; If it is not, attempt to reconnect at regular intervals for MAX_RECONNECTION_ATTEMPTS More... | |
void | onHandControllerConnect (object sender, LeapEventArgs args) |
virtual void | transformFrame (Frame source, Frame dest) |
![]() | |
void | DispatchUpdateFrameEvent (Frame frame) |
void | DispatchFixedFrameEvent (Frame frame) |
Protected Attributes | |
InteractionVolumeVisualization | _interactionVolumeVisualization = InteractionVolumeVisualization.LeapMotionController |
FrameOptimizationMode | _frameOptimization = FrameOptimizationMode.None |
PhysicsExtrapolationMode | _physicsExtrapolation = PhysicsExtrapolationMode.Auto |
float | _physicsExtrapolationTime = 1.0f / 90.0f |
TrackingOptimizationMode | _trackingOptimization = TrackingOptimizationMode.Desktop |
bool | _workerThreadProfiling = false |
string | _serverNameSpace = "Leap Service" |
bool | _useInterpolation = true |
int | ExtrapolationAmount = 0 |
int | BounceAmount = 0 |
Controller | _leapController |
bool | _isDestroyed |
SmoothedFloat | _fixedOffset = new SmoothedFloat() |
SmoothedFloat | _smoothedTrackingLatency = new SmoothedFloat() |
long | _unityToLeapOffset |
Frame | _untransformedUpdateFrame |
Frame | _transformedUpdateFrame |
Frame | _untransformedFixedFrame |
Frame | _transformedFixedFrame |
Static Protected Attributes | |
const double | NS_TO_S = 1e-6 |
Converts nanoseconds to seconds. More... | |
const double | S_TO_NS = 1e6 |
Converts seconds to nanoseconds. More... | |
const string | HAND_ARRAY_GLOBAL_NAME = "_LeapHandTransforms" |
The transform array used for late-latching. More... | |
const int | MAX_RECONNECTION_ATTEMPTS = 5 |
The maximum number of times the provider will attempt to reconnect to the service before giving up. More... | |
const int | RECONNECTION_INTERVAL = 180 |
The number of frames to wait between each reconnection attempt. More... | |
Properties | |
InteractionVolumeVisualization | SelectedInteractionVolumeVisualization [get] |
Action< Device > | OnDeviceSafe |
A utility event to get a callback whenever a new device is connected to the service. This callback will ALSO trigger a callback upon subscription if a device is already connected. More... | |
override Frame | CurrentFrame [get] |
override Frame | CurrentFixedFrame [get] |
![]() | |
abstract Frame | CurrentFrame [get] |
The current frame for this update cycle, in world space. More... | |
abstract Frame | CurrentFixedFrame [get] |
The current frame for this fixed update cycle, in world space. More... | |
Additional Inherited Members | |
![]() | |
TestHandPose | editTimePose = TestHandPose.HeadMountedA |
![]() | |
Action< Frame > | OnUpdateFrame |
Action< Frame > | OnFixedFrame |
Action< Frame > | OnPostUpdateFrame |
The LeapServiceProvider provides tracked Leap Hand data and images from the device via the Leap service running on the client machine.
Definition at line 20 of file LeapServiceProvider.cs.
Enumerator | |
---|---|
None | |
ReuseUpdateForPhysics | |
ReusePhysicsForUpdate |
Definition at line 67 of file LeapServiceProvider.cs.
Enumerator | |
---|---|
None | |
LeapMotionController | |
StereoIR170 | |
Automatic |
Definition at line 55 of file LeapServiceProvider.cs.
Enumerator | |
---|---|
None | |
Auto | |
Manual |
Definition at line 76 of file LeapServiceProvider.cs.
Enumerator | |
---|---|
Desktop | |
ScreenTop | |
HMD |
Definition at line 92 of file LeapServiceProvider.cs.
|
protectedvirtual |
Definition at line 278 of file LeapServiceProvider.cs.
|
protectedvirtual |
Reimplemented in Leap.Unity.LeapXRServiceProvider.
Definition at line 463 of file LeapServiceProvider.cs.
float Leap.Unity.LeapServiceProvider.CalculatePhysicsExtrapolation | ( | ) |
Definition at line 396 of file LeapServiceProvider.cs.
|
protected |
Checks whether this provider is connected to a service; If it is not, attempt to reconnect at regular intervals for MAX_RECONNECTION_ATTEMPTS
Definition at line 554 of file LeapServiceProvider.cs.
void Leap.Unity.LeapServiceProvider.CopySettingsToLeapXRServiceProvider | ( | LeapXRServiceProvider | leapXRServiceProvider | ) |
Copies property settings from this LeapServiceProvider to the target LeapXRServiceProvider where applicable. Does not modify any XR-specific settings that only exist on the LeapXRServiceProvider.
Definition at line 450 of file LeapServiceProvider.cs.
|
protected |
Creates an instance of a Controller, initializing its policy flags and subscribing to its connection event.
Definition at line 502 of file LeapServiceProvider.cs.
|
protected |
Stops the connection for the existing instance of a Controller, clearing old policy flags and resetting the Controller to null.
Definition at line 535 of file LeapServiceProvider.cs.
|
protectedvirtual |
Definition at line 334 of file LeapServiceProvider.cs.
Controller Leap.Unity.LeapServiceProvider.GetLeapController | ( | ) |
Returns the Leap Controller instance.
Definition at line 417 of file LeapServiceProvider.cs.
|
protectedvirtual |
Initializes Leap Motion policy flags.
Reimplemented in Leap.Unity.LeapXRServiceProvider.
Definition at line 478 of file LeapServiceProvider.cs.
bool Leap.Unity.LeapServiceProvider.IsConnected | ( | ) |
Returns true if the Leap Motion hardware is plugged in and this application is connected to the Leap Motion service.
Definition at line 431 of file LeapServiceProvider.cs.
|
protectedvirtual |
Definition at line 380 of file LeapServiceProvider.cs.
|
protectedvirtual |
Definition at line 391 of file LeapServiceProvider.cs.
|
protectedvirtual |
Definition at line 375 of file LeapServiceProvider.cs.
|
protected |
Definition at line 578 of file LeapServiceProvider.cs.
|
protectedvirtual |
Reimplemented in Leap.Unity.LeapXRServiceProvider.
Definition at line 274 of file LeapServiceProvider.cs.
void Leap.Unity.LeapServiceProvider.RetransformFrames | ( | ) |
Retransforms hand data from Leap space to the space of the Unity transform. This is only necessary if you're moving the LeapServiceProvider around in a custom script and trying to access Hand data from it directly afterward.
Definition at line 440 of file LeapServiceProvider.cs.
|
protectedvirtual |
Reimplemented in Leap.Unity.LeapXRServiceProvider.
Definition at line 283 of file LeapServiceProvider.cs.
|
protectedvirtual |
Reimplemented in Leap.Unity.LeapXRServiceProvider.
Definition at line 586 of file LeapServiceProvider.cs.
|
protectedvirtual |
Reimplemented in Leap.Unity.LeapXRServiceProvider.
Definition at line 291 of file LeapServiceProvider.cs.
|
protected |
Definition at line 137 of file LeapServiceProvider.cs.
|
protected |
Definition at line 74 of file LeapServiceProvider.cs.
|
protected |
Definition at line 63 of file LeapServiceProvider.cs.
|
protected |
Definition at line 135 of file LeapServiceProvider.cs.
|
protected |
Definition at line 134 of file LeapServiceProvider.cs.
|
protected |
Definition at line 86 of file LeapServiceProvider.cs.
|
protected |
Definition at line 90 of file LeapServiceProvider.cs.
|
protected |
Definition at line 117 of file LeapServiceProvider.cs.
|
protected |
Definition at line 138 of file LeapServiceProvider.cs.
|
protected |
Definition at line 102 of file LeapServiceProvider.cs.
|
protected |
Definition at line 144 of file LeapServiceProvider.cs.
|
protected |
Definition at line 142 of file LeapServiceProvider.cs.
|
protected |
Definition at line 139 of file LeapServiceProvider.cs.
|
protected |
Definition at line 143 of file LeapServiceProvider.cs.
|
protected |
Definition at line 141 of file LeapServiceProvider.cs.
|
protected |
Definition at line 122 of file LeapServiceProvider.cs.
|
protected |
Definition at line 112 of file LeapServiceProvider.cs.
|
protected |
Definition at line 131 of file LeapServiceProvider.cs.
|
protected |
Definition at line 130 of file LeapServiceProvider.cs.
|
staticprotected |
The transform array used for late-latching.
Definition at line 37 of file LeapServiceProvider.cs.
|
staticprotected |
The maximum number of times the provider will attempt to reconnect to the service before giving up.
Definition at line 43 of file LeapServiceProvider.cs.
|
staticprotected |
Converts nanoseconds to seconds.
Definition at line 27 of file LeapServiceProvider.cs.
|
staticprotected |
The number of frames to wait between each reconnection attempt.
Definition at line 49 of file LeapServiceProvider.cs.
|
staticprotected |
Converts seconds to nanoseconds.
Definition at line 32 of file LeapServiceProvider.cs.
|
get |
Definition at line 250 of file LeapServiceProvider.cs.
|
get |
Definition at line 230 of file LeapServiceProvider.cs.
|
addremove |
A utility event to get a callback whenever a new device is connected to the service. This callback will ALSO trigger a callback upon subscription if a device is already connected.
For situations with multiple devices OnDeviceSafe will be dispatched once for each device.
Definition at line 158 of file LeapServiceProvider.cs.
|
get |
Definition at line 65 of file LeapServiceProvider.cs.