public void StartClicked() { //debugText.text += "clicked "; if (!_kudanTracker.ArbiTrackIsTracking()) { Debug.Log("start clicked"); //debugText.text += "started tracking "; // from the floor placer. Vector3 floorPosition; // The current position in 3D space of the floor Quaternion floorOrientation; // The current orientation of the floor in 3D space, relative to the device _kudanTracker.FloorPlaceGetPose(out floorPosition, out floorOrientation); // Gets the position and orientation of the floor and assigns the referenced Vector3 and Quaternion those values _kudanTracker.ArbiTrackStart(floorPosition, floorOrientation); // Starts markerless tracking based upon the given floor position and orientations spawnersPlaced++; gameContent.Init(); } else { //debugText.text += "already tracking "; } //else //{ // _kudanTracker.ArbiTrackStop(); //} }
IEnumerator AddARObject(GameObject model, string _id) { if (DataUtility.TrackingMode == ARTrackingMode.Markerless && !_kudanTracker.ArbiTrackIsTracking()) { DelayPlaceObject(); yield return(new WaitUntil(_kudanTracker.ArbiTrackIsTracking)); } try { GameObject target = Instantiate(model); objlist.Add(target); ARProduct m = null; if (DataUtility.TrackingMode == ARTrackingMode.Marker) { m = DataUtility.InitARObject(target, markerTransform); } else { _kudanTracker.FloorPlaceGetPose(out trackPos, out trackRot); m = DataUtility.InitARObject(target, markerlessTransform); } if (m != null) { m.SKU = _id; SetCurrentObject(m); } } catch (System.Exception ex) { TestCenter.Singleton.Log("error: " + ex.Message); } }
public void StartClicked() { if (!_kudanTracker.ArbiTrackIsTracking()) { // from the floor placer. Vector3 floorPosition; // The current position in 3D space of the floor Quaternion floorOrientation; // The current orientation of the floor in 3D space, relative to the device _kudanTracker.FloorPlaceGetPose(out floorPosition, out floorOrientation); // Gets the position and orientation of the floor and assigns the referenced Vector3 and Quaternion those values _kudanTracker.ArbiTrackStart(floorPosition, floorOrientation); // Starts markerless tracking based upon the given floor position and orientations } else { _kudanTracker.ArbiTrackStop(); } }
private void Update() { if (!_kudanTracker.ArbiTrackIsTracking() && _eggSearcher.IsSearching) { SetActiveArbiTrack(false); SetActiveArbiTrack(true); } }
// float GetDistance() { // RaycastHit hit = new RaycastHit(); // // if (Physics.Linecast(cam.position, target.transform.position, out hit)) { // //Debug.Log("Object hit: " + hit.collider); // return hit.distance; // } // // //Debug.Log("No RB hit"); // return 0; // } void Update() { float dist = Vector3.Distance(transform.position, target.transform.position); //Debug.Log("Distance: " + dist); if (dist < 100 && tracker.ArbiTrackIsTracking()) { //buzzer.PlayOneShot(buzz); warning.text = "WARNING: TOO CLOSE"; } else { warning.text = ""; } }
public void MarkerlessStartTapped() { if (!_kudanTracker.ArbiTrackIsTracking()) { Vector3 floorPosition; Quaternion floorOrientation; _kudanTracker.FloorPlaceGetPose(out floorPosition, out floorOrientation); _kudanTracker.ArbiTrackStart(floorPosition, floorOrientation); } else { _kudanTracker.ArbiTrackStop(); } }
public void MarkerlessStartTapped() { if (!_kudanTracker.ArbiTrackIsTracking()) { Vector3 floorPosition; Quaternion floorOrientation; _kudanTracker.FloorPlaceGetPose(out floorPosition, out floorOrientation); _kudanTracker.ArbiTrackStart(floorPosition, floorOrientation); markerlessStartButton.image.color = Color.red; markerlessStartText.text = "stop"; selectButton.interactable = false; } else { _kudanTracker.ArbiTrackStop(); markerlessStartButton.image.color = Color.white; markerlessStartText.text = "start"; selectButton.interactable = true; } }
void LateUpdate() { triggerImage.SetActive(!_kudan.ArbiTrackIsTracking()); }