本文整理汇总了C#中Tango.TangoApplication类的典型用法代码示例。如果您正苦于以下问题:C# TangoApplication类的具体用法?C# TangoApplication怎么用?C# TangoApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TangoApplication类属于Tango命名空间,在下文中一共展示了TangoApplication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
/// <summary>
/// Use this for initialization.
/// </summary>
public void Start()
{
m_tangoApplication = FindObjectOfType<TangoApplication>();
m_tangoApplication.Register(this);
m_uwTss.SetColumn (0, new Vector4 (1.0f, 0.0f, 0.0f, 0.0f));
m_uwTss.SetColumn (1, new Vector4 (0.0f, 0.0f, 1.0f, 0.0f));
m_uwTss.SetColumn (2, new Vector4 (0.0f, 1.0f, 0.0f, 0.0f));
m_uwTss.SetColumn (3, new Vector4 (0.0f, 0.0f, 0.0f, 1.0f));
m_cTuc.SetColumn (0, new Vector4 (1.0f, 0.0f, 0.0f, 0.0f));
m_cTuc.SetColumn (1, new Vector4 (0.0f, -1.0f, 0.0f, 0.0f));
m_cTuc.SetColumn (2, new Vector4 (0.0f, 0.0f, 1.0f, 0.0f));
m_cTuc.SetColumn (3, new Vector4 (0.0f, 0.0f, 0.0f, 1.0f));
m_triangles = new int[VERT_COUNT];
// Assign triangles, note: this is just for visualizing point in the mesh data.
for (int i = 0; i < VERT_COUNT; i++)
{
m_triangles[i] = i;
}
m_mesh = GetComponent<MeshFilter>().mesh;
m_mesh.Clear();
m_mesh.triangles = m_triangles;
m_mesh.RecalculateBounds();
m_mesh.RecalculateNormals();
}
示例2: CheckForTangoApplication
/// <summary>
/// Check for a usable tango application component in the scene. Draw warning if
/// one could not be found.
///
/// Should be called first before using any other TangoPrefabInspectorHelper function
/// during a given frame, to determine if a valid TangoApplication reference exists
/// with which to call other TangoPrefabInspectorHelper methods.
/// </summary>
/// <returns><c>true</c>, if a tango application on an active GameObject can be identified,
/// <c>false</c> otherwise.</returns>
/// <param name="inspectedBehaviour">Prefab behavior that's being inspected.</param>
/// <param name="tangoApplication">Prefab inspector's reference to Tango Application, or
/// null if no Tango Application on an active GameObject can be identified.</param>
public static bool CheckForTangoApplication(MonoBehaviour inspectedBehaviour,
ref TangoApplication tangoApplication)
{
if (tangoApplication == null || !tangoApplication.gameObject.activeInHierarchy)
{
tangoApplication = GameObject.FindObjectOfType<TangoApplication>();
}
// Note: .isActiveAndEnabled is the appropriate thing to check here because all Register()
// calls on existing Tango prefabs are called in Start(), which won't occur until both the
// behaviour is enabled and the game object it is attached to is active.
//
// Conversely, if any of the tango prefabs called Register() in Awake(), the correct thing
// to check against would be .gameObject.activeInHeirarchy, since Awake is called when the
// game object it is attached to is active, regardless of whether the behaviour itself is
// enabled.
if (tangoApplication == null && inspectedBehaviour.isActiveAndEnabled)
{
EditorGUILayout.HelpBox("Could not find an active TangoApplication component in the scene.\n\n"
+ "Component will not function correctly if it cannot find "
+ "an active TangoApplication component at runtime.",
MessageType.Warning);
return false;
}
return tangoApplication != null;
}
示例3: Start
/// <summary>
/// Use this for initialization.
/// </summary>
public void Start()
{
m_marker.SetActive(false);
m_pointCloud = FindObjectOfType<TangoPointCloud>();
m_pointCloudFloor = FindObjectOfType<TangoPointCloudFloor>();
m_tangoApplication = FindObjectOfType<TangoApplication>();
}
示例4: Start
/// <summary>
/// Start this instance.
/// </summary>
private void Start()
{
Application.targetFrameRate = 60;
m_tangoApplication = FindObjectOfType<TangoApplication>();
if(m_tangoApplication != null)
{
if(AndroidHelper.IsTangoCorePresent())
{
// Request Tango permissions
m_tangoApplication.RegisterPermissionsCallback(_OnTangoApplicationPermissionsEvent);
m_tangoApplication.RequestNecessaryPermissionsAndConnect();
m_tangoApplication.Register(this);
}
else
{
// If no Tango Core is present let's tell the user to install it!
StartCoroutine(_InformUserNoTangoCore());
}
}
else
{
Debug.Log("No Tango Manager found in scene.");
}
}
示例5: Start
// Use this for initialization
void Start ()
{
// Initialize some variables
m_tangoRotation = Quaternion.Euler(90,0,0);
m_tangoPosition = Vector3.zero;
m_startPosition = transform.position;
m_tangoApplication = FindObjectOfType<TangoApplication>();
if(m_tangoApplication != null)
{
// Request Tango permissions
m_tangoApplication.RegisterPermissionsCallback(PermissionsCallback);
m_tangoApplication.RequestNecessaryPermissionsAndConnect();
m_tangoApplication.Register(this);
}
else
{
Debug.Log("No Tango Manager found in scene.");
}
m_uwTss = new Matrix4x4();
m_uwTss.SetColumn (0, new Vector4 (1.0f, 0.0f, 0.0f, 0.0f));
m_uwTss.SetColumn (1, new Vector4 (0.0f, 0.0f, 1.0f, 0.0f));
m_uwTss.SetColumn (2, new Vector4 (0.0f, 1.0f, 0.0f, 0.0f));
m_uwTss.SetColumn (3, new Vector4 (0.0f, 0.0f, 0.0f, 1.0f));
m_dTuc = new Matrix4x4();
m_dTuc.SetColumn (0, new Vector4 (1.0f, 0.0f, 0.0f, 0.0f));
m_dTuc.SetColumn (1, new Vector4 (0.0f, 1.0f, 0.0f, 0.0f));
m_dTuc.SetColumn (2, new Vector4 (0.0f, 0.0f, -1.0f, 0.0f));
m_dTuc.SetColumn (3, new Vector4 (0.0f, 0.0f, 0.0f, 1.0f));
Application.targetFrameRate = 60;
}
示例6: _DrawMotionTrackingOptions
/// <summary>
/// Draw motion tracking options.
/// </summary>
/// <param name="tangoApplication">Tango application.</param>
private void _DrawMotionTrackingOptions(TangoApplication tangoApplication)
{
tangoApplication.m_enableMotionTracking = EditorGUILayout.Toggle("Enable Motion Tracking",
tangoApplication.m_enableMotionTracking);
if (tangoApplication.m_enableMotionTracking)
{
EditorGUI.indentLevel++;
tangoApplication.m_motionTrackingAutoReset = EditorGUILayout.Toggle("Auto Reset",
tangoApplication.m_motionTrackingAutoReset);
tangoApplication.m_enableADFLoading = EditorGUILayout.Toggle("Load ADF",
tangoApplication.m_enableADFLoading);
tangoApplication.m_enableAreaLearning = EditorGUILayout.Toggle("Area Learning",
tangoApplication.m_enableAreaLearning);
tangoApplication.m_enableCloudADF = EditorGUILayout.Toggle("Cloud ADF", tangoApplication.m_enableCloudADF);
if (tangoApplication.m_enableCloudADF)
{
tangoApplication.m_cloudApiKey = EditorGUILayout.TextField("Cloud API Key", tangoApplication.m_cloudApiKey);
}
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
}
示例7: Start
/// <summary>
/// Start this instance.
/// </summary>
public void Start()
{
m_tangoApplication = GetComponent<TangoApplication>();
m_tangoApplication.Register(this);
AndroidHelper.InitTangoUx();
SetHoldPosture(m_holdPosture);
}
示例8: Start
// Use this for initialization
void Start()
{
// Prevent the screen from sleeping
Screen.sleepTimeout = SleepTimeout.NeverSleep;
// Initialize some variables
m_tangoRotation = Quaternion.identity;
m_tangoPosition = Vector3.zero;
m_startPosition = transform.position;
m_tangoApplication = FindObjectOfType<TangoApplication>();
if(m_tangoApplication != null)
{
// Request Tango permissions
m_tangoApplication.RegisterPermissionsCallback(PermissionsCallback);
m_tangoApplication.RequestNecessaryPermissionsAndConnect();
m_tangoApplication.Register(this);
}
else
{
Debug.Log("No Tango Manager found in scene.");
}
//sp = new SerialPort( "baka", 9600, Parity.None, 8, StopBits.One);
//sp.Open();
//sp.ReadTimeout = 50;
}
示例9: _DrawMotionTrackingOptions
/// <summary>
/// Draw motion tracking options.
/// </summary>
/// <param name="tangoApplication">Tango application.</param>
private void _DrawMotionTrackingOptions(TangoApplication tangoApplication)
{
tangoApplication.m_enableMotionTracking = EditorGUILayout.Toggle("Enable Motion Tracking",
tangoApplication.m_enableMotionTracking);
if (tangoApplication.m_enableMotionTracking)
{
EditorGUI.indentLevel++;
tangoApplication.m_motionTrackingAutoReset = EditorGUILayout.Toggle("Auto Reset",
tangoApplication.m_motionTrackingAutoReset);
tangoApplication.m_useLowLatencyIMUIntegration = EditorGUILayout.Toggle("Low Latency Pose",
tangoApplication.m_useLowLatencyIMUIntegration);
tangoApplication.m_enableAreaLearning = EditorGUILayout.Toggle("Area Learning",
tangoApplication.m_enableAreaLearning);
if (tangoApplication.m_enableAreaLearning)
{
EditorGUI.indentLevel++;
tangoApplication.m_useExperimentalADF = EditorGUILayout.Toggle("High Accuracy (Experimental)",
tangoApplication.m_useExperimentalADF);
EditorGUI.indentLevel--;
}
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();
}
示例10: Start
/// <summary>
/// Use this for initialization.
/// </summary>
private void Start()
{
m_currentFPS = 0;
m_framesSinceUpdate = 0;
m_currentTime = 0.0f;
m_fpsText = "FPS = Calculating";
m_tangoApplication = FindObjectOfType<TangoApplication>();
}
示例11: Start
/// <summary>
/// Unity start override function.
///
/// We register this object as a listener to the pose callbacks.
/// </summary>
public void Start()
{
m_tangoApplication = FindObjectOfType<TangoApplication>();
if (m_tangoApplication != null)
{
m_tangoApplication.Register(this);
}
}
示例12: Start
/// <summary>
/// Use this for initialization.
/// </summary>
private void Start()
{
m_currentFPS = 0;
m_framesSinceUpdate = 0;
m_currentTime = 0.0f;
m_FPSText = "FPS = Calculating";
m_label = new Rect((Screen.width * 0.025f) - 50, (Screen.height * 0.96f) - 25, 600.0f, 50.0f);
m_tangoApplication = FindObjectOfType<TangoApplication>();
}
示例13: Start
// Use this for initialization
void Start()
{
m_tangoApplication = FindObjectOfType<TangoApplication>();
m_btnGuiText.text = "Start";
m_btnGuiText.color = m_txtStartColour;
ColorBlock cb = m_btnStartStop.colors;
cb.normalColor = m_btnStartColour;
m_btnStartStop.colors = cb;
}
示例14: Start
/// <summary>
/// Unity Start() callback, we set up some initial values here.
/// </summary>
void Start ()
{
m_currentFPS = 0;
m_framesSinceUpdate = 0;
m_currentTime = 0.0f;
m_FPSText = "FPS = Calculating";
m_label = new Rect(Screen.width * 0.025f - 50, Screen.height * 0.96f - 25, 600.0f, 50.0f);
m_tangoApplication = FindObjectOfType<TangoApplication>();
m_tangoServiceVersion = TangoApplication.GetTangoServiceVersion();
}
示例15: Start
/// @cond
/// <summary>
/// Use this for initialization.
/// </summary>
public void Start()
{
m_pointCloud = FindObjectOfType<TangoPointCloud>();
m_tangoApplication = FindObjectOfType<TangoApplication>();
// All child objects are disabled until the floor is found.
foreach (Transform t in transform)
{
t.gameObject.SetActive(false);
}
}