Hi all!
I'm planning on making a little flight simulator that uses the hand for the positioning and rotation of the airplane.
After reading the API I'm a bit confused on how to do that.
All the examples use an actual rigged hand, but i want to substitute it with a simple 3d plane.
I use the Leap Desktop Controller.
Here's the current code I have:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Leap.Unity;
public class PlaneModel : HandModel {
public GameObject plane;
public LeapHandController controller;
public override ModelType HandModelType {
get;
}
// Use this for initialization
void Init () {
}
public override void InitHand() {
this.Init ();
}
public override void UpdateHand() {
this.Update ();
}
// Update is called once per frame
void Update () {
Vector3 palmPosition = this.GetPalmPosition();
this.plane.transform.position = palmPosition;
}
}
I implemented the LeapHandController prefab and a GameObject that has the above script attached. Inside that GameObject is the plane.
Could somebody nudge me in the right direction? I feel a bit lost.
Thanks, and cheers