This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void OnPhotoCaptured(PhotoCapture.PhotoCaptureResult result, PhotoCaptureFrame photoCaptureFrame) | |
| { | |
| Matrix4x4 cameraToWorldMatrix; | |
| photoCaptureFrame.TryGetCameraToWorldMatrix(out cameraToWorldMatrix); | |
| Matrix4x4 projectionMatrix; | |
| photoCaptureFrame.TryGetProjectionMatrix(out projectionMatrix); | |
| var imagePosZeroToOne = new Vector2(pixelPos.x / imageWidth, 1 - (pixelPos.y / imageHeight)); | |
| var imagePosProjected = (imagePosZeroToOne * 2) - new Vector2(1, 1); // -1 to 1 space |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [core] | |
| pager = less -cm | |
| quotepath = false | |
| [user] | |
| name = Furuta Yusuke | |
| email = [email protected] | |
| [alias] | |
| # いい感じのグラフでログを表示 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public class GunScript : MonoBehaviour { | |
| public ITangoController TangoController; | |
| public GameObject LaserBeam; | |
| bool previousSelectButton = false; | |
| private GameObject muzzle; | |
| ... | |
| void Start () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var originToMarker = Matrix4x4.TRS(obj.position, obj.rotation * Quaternion.Euler(90, 0, 0), Vector3.one); | |
| var tangoOriginToMarker = Matrix4x4.TRS(TangoController.transform.position, TangoController.transform.rotation, Vector3.one); | |
| var originToTangoOrigin = originToMarker * tangoOriginToMarker.inverse; | |
| var rot = GetRotationFromMatrix(originToTangoOrigin); | |
| transform.parent.SetPositionAndRotation(originToTangoOrigin.MultiplyPoint(Vector3.zero), rot); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using Vuforia; | |
| public class GunScript : MonoBehaviour { | |
| public ITangoController TangoController; | |
| public GameObject LaserBeam; | |
| public CustomTrackingHandler trackingHandler; | |
| bool previousSelectButton = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using UnityEngine; | |
| using Vuforia; | |
| public class CustomTrackingHandler : MonoBehaviour, ITrackableEventHandler | |
| { | |
| private GameObject target; | |
| private TrackableBehaviour trackableBehaviour; | |
| private TrackableBehaviour.Status currentStatus; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public interface ITangoController{ | |
| bool SelectButton | |
| { | |
| get; | |
| set; | |
| } | |
| Transform transform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using UnetLLAPISample; | |
| using UnityEngine; | |
| public class UnetTangoController : MonoBehaviour, ITangoController { | |
| public LLAPINetworkManager NetworkManager; | |
| public bool SelectButton { get; set; } | |
| public GunScript GunScript; | |
| private void Awake() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using UnetLLAPISample; | |
| using UnityEngine; | |
| using UnityEngine.Networking; | |
| public class UnetTangoController : MonoBehaviour | |
| { | |
| public LLAPINetworkManager NetworkManager; | |
| public bool SelectButton = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.Networking; | |
| using System; | |
| namespace UnetLLAPISample { | |
| public class LLAPINetworkEventArgs : EventArgs | |
| { | |
| public NetworkEventType eventType { set; get; } | |
| public byte[] data { set; get; } |