1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
-
- namespace NRKernal
- {
- using System;
- using UnityEngine;
-
-
-
- public abstract class NRTrackable
- {
-
- internal UInt64 TrackableNativeHandle = 0;
- private NRTrackableSubsystem m_TrackableSubsystem;
- internal NRTrackableSubsystem TrackableSubsystem
- {
- get
- {
- if (m_TrackableSubsystem == null)
- {
- m_TrackableSubsystem = NRSessionManager.Instance.TrackableFactory.TrackableSubsystem;
- }
- return m_TrackableSubsystem;
- }
- }
-
-
-
- internal NRTrackable(UInt64 trackableNativeHandle)
- {
- TrackableNativeHandle = trackableNativeHandle;
- }
-
-
- public int GetDataBaseIndex()
- {
- UInt32 identify = TrackableSubsystem.GetIdentify(TrackableNativeHandle);
- identify &= 0X0000FFFF;
- return (int)identify;
- }
-
-
- public TrackingState GetTrackingState()
- {
- if (NRFrame.SessionStatus != SessionState.Running)
- {
- return TrackingState.Stopped;
- }
- return TrackableSubsystem.GetTrackingState(TrackableNativeHandle);
- }
-
- TrackableType trackableType;
-
-
- public TrackableType GetTrackableType()
- {
- if (NRFrame.SessionStatus != SessionState.Running)
- {
- return trackableType;
- }
- trackableType = TrackableSubsystem.GetTrackableType(TrackableNativeHandle);
- return trackableType;
- }
-
-
- public virtual Pose GetCenterPose()
- {
- return Pose.identity;
- }
-
-
- public NRAnchor CreateAnchor()
- {
- return NRAnchor.Factory(this);
- }
- }
- }
|