11using System.Collections;
12using System.Collections.Generic;
25 [AddComponentMenu(
"")]
29 [Tooltip(
"The AttachmentHand associated with this AttachmentPointBehaviour. AttachmentPointBehaviours "
30 +
"should be beneath their AttachmentHand object in the hierarchy.")]
34 [Tooltip(
"To change which attachment points are available on an AttachmentHand, refer to the "
35 +
"inspector for the parent AttachmentHands object.")]
41 Debug.LogError(
"AttachmentPointBehaviours should refer to a single attachmentPoint flag.", this.gameObject);
63 Vector3 position = Vector3.zero;
64 Quaternion rotation = Quaternion.identity;
68 this.transform.position = position;
69 this.transform.rotation = rotation;
73 position = Vector3.zero;
74 rotation = Quaternion.identity;
77 Debug.LogError(
"Cannot get attachment point data for an AttachmentPointFlags argument consisting of more than one set flag.");
81 switch (singlePoint) {
86 position = hand.WristPosition.ToVector3();
87 rotation = hand.Arm.Basis.rotation.ToQuaternion();
90 position = hand.PalmPosition.ToVector3();
91 rotation = hand.Basis.rotation.ToQuaternion();
95 position = hand.Fingers[0].bones[1].NextJoint.ToVector3();
96 rotation = hand.Fingers[0].bones[2].Rotation.ToQuaternion();
99 position = hand.Fingers[0].bones[2].NextJoint.ToVector3();
100 rotation = hand.Fingers[0].bones[3].Rotation.ToQuaternion();
103 position = hand.Fingers[0].bones[3].NextJoint.ToVector3();
104 rotation = hand.Fingers[0].bones[3].Rotation.ToQuaternion();
108 position = hand.Fingers[1].bones[0].NextJoint.ToVector3();
109 rotation = hand.Fingers[1].bones[1].Rotation.ToQuaternion();
112 position = hand.Fingers[1].bones[1].NextJoint.ToVector3();
113 rotation = hand.Fingers[1].bones[2].Rotation.ToQuaternion();
116 position = hand.Fingers[1].bones[2].NextJoint.ToVector3();
117 rotation = hand.Fingers[1].bones[3].Rotation.ToQuaternion();
120 position = hand.Fingers[1].bones[3].NextJoint.ToVector3();
121 rotation = hand.Fingers[1].bones[3].Rotation.ToQuaternion();
125 position = hand.Fingers[2].bones[0].NextJoint.ToVector3();
126 rotation = hand.Fingers[2].bones[1].Rotation.ToQuaternion();
129 position = hand.Fingers[2].bones[1].NextJoint.ToVector3();
130 rotation = hand.Fingers[2].bones[2].Rotation.ToQuaternion();
133 position = hand.Fingers[2].bones[2].NextJoint.ToVector3();
134 rotation = hand.Fingers[2].bones[3].Rotation.ToQuaternion();
137 position = hand.Fingers[2].bones[3].NextJoint.ToVector3();
138 rotation = hand.Fingers[2].bones[3].Rotation.ToQuaternion();
142 position = hand.Fingers[3].bones[0].NextJoint.ToVector3();
143 rotation = hand.Fingers[3].bones[1].Rotation.ToQuaternion();
146 position = hand.Fingers[3].bones[1].NextJoint.ToVector3();
147 rotation = hand.Fingers[3].bones[2].Rotation.ToQuaternion();
150 position = hand.Fingers[3].bones[2].NextJoint.ToVector3();
151 rotation = hand.Fingers[3].bones[3].Rotation.ToQuaternion();
154 position = hand.Fingers[3].bones[3].NextJoint.ToVector3();
155 rotation = hand.Fingers[3].bones[3].Rotation.ToQuaternion();
159 position = hand.Fingers[4].bones[0].NextJoint.ToVector3();
160 rotation = hand.Fingers[4].bones[1].Rotation.ToQuaternion();
163 position = hand.Fingers[4].bones[1].NextJoint.ToVector3();
164 rotation = hand.Fingers[4].bones[2].Rotation.ToQuaternion();
167 position = hand.Fingers[4].bones[2].NextJoint.ToVector3();
168 rotation = hand.Fingers[4].bones[3].Rotation.ToQuaternion();
171 position = hand.Fingers[4].bones[3].NextJoint.ToVector3();
172 rotation = hand.Fingers[4].bones[3].Rotation.ToQuaternion();
The Hand class reports the physical characteristics of a detected hand.
This MonoBehaviour is managed by an AttachmentHands component on a parent MonoBehaviour....
void notifyPointBehaviourDeleted(AttachmentPointBehaviour point)
Simple container class for storing a reference to the attachment point this transform corresponds to ...
void SetTransformUsingHand(Leap.Hand hand)
AttachmentHand attachmentHand
AttachmentPointFlags attachmentPoint
static void GetLeapHandPointData(Leap.Hand hand, AttachmentPointFlags singlePoint, out Vector3 position, out Quaternion rotation)
AttachmentPointFlags
Flags for attachment points on the hand.