mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 19:39:21 +00:00
Minor hands detection change
Update to latest LeapCSharp
This commit is contained in:
parent
f6d16f25b7
commit
8c8b8d2e99
4 changed files with 58 additions and 18 deletions
20
ml_lme_cvr/vendor/LeapCSharp/Connection.cs
vendored
20
ml_lme_cvr/vendor/LeapCSharp/Connection.cs
vendored
|
@ -245,6 +245,18 @@ namespace LeapInternal
|
|||
_polster.Join();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the version of the currently installed Tracking Service.
|
||||
/// Might return 0.0.0 if no device is connected or it cannot get the current version.
|
||||
/// </summary>
|
||||
/// <returns>the current tracking service version</returns>
|
||||
public LEAP_VERSION GetCurrentServiceVersion()
|
||||
{
|
||||
LEAP_VERSION currentVersion = new LEAP_VERSION { major = 0, minor = 0, patch = 0 };
|
||||
LeapC.GetVersion(_leapConnection, eLeapVersionPart.eLeapVersionPart_ServerLibrary, ref currentVersion);
|
||||
return currentVersion;
|
||||
}
|
||||
|
||||
//Run in Polster thread, fills in object queues
|
||||
private void processMessages()
|
||||
{
|
||||
|
@ -586,7 +598,13 @@ namespace LeapInternal
|
|||
|
||||
private void handleLostDevice(ref LEAP_DEVICE_EVENT deviceMsg)
|
||||
{
|
||||
Device lost = _devices.FindDeviceByHandle(deviceMsg.device.handle);
|
||||
IntPtr deviceHandle;
|
||||
eLeapRS result = LeapC.OpenDevice(deviceMsg.device, out deviceHandle);
|
||||
if (result != eLeapRS.eLeapRS_Success)
|
||||
return;
|
||||
|
||||
//UnityEngine.Debug.Log("handleLostDevice: " + deviceHandle);
|
||||
Device lost = _devices.FindDeviceByHandle(deviceHandle);
|
||||
if (lost != null)
|
||||
{
|
||||
_devices.Remove(lost);
|
||||
|
|
21
ml_lme_cvr/vendor/LeapCSharp/Controller.cs
vendored
21
ml_lme_cvr/vendor/LeapCSharp/Controller.cs
vendored
|
@ -497,6 +497,27 @@ namespace Leap
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether a minimum or required tracking service version is installed.
|
||||
/// Gets the currently installed service version from the connection and checks whether
|
||||
/// the argument minServiceVersion is smaller or equal to it
|
||||
/// </summary>
|
||||
/// <param name="minServiceVersion">The minimum service version to check against</param>
|
||||
/// <returns></returns>
|
||||
public bool CheckRequiredServiceVersion(LEAP_VERSION minServiceVersion)
|
||||
{
|
||||
LEAP_VERSION currentServiceVersion = _connection.GetCurrentServiceVersion();
|
||||
|
||||
// check that minServiceVersion is smaller or equal to the current service version
|
||||
if (minServiceVersion.major < currentServiceVersion.major) return true;
|
||||
else if (minServiceVersion.major == currentServiceVersion.major)
|
||||
{
|
||||
if (minServiceVersion.minor < currentServiceVersion.minor) return true;
|
||||
else if (minServiceVersion.minor == currentServiceVersion.minor && minServiceVersion.patch <= currentServiceVersion.patch) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Requests setting a policy.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue