Custom event classes for patched methods

Update to LeapCSharp 6.15.0
This commit is contained in:
SDraw 2024-04-26 23:52:25 +03:00
parent 4b879d53d5
commit 85925a7072
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
76 changed files with 3443 additions and 2187 deletions

View file

@ -10,6 +10,7 @@ namespace Leap
{
using LeapInternal;
using System;
using System.Runtime.InteropServices;
/// <summary>
/// An enumeration defining the types of Leap Motion events.
@ -35,7 +36,8 @@ namespace Leap
EVENT_DROPPED_FRAME,
EVENT_IMAGE, //!< An unrequested image is available
EVENT_POINT_MAPPING_CHANGE,
EVENT_HEAD_POSE
EVENT_HEAD_POSE,
EVENT_FIDUCIAL_POSE
};
/// <summary>
/// A generic object with no arguments beyond the event type.
@ -159,6 +161,7 @@ namespace Leap
/// Provides the configuration key, whether the change was successful, and the id of the original change request.
/// @since 3.0
/// </summary>
[Obsolete("Config is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public class ConfigChangeEventArgs : LeapEventArgs
{
public ConfigChangeEventArgs(string config_key, bool succeeded, uint requestId) : base(LeapEvent.EVENT_CONFIG_CHANGE)
@ -308,6 +311,33 @@ namespace Leap
public LEAP_QUATERNION headOrientation { get; set; }
}
/// <summary>
/// Dispatched when a Fiducial Marker is tracked
///
/// Note: Family and Size are not currently implemented
/// </summary>
public class FiducialPoseEventArgs : LeapEventArgs
{
public FiducialPoseEventArgs(LEAP_FIDUCIAL_POSE_EVENT poseEvent) : base(LeapEvent.EVENT_FIDUCIAL_POSE)
{
this.id = poseEvent.id;
this.family = ""; // TODO: Marshal.PtrToStringAnsi(poseEvent.family); - when ptr is implemented in LeapC
this.size = poseEvent.size;
this.timestamp = poseEvent.timestamp;
this.estimated_error = poseEvent.estimated_error;
this.translation = poseEvent.translation;
this.rotation = poseEvent.rotation;
}
public int id { get; set; }
public string family { get; set; }
public float size { get; set; }
public float timestamp { get; set; }
public float estimated_error { get; set; }
public LEAP_VECTOR translation { get; set; }
public LEAP_QUATERNION rotation { get; set; }
}
public struct BeginProfilingForThreadArgs
{
public string threadName;