10using System.Collections;
20 #pragma warning disable 0649
25 private Mesh _palmMesh;
28 private float _palmScale = 0.02f;
31 private Material _palmMat;
34 private Mesh _jointMesh;
37 private float _jointScale = 0.01f;
40 private Material _jointMat;
41 #pragma warning restore 0649
44 private Transform _palm;
45 private Transform[] _joints;
71 _joints =
new Transform[5 * 4];
72 for (
int i = 0; i < 20; i++) {
73 _joints[i] = createRenderer(
"Joint", _jointMesh, _jointScale, _jointMat);
76 _palm = createRenderer(
"Palm", _palmMesh, _palmScale, _palmMat);
82 for (
int i = 0; i < 5; i++) {
84 for (
int j = 0; j < 4; j++) {
92 private Transform createRenderer(
string name, Mesh mesh,
float scale, Material mat) {
93 GameObject obj =
new GameObject(name);
94 obj.AddComponent<MeshFilter>().mesh = mesh;
95 obj.AddComponent<MeshRenderer>().sharedMaterial = mat;
96 obj.transform.parent = transform;
97 obj.transform.localScale = Vector3.one * scale;
The Bone class represents a tracked bone.
BoneType
Enumerates the type of bones.
Vector NextJoint
The end of the bone, closest to the finger tip. In anatomical terms, this is the distal end of the bo...
The Finger class represents a tracked finger.
Bone Bone(Bone.BoneType boneIx)
The bone at a given bone index on this finger.
The Hand class reports the physical characteristics of a detected hand.
Vector PalmPosition
The center position of the palm.
List< Finger > Fingers
The list of Finger objects detected in this frame that are attached to this hand, given in order from...
override Hand GetLeapHand()
override ModelType HandModelType
override bool SupportsEditorPersistence()
Returns whether or not this hand model supports editor persistence. This is false by default and must...
override void SetLeapHand(Hand hand)
override Chirality Handedness
override void UpdateHand()