Tanoda
IInteractionBehaviour.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using Leap;
11using Leap.Unity.Space;
12using System.Collections;
13using System.Collections.Generic;
14using UnityEngine;
15
16namespace Leap.Unity.Interaction {
17
22 public interface IInteractionBehaviour /* : IInternalInteractionBehaviour */ {
23
24 // Properties from MonoBehaviour.
25 string name { get; } // (subclass MonoBehaviour to satisfy)
26 GameObject gameObject { get; } // ^
27 Transform transform { get; } // ^
28
29 // Properties for interaction.
31 Rigidbody rigidbody { get; }
32 ISpaceComponent space { get; } // OK to return null if this object is not in
33 // curved space.
34
35 // Interaction overrides.
37 bool ignorePrimaryHover { get; }
38 bool ignoreContact { get; }
39 bool ignoreGrasping { get; }
40
41 // Interaction settings.
42 bool allowMultiGrasp { get; }
43
44 // Interaction layers.
47
48 // Called by the Interaction Manager manually
49 // every fixed (physics) frame.
51
52 // Interaction types:
53 // - Hover
54 // -- Primary Hover
55 // - Contact
56 // - Grasping
57 // -- Suspension
58
59 // Hover
60 float GetHoverDistance(Vector3 worldPosition);
61 void BeginHover(List<InteractionController> beganHovering);
62 void EndHover(List<InteractionController> endedHovering);
63 void StayHovered(List<InteractionController> currentlyHovering);
64
65 // Primary hover
66 void BeginPrimaryHover(List<InteractionController> beganPrimaryHovering);
67 void EndPrimaryHover(List<InteractionController> endedPrimaryHovering);
68 void StayPrimaryHovered(List<InteractionController> currentlyPrimaryHovering);
69
70 // Contact
71 void BeginContact(List<InteractionController> beganContact);
72 void EndContact(List<InteractionController> endedContact);
73 void StayContacted(List<InteractionController> currentlyContacting);
74
75 // Grasping
76 bool isGrasped { get; }
77 void BeginGrasp(List<InteractionController> beganGrasping);
78 void EndGrasp(List<InteractionController> endedGrasping);
79 void StayGrasped(List<InteractionController> currentlyGrasping);
80
81 // Suspension
82 bool isSuspended { get; }
84 void EndSuspension(InteractionController endedSuspending);
85
86 }
87
88}
IInteractionBehaviour is the interface that defines all Interaction objects, specifying the minimum s...
void BeginSuspension(InteractionController beganSuspending)
void EndGrasp(List< InteractionController > endedGrasping)
void BeginContact(List< InteractionController > beganContact)
void StayContacted(List< InteractionController > currentlyContacting)
void EndContact(List< InteractionController > endedContact)
float GetHoverDistance(Vector3 worldPosition)
void EndSuspension(InteractionController endedSuspending)
void StayGrasped(List< InteractionController > currentlyGrasping)
void StayHovered(List< InteractionController > currentlyHovering)
void EndHover(List< InteractionController > endedHovering)
void StayPrimaryHovered(List< InteractionController > currentlyPrimaryHovering)
void BeginPrimaryHover(List< InteractionController > beganPrimaryHovering)
void EndPrimaryHover(List< InteractionController > endedPrimaryHovering)
void BeginHover(List< InteractionController > beganHovering)
void BeginGrasp(List< InteractionController > beganGrasping)
IgnoreHoverMode
Specified on a per-object basis to allow Interaction objects to ignore hover for the left hand,...
An object you can use to represent a single Unity layer as a dropdown in the inspector....
Definition: SingleLayer.cs:20