void FixedUpdate() { // check if a coroutine should be used for this... // Trigger values are scalar (increase the more you push down), to use as on / off button taking it as on when 90% or more down if (MotionControllerManager.GetTriggerValue(left) > 0.9f) { // HUDDebug.AddMessage("TRIGGER DOWN: " + ((left) ? "LEFT" : "RIGHT") ); // HUDDebug.AddMessage("RAY ORIGIN: " + ray.origin + " TRANSFORM START: " + (startTransform.position)); Ray ray = new Ray(startTransform.position, startTransform.forward); RaycastHit hit; // whenever trigger is down we enable the line renderer on this hand line.enabled = true; line.SetPosition(0, ray.origin); // line start position, at hand location // If hit anything we carry out any options needed on that object, otherwise drop any object currently in focus if (Physics.Raycast(ray, out hit, MaxLength)) { line.SetPosition(1, hit.point); // line end position, at hit location (MaxLength distance from hand if nothing hit) ReactToCursor(hit, ray.direction); } else { Drop(); line.SetPosition(1, ray.GetPoint(MaxLength)); } } else { line.enabled = false; Drop(); } }
public OptionsForm(Handbell[] handbells, MotionControllerManager.MotionControllerManager mcm) { InitializeComponent(); _mcm = mcm; _hb = handbells; InitializeFields(); }
public ControllerForm(MotionControllerManager.MotionControllerManager mcm, Handbell [] hb) { InitializeComponent(); _mcm = mcm; _hb = hb; listControllers(); lstController.SelectedIndex = 0; }
void Awake() { //If single object already exists then destroy if (ThisInstance != null) { DestroyImmediate(gameObject); return; } //Make this single instance ThisInstance = this; }
public Handbell StartCalibration(MotionControllerManager.MotionControllerManager manager, int index) { _handbell = new Handbell(manager, index); _question = 0; _index = index; AskQuestion(); if (ShowDialog() == DialogResult.OK) { _handbell.UpdateSettings(); Close(); return _handbell; } else { Close(); return null; } }
void Update() { thisTransform.localPosition = MotionControllerManager.GetHandPosition(left); thisTransform.localRotation = MotionControllerManager.GetHandRotation(left); }