Загрузка PICO Unity OpenXR Integration SDK

This commit is contained in:
2024-12-21 10:28:02 +03:00
parent b2ecc77b2a
commit a2c2504d48
628 changed files with 68895 additions and 2 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 865e330f2b0cd4141ab4a4153d535675
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum ControllerKeyEnum
{
CONTROLLER_KEY_JOYSTICK=0,
CONTROLLER_KEY_MENU=1,
CONTROLLER_KEY_TRIGGER=2,
CONTROLLER_KEY_RIGHT_A=3,
CONTROLLER_KEY_RIGHT_B=4,
CONTROLLER_KEY_LEFT_X=5,
CONTROLLER_KEY_LEFT_Y=6,
CONTROLLER_KEY_LEFT_GRIP=7,
CONTROLLER_KEY_RIGHT_GRIP=8,
CONTROLLER_KEY_VOLUME_DOWN=9,
CONTROLLER_KEY_VOLUME_UP=10,
CONTROLLER_KEY_CLICK=11
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 71820ab70affcbd4faa8707df25e1725
timeCreated: 1685945465

View File

@ -0,0 +1,12 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum ControllerPairTimeEnum
{
DEFAULT=0,
FIFTEEN=15,
SIXTY=60,
ONE_HUNDRED_AND_TWENTY=120,
SIX_HUNDRED=600,
NEVER=-1
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 88ffdfff23fd922469ae84af0a209731
timeCreated: 1685943806

View File

@ -0,0 +1,13 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum CustomizeSettingsTabEnum
{
CUSTOMIZE_SETTINGS_TAB_WLAN = 0,
CUSTOMIZE_SETTINGS_TAB_CONTROLLER = 1,
CUSTOMIZE_SETTINGS_TAB_BLUETOOTH = 2,
CUSTOMIZE_SETTINGS_TAB_DISPLAY = 3,
CUSTOMIZE_SETTINGS_TAB_LAB = 4,
CUSTOMIZE_SETTINGS_TAB_GENERAL_LOCKSCREEN = 5,
CUSTOMIZE_SETTINGS_TAB_GENERAL_FACTORY_RESET = 6
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f2714615e3a23d9449fdf19cdf584b48
timeCreated: 1685945379

View File

@ -0,0 +1,8 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum DeviceControlEnum
{
DEVICE_CONTROL_REBOOT=0,
DEVICE_CONTROL_SHUTDOWN=1
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9cfd7333ed47ab44a874e4fe98c1c08d
timeCreated: 1685937183

View File

@ -0,0 +1,18 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum HomeEventEnum
{
SINGLE_CLICK=0,
DOUBLE_CLICK=1,
LONG_PRESS=2,
SINGLE_CLICK_RIGHT_CTL=3,
DOUBLE_CLICK_RIGHT_CTL=4,
LONG_PRESS_RIGHT_CTL=5,
SINGLE_CLICK_LEFT_CTL=6,
DOUBLE_CLICK_LEFT_CTL=7,
LONG_PRESS_LEFT_CTL=8,
SINGLE_CLICK_HMD=9,
DOUBLE_CLICK_HMD=10,
LONG_PRESS_HMD=11
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 599cdfc907c46d6488436b1622eafd50
timeCreated: 1685937306

View File

@ -0,0 +1,17 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum HomeFunctionEnum
{
VALUE_HOME_GO_TO_SETTING=0,
VALUE_HOME_BACK=1,
VALUE_HOME_RECENTER=2,
VALUE_HOME_OPEN_APP=3,
VALUE_HOME_DISABLE=4,
VALUE_HOME_GO_TO_HOME=5,
VALUE_HOME_SEND_BROADCAST=6,
VALUE_HOME_CLEAN_MEMORY=7,
VALUE_HOME_QUICK_SETTING=8,
VALUE_HOME_SCREEN_CAP=9,
VALUE_HOME_SCREEN_RECORD=10
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6effac1077bec9348aaf4f68c8787e7f
timeCreated: 1685937603

View File

@ -0,0 +1,10 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum PICOCastOptionOrStatusEnum
{
OPTION_RESOLUTION_LEVEL=0,
OPTION_BITRATE_LEVEL=1,
OPTION_AUDIO_ENABLE=2,
PICO_CAST_STATUS=3
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: aab97c5d20f1fe940beb18a3fe308e46
timeCreated: 1685945051

View File

@ -0,0 +1,22 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum PICOCastOptionValueEnum
{
OPTION_VALUE_RESOLUTION_HIGH,
OPTION_VALUE_RESOLUTION_MIDDLE,
OPTION_VALUE_RESOLUTION_AUTO,
OPTION_VALUE_RESOLUTION_HIGH_2K,
OPTION_VALUE_RESOLUTION_HIGH_4K,
OPTION_VALUE_BITRATE_HIGH,
OPTION_VALUE_BITRATE_MIDDLE,
OPTION_VALUE_BITRATE_LOW,
OPTION_VALUE_AUDIO_ON,
OPTION_VALUE_AUDIO_OFF,
STATUS_VALUE_STATE_STARTED,
STATUS_VALUE_STATE_STOPPED,
STATUS_VALUE_ERROR
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1de348b2dfe662e4b9053c101bbda4fa
timeCreated: 1685945106

View File

@ -0,0 +1,9 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum PICOCastUrlTypeEnum
{
NORMAL_URL=0,
NO_CONFIRM_URL=1,
RTMP_URL=2
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1d04bb6dfca248143bdd812fb00ea7b2
timeCreated: 1685944504

View File

@ -0,0 +1,8 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum PackageControlEnum
{
PACKAGE_SILENCE_INSTALL=0,
PACKAGE_SILENCE_UNINSTALL=1
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f9508b93fb3d76f49ae71ad9e3d679f9
timeCreated: 1685937232

View File

@ -0,0 +1,7 @@
namespace Unity.XR.PICO.TOBSupport
{
public class PicoCastMediaFormat
{
public int bitrate = -1;//kb
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8eca65ab8e7e4984a8415528a35a2f3d
timeCreated: 1686223794

View File

@ -0,0 +1,20 @@
using System;
using System.Runtime.InteropServices;
namespace Unity.XR.PICO.TOBSupport
{
public enum PoseErrorType
{
BRIGHT_LIGHT_ERROR = (1 << 0),
LOW_LIGHT_ERROR = (1 << 1),
LOW_FEATURE_COUNT_ERROR = (1 << 2),
CAMERA_CALIBRATION_ERROR = (1 << 3),
RELOCATION_IN_PROGRESS = (1 << 4),
INITILIZATION_IN_PROGRESS = (1 << 5),
NO_CAMERA_ERROR = (1 << 6),
NO_IMU_ERROR = (1 << 7),
IMU_JITTER_ERROR = (1 << 8),
UNKNOWN_ERROR = (1 << 9)
};
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 46bdaa338aeb42e4c813168706e540f3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum PowerOnOffLogoEnum
{
PLPowerOnLogo=0,
PLPowerOnAnimation=1,
PLPowerOffAnimation=2
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f7e0adfb5b4e8e342ad0fa15263e54ca
timeCreated: 1685945676

View File

@ -0,0 +1,13 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum ScreenOffDelayTimeEnum
{
THREE,
TEN ,
THIRTY ,
SIXTY,
THREE_HUNDRED,
SIX_HUNDRED ,
NEVER
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 22e9ab23329ae354097af770cf179472
timeCreated: 1685943725

View File

@ -0,0 +1,10 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum ScreencastAudioOutputEnum
{
AUDIO_ERROR=0,
AUDIO_SINK = 1,
AUDIO_TARGET = 2,
AUDIO_SINK_TARGET = 3,
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d484897b4d6e06b4281b6e25e222c723
timeCreated: 1685945230

View File

@ -0,0 +1,13 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum SleepDelayTimeEnum
{
FIFTEEN ,
THIRTY ,
SIXTY ,
THREE_HUNDRED ,
SIX_HUNDRED ,
ONE_THOUSAND_AND_EIGHT_HUNDRED ,
NEVER
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ca0a63d4310322847a9569df3fb34d4a
timeCreated: 1685943762

View File

@ -0,0 +1,13 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum StartVRSettingsEnum
{
START_VR_SETTINGS_ITEM_WIFI=0,
START_VR_SETTINGS_ITEM_BLUETOOT=1,
START_VR_SETTINGS_ITEM_CONTROLLER=2,
START_VR_SETTINGS_ITEM_LAB=3,
START_VR_SETTINGS_ITEM_BRIGHTNESS=4,
START_VR_SETTINGS_ITEM_GENERAL=5,
START_VR_SETTINGS_ITEM_NOTIFICATION=6
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 47b4eb0018f80d5428bed27d2e7f69bf
timeCreated: 1685944404

View File

@ -0,0 +1,8 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum SwitchEnum
{
S_ON=0,
S_OFF=1
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ef3b88f2e4c726543b34bbb0f0aca35f
timeCreated: 1685937261

View File

@ -0,0 +1,66 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum SystemFunctionSwitchEnum
{
SFS_USB=0,
SFS_AUTOSLEEP=1,
SFS_SCREENON_CHARGING=2,
SFS_OTG_CHARGING=3,
SFS_RETURN_MENU_IN_2DMODE=4,
SFS_COMBINATION_KEY=5,
SFS_CALIBRATION_WITH_POWER_ON=6,
SFS_SYSTEM_UPDATE=7,
SFS_CAST_SERVICE=8,
SFS_EYE_PROTECTION=9,
SFS_SECURITY_ZONE_PERMANENTLY=10,
SFS_GLOBAL_CALIBRATION=11,
SFS_Auto_Calibration=12,
SFS_USB_BOOT=13,
SFS_VOLUME_UI=14,
SFS_CONTROLLER_UI=15,
SFS_NAVGATION_SWITCH=16,
SFS_SHORTCUT_SHOW_RECORD_UI=17,
SFS_SHORTCUT_SHOW_FIT_UI=18,
SFS_SHORTCUT_SHOW_CAST_UI=19,
SFS_SHORTCUT_SHOW_CAPTURE_UI=20,
SFS_STOP_MEM_INFO_SERVICE=21,
SFS_START_APP_BOOT_COMPLETED=22,
SFS_USB_FORCE_HOST=23,
SFS_SET_DEFAULT_SAFETY_ZONE=24,
SFS_ALLOW_RESET_BOUNDARY=25,
SFS_BOUNDARY_CONFIRMATION_SCREEN=26,
SFS_LONG_PRESS_HOME_TO_RECENTER=27,
SFS_POWER_CTRL_WIFI_ENABLE=28,
SFS_WIFI_DISABLE=29,
SFS_SIX_DOF_SWITCH=30,
SFS_INVERSE_DISPERSION=31,
SFS_LOGCAT=32,
SFS_PSENSOR=33,
SFS_SYSTEM_UPDATE_OTA=34,
SFS_SYSTEM_UPDATE_APP=35,
SFS_SHORTCUT_SHOW_WLAN_UI=36,
SFS_SHORTCUT_SHOW_BOUNDARY_UI=37,
SFS_SHORTCUT_SHOW_BLUETOOTH_UI=38,
SFS_SHORTCUT_SHOW_CLEAN_TASK_UI=39,
SFS_SHORTCUT_SHOW_IPD_ADJUSTMENT_UI=40,
SFS_SHORTCUT_SHOW_POWER_UI=41,
SFS_SHORTCUT_SHOW_EDIT_UI=42,
SFS_BASIC_SETTING_APP_LIBRARY_UI=43,
SFS_BASIC_SETTING_SHORTCUT_UI=44,
SFS_LED_FLASHING_WHEN_SCREEN_OFF=45,
SFS_BASIC_SETTING_CUSTOMIZE_SETTING_UI=46,
SFS_BASIC_SETTING_SHOW_APP_QUIT_CONFIRM_DIALOG=47,
SFS_BASIC_SETTING_KILL_BACKGROUND_VR_APP=48,
SFS_BASIC_SETTING_SHOW_CAST_NOTIFICATION=49,
SFS_AUTOMATIC_IPD=50,
SFS_QUICK_SEETHROUGH_MODE=51,
SFS_HIGN_REFERSH_MODE=52,
SFS_SEETHROUGH_APP_KEEP_RUNNING=53,
SFS_OUTDOOR_TRACKING_ENHANCEMENT=54,
SFS_AUTOIPD_AUTO_COMFIRM=55,
SFS_LAUNCH_AUTOIPD_IF_GLASSES_WEARED=56,
SFS_GESTURE_RECOGNITION_HOME_ENABLE=57,
SFS_GESTURE_RECOGNITION_RESET_ENABLE=58,
SFS_AUTO_COPY_FILES_FROM_USB_DEVICE=59
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d478586fa3b0236429ce81bab6f48957
timeCreated: 1685943877

View File

@ -0,0 +1,20 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum SystemInfoEnum
{
ELECTRIC_QUANTITY=0,
PUI_VERSION=1,
EQUIPMENT_MODEL=2,
EQUIPMENT_SN=3,
CUSTOMER_SN=4,
INTERNAL_STORAGE_SPACE_OF_THE_DEVICE=5,
DEVICE_BLUETOOTH_STATUS=6,
BLUETOOTH_NAME_CONNECTED=7,
BLUETOOTH_MAC_ADDRESS=8,
DEVICE_WIFI_STATUS=9,
WIFI_NAME_CONNECTED=10,
WLAN_MAC_ADDRESS=11,
DEVICE_IP=12,
CHARGING_STATUS=13
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1fb47fac324da0244b89e5cba9b606db
timeCreated: 1685937098

View File

@ -0,0 +1,8 @@
namespace Unity.XR.PICO.TOBSupport
{
public enum USBConfigModeEnum
{
MTP=0,
CHARGE=1
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 83c4de97e8bbda3448a5180986a87c33
timeCreated: 1685944441

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c5c24af23d2b3de43bf3444f7edca288
timeCreated: 1685952511

View File

@ -0,0 +1,28 @@
using System;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class BindCallback : AndroidJavaProxy
{
public Action<bool> mCallback;
public BindCallback(Action<bool> callback) : base("com.picoxr.tobservice.interfaces.BoolCallback")
{
mCallback = callback;
}
public void CallBack(bool var1)
{
Debug.Log("ToBService bindCallBack 回调:" + var1);
PXR_EnterprisePlugin.GetServiceBinder();
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mCallback != null)
{
mCallback(var1);
}
});
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 51a5199660b7a714aae526c9e8ecf42e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
using System;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class BoolCallback : AndroidJavaProxy
{
public Action<bool> mCallback;
public BoolCallback(Action<bool> callback) : base("com.picoxr.tobservice.interfaces.BoolCallback")
{
mCallback = callback;
}
public void CallBack(bool var1)
{
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mCallback!=null)
{
mCallback(var1);
}
});
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4ec069c2f433a8649af361d7ff835006
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,50 @@
using System;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class FileCopyCallback: AndroidJavaProxy
{
public Action mOnCopyStart;
public Action<double> mOnCopyProgress;
public Action<int> mOnCopyFinish;
public FileCopyCallback(Action onCopyStart,Action<double> onCopyProgress,Action<int> onCopyFinish) : base("com.picoxr.tobservice.interfaces.FileCopyCallback")
{
mOnCopyStart = onCopyStart;
mOnCopyProgress = onCopyProgress;
mOnCopyFinish = onCopyFinish;
}
public void OnCopyStart()
{
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mOnCopyStart!=null)
{
mOnCopyStart();
}
});
}
public void OnCopyProgress(double var1)
{
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mOnCopyProgress!=null)
{
mOnCopyProgress(var1);
}
});
}
public void OnCopyFinish(int var1)
{
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mOnCopyFinish!=null)
{
mOnCopyFinish(var1);
}
});
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3f1ff22a32748af4ebc61fc3e215b7c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
using System;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class IntCallback : AndroidJavaProxy
{
public Action<int> mCallback;
public IntCallback(Action<int> callback) : base("com.picoxr.tobservice.interfaces.IntCallback")
{
mCallback = callback;
}
public void CallBack(int var1)
{
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mCallback != null)
{
mCallback(var1);
}
});
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 96277bb913de2a84e8f29f38fbdc9f29
timeCreated: 1685959032

View File

@ -0,0 +1,26 @@
using System;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class LongCallback : AndroidJavaProxy
{
public Action<long> mCallback;
public LongCallback(Action<long> callback) : base("com.picoxr.tobservice.interfaces.LongCallback")
{
mCallback = callback;
}
public void CallBack(long var1)
{
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mCallback != null)
{
mCallback(var1);
}
});
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: be7c175a931c58d43adc4dfd8b4919a2
timeCreated: 1685959096

View File

@ -0,0 +1,119 @@
using System;
using System.Collections;
using System.Collections.Generic;
using LitJson;
using UnityEngine;
using UnityEngine.XR;
#if PICO_XR
using Unity.XR.PXR;
#else
using Unity.XR.OpenXR.Features.PICOSupport;
#endif
namespace Unity.XR.PICO.TOBSupport
{
public class MarkerInfoCallback : AndroidJavaProxy
{
public Action<List<MarkerInfo>> mCallback;
private List<MarkerInfo> mlist = new List<MarkerInfo>();
private TrackingOriginModeFlags TrackingMode;
private float YOffset;
public MarkerInfoCallback(TrackingOriginModeFlags trackingMode, float cameraYOffset,
Action<List<MarkerInfo>> callback) : base("com.picoxr.tobservice.interfaces.StringCallback")
{
TrackingMode = trackingMode;
YOffset = cameraYOffset;
mCallback = callback;
mlist.Clear();
#if PICO_XR
#else
OpenXRExtensions.SetMarkMode();
#endif
}
public void CallBack(string var1)
{
Debug.Log("ToBService MarkerInfo Callback 回调:" + var1);
List<MarkerInfo> tmp = JsonToMarkerInfos(var1);
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mCallback != null)
{
mCallback(tmp);
}
});
}
public List<MarkerInfo> JsonToMarkerInfos(string json)
{
if (string.IsNullOrEmpty(json))
{
return null;
}
List<MarkerInfo> ModelList = new List<MarkerInfo>();
JsonData jsonData = JsonMapper.ToObject(json);
IDictionary dictionary = jsonData as IDictionary;
for (int i = 0; i < dictionary.Count; i++)
{
Debug.Log("TOB TestDemo---- MarkerInfo Callback 回调:1");
float OriginHeight = 0;
if (TrackingMode == TrackingOriginModeFlags.Device || TrackingMode == TrackingOriginModeFlags.Floor)
{
#if PICO_XR
OriginHeight = PXR_Plugin.System.UPxr_GetConfigFloat(ConfigType.ToDelaSensorY);
#else
float trackingorigin_height = PXR_EnterprisePlugin.oxr_get_trackingorigin_height();
float locationheight = OpenXRExtensions.GetLocationHeight();
if (TrackingMode == TrackingOriginModeFlags.Floor)
{
YOffset = 0;
OriginHeight = -trackingorigin_height;
}
else
{
// OriginHeight = trackingorigin_height + locationheight;
// OriginHeight = locationheight;
OriginHeight = -trackingorigin_height;
}
#endif
}
else
{
OriginHeight = 0;
YOffset = 0;
}
Debug.Log("TOB TestDemo---- MarkerInfo Callback 回调:OriginHeight"+OriginHeight );
MarkerInfo model = new MarkerInfo();
model.posX = double.Parse(jsonData[i]["posX"].ToString());
model.posY = double.Parse(jsonData[i]["posY"].ToString()) + OriginHeight + YOffset;
model.posZ = -double.Parse(jsonData[i]["posZ"].ToString());
model.rotationX = -double.Parse(jsonData[i]["rotationX"].ToString());
model.rotationY = -double.Parse(jsonData[i]["rotationY"].ToString());
model.rotationZ = double.Parse(jsonData[i]["rotationZ"].ToString());
model.rotationW = double.Parse(jsonData[i]["rotationW"].ToString());
model.validFlag = int.Parse(jsonData[i]["validFlag"].ToString());
model.markerType = int.Parse(jsonData[i]["markerType"].ToString());
model.iMarkerId = int.Parse(jsonData[i]["iMarkerId"].ToString());
model.dTimestamp = double.Parse(jsonData[i]["dTimestamp"].ToString());
IDictionary dictionaryReserve = jsonData[i]["reserve"] as IDictionary;
model.reserve = new float[dictionaryReserve.Count];
for (int j = 0; j < dictionaryReserve.Count; j++)
{
model.reserve[j] = float.Parse(jsonData[i]["reserve"][j].ToString());
}
ModelList.Add(model);
}
return ModelList;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0f3dd52fe57c0fc4490989b3e1841b24
timeCreated: 1686224891

View File

@ -0,0 +1,26 @@
using System;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class StringCallback : AndroidJavaProxy
{
public Action<string> mCallback;
public StringCallback(Action<string> callback) : base("com.picoxr.tobservice.interfaces.StringCallback")
{
mCallback = callback;
}
public void CallBack(string var1)
{
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mCallback != null)
{
mCallback(var1);
}
});
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0032579f19172484ebd2e85a16a8194d
timeCreated: 1685959143

View File

@ -0,0 +1,59 @@
using System;
using System.Collections;
using System.Collections.Generic;
using LitJson;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class WifiDisplayModelCallback : AndroidJavaProxy
{
public Action<List<WifiDisplayModel>> mCallback;
public WifiDisplayModelCallback(Action<List<WifiDisplayModel>> callback) : base("com.picoxr.tobservice.interfaces.StringCallback")
{
mCallback = callback;
}
public void CallBack(string var1)
{
Debug.Log("ToBService WifiDisplayModelCallback 回调:" + var1);
List<WifiDisplayModel> tmp = JsonToWifiDisplayModel(var1);
PXR_EnterpriseTools.QueueOnMainThread(() =>
{
if (mCallback != null)
{
mCallback(tmp);
}
});
}
public List<WifiDisplayModel> JsonToWifiDisplayModel(string json)
{
if (string.IsNullOrEmpty(json))
{
return null;
}
List<WifiDisplayModel> ModelList = new List<WifiDisplayModel>();
JsonData jsonData = JsonMapper.ToObject(json);
IDictionary dictionary = jsonData as IDictionary;
for (int i = 0; i < dictionary.Count; i++)
{
WifiDisplayModel model = new WifiDisplayModel();
model.deviceAddress = jsonData[i]["deviceAddress"].ToString();
model.deviceName = jsonData[i]["deviceName"].ToString();
model.isAvailable = bool.Parse(jsonData[i]["isAvailable"].ToString());
model.canConnect = bool.Parse(jsonData[i]["canConnect"].ToString());
model.isRemembered = bool.Parse(jsonData[i]["isRemembered"].ToString());
model.statusCode = int.Parse(jsonData[i]["statusCode"].ToString());
model.status = jsonData[i]["status"].ToString();
model.description = jsonData[i]["description"].ToString();
ModelList.Add(model);
}
return ModelList;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6cf02f2e31d415c41b26dd8e5108dada
timeCreated: 1686050869

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1f65db304235e324c898720b2c3f4ce1
timeCreated: 1686224723

View File

@ -0,0 +1,38 @@
using System.Linq;
namespace Unity.XR.PICO.TOBSupport
{
public class MarkerInfo
{
// position
public double posX;
public double posY;
public double posZ;
// rotation
public double rotationX;
public double rotationY;
public double rotationZ;
public double rotationW;
// 标志位:识别无效=0识别有效=1
public int validFlag;
// 类型:静态=1/动态=0
public int markerType;
// marker id
public int iMarkerId;
// 检测图像的时间戳
public double dTimestamp;
// 预留标志位
public float[] reserve;
public override string ToString()
{
return $"{nameof(posX)}: {posX}, {nameof(posY)}: {posY}, {nameof(posZ)}: {posZ}, {nameof(rotationX)}: {rotationX}, {nameof(rotationY)}: {rotationY}, {nameof(rotationZ)}: {rotationZ}, {nameof(rotationW)}: {rotationW}, {nameof(validFlag)}: {validFlag}, {nameof(markerType)}: {markerType}, {nameof(iMarkerId)}: {iMarkerId}, {nameof(dTimestamp)}: {dTimestamp}, {nameof(reserve)}: {string.Join(" ", reserve)}";
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f68848d9c705ba340a11b2713ae79b83
timeCreated: 1686224373

View File

@ -0,0 +1,23 @@
namespace Unity.XR.PICO.TOBSupport
{
public class WifiDisplayModel
{
public static int STATUS_NOT_CONNECT = -1;
public static int STATUS_NONE = 0;
public static int STATUS_SCANNING = 1;
public static int STATUS_CONNECTING = 2;
public static int STATUS_AVAILABLE = 3;
public static int STATUS_NOT_AVAILABLE = 4;
public static int STATUS_IN_USE = 5;
public static int STATUS_CONNECTED = 6;
public string deviceAddress;
public string deviceName;
public bool isAvailable;
public bool canConnect;
public bool isRemembered;
public int statusCode;
public string status;
public string description;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 39f5fd05aee2d0047932945fab6f46a1
timeCreated: 1686050281

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0ec549f2e9b5b3d48bab5cb6bcf28a7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b696a6381610a1f46b9bb9ca74202107
timeCreated: 1685947774

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aa2c6dd6feb090341b43b2f825f99a7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.PICO.TOBSupport
{
public class PXR_EnterpriseTools : MonoBehaviour
{
public struct NoDelayedQueueItem
{
public Action action;
}
private List<NoDelayedQueueItem> _actions = new List<NoDelayedQueueItem>();
List<NoDelayedQueueItem> _currentActions = new List<NoDelayedQueueItem>();
private static PXR_EnterpriseTools instance;
public void StartUp()
{
Debug.Log("ToBService PXR_EnterpriseTools StartUp");
}
public static PXR_EnterpriseTools Instance
{
get
{
if (instance == null)
{
instance = FindObjectOfType<PXR_EnterpriseTools>();
}
if (instance == null)
{
GameObject obj = new GameObject("PXR_EnterpriseTools");
instance = obj.AddComponent<PXR_EnterpriseTools>();
DontDestroyOnLoad(obj);
}
return instance;
}
}
public static void QueueOnMainThread(Action taction)
{
lock (instance._actions)
{
instance._actions.Add(new NoDelayedQueueItem { action = taction });
}
}
void Update()
{
if (_actions.Count > 0)
{
lock (_actions)
{
_currentActions.Clear();
_currentActions.AddRange(_actions);
_actions.Clear();
}
for (int i = 0; i < _currentActions.Count; i++)
{
_currentActions[i].action.Invoke();
}
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fba0173074665504b9adf96a28713621
timeCreated: 1686053214

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: daa051af13219a1469fa16186d42f6fa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,105 @@
using System;
using System.Runtime.InteropServices;
namespace Unity.XR.PICO.TOBSupport
{
// pico slam results
[StructLayout(LayoutKind.Sequential)]
public struct SixDof
{
public Int64 timestamp; // nanoseconds
public double x; // position X
public double y; // position Y
public double z; // position Z
public double rw; // rotation W
public double rx; // rotation X
public double ry; // rotation Y
public double rz; // rotation Z
public byte type; //1:6DOF 0:3DOF
public byte confidence; //1:good 0:bad
public PoseErrorType error;
public double plane_height;
public byte plane_status;
public byte relocation_status;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public byte[] reserved;
}
[StructLayout(LayoutKind.Sequential)]
public struct AlgoResult
{
public SixDof pose;
public SixDof relocation_pose;
public double vx, vy, vz; // linear velocity
public double ax, ay, az; // linear acceleration
public double wx, wy, wz; // angular velocity
public double w_ax, w_ay, w_az; // angular acceleration
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 48)]
public byte[] reserved;
}
[StructLayout(LayoutKind.Sequential)]
public struct FrameItem
{
public byte camera_id;
public UInt32 width; // width
public UInt32 height; // height
public UInt32 format; // format - rgb24
public UInt32 exposure_duration; // exposure duration:ns
public UInt64 timestamp; // start of exposure time:ns (BOOTTIME)
public UInt64 qtimer_timestamp; // nanoseconds in qtimer
public UInt64 framenumber; // frame number
public UInt32 datasize; // datasize
public IntPtr data; // image data.
}
[StructLayout(LayoutKind.Sequential)]
public struct FrameItemExt
{
public FrameItem frame;
public bool is_rgb;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public double[] rgb_tsw_matrix;
public bool is_anti_distortion;
public AlgoResult six_dof_pose;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] reserved;
}
[StructLayout(LayoutKind.Sequential)]
public struct Frame
{
public UInt32 width; // width
public UInt32 height; // height
public UInt64 timestamp; // start of exposure time:ns (BOOTTIME)
public UInt32 datasize; // datasize
public IntPtr data; // image data
public UnityEngine.Pose pose; // The head Pose at the time of image production.Right-handed coordinate system: X right, Y up, Z in
public int status; // sensor status(1:good 0:bad)
}
[StructLayout(LayoutKind.Sequential)]
public struct SensorState
{
public UnityEngine.Pose pose; // Predict the head Pose at the screen up time.Right-handed coordinate system: X right, Y up, Z in
public int status; // sensor status(1:good 0:bad)
}
[StructLayout(LayoutKind.Sequential)]
public struct RGBCameraParams
{
// Intrinsics
public double fx;
public double fy;
public double cx;
public double cy;
// Extrinsics
public double x;
public double y;
public double z;
public double rw;
public double rx;
public double ry;
public double rz;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4c86b575368aebb4f8e9f6075741d50b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: