123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491 |
- using System;
- using System.Runtime.InteropServices;
- internal static class OVRPlugin
- {
- public static Version version
- {
- get
- {
- if (OVRPlugin._version == null)
- {
- try
- {
- string text = OVRPlugin.OVRP_1_1_0.ovrp_GetVersion();
- if (text != null)
- {
- text = text.Split(new char[]
- {
- '-'
- })[0];
- OVRPlugin._version = new Version(text);
- }
- else
- {
- OVRPlugin._version = OVRPlugin._versionZero;
- }
- }
- catch
- {
- OVRPlugin._version = OVRPlugin._versionZero;
- }
- if (OVRPlugin._version == OVRPlugin.OVRP_0_5_0.version)
- {
- OVRPlugin._version = OVRPlugin.OVRP_0_1_0.version;
- }
- if (OVRPlugin._version > OVRPlugin._versionZero && OVRPlugin._version < OVRPlugin.OVRP_1_3_0.version)
- {
- throw new PlatformNotSupportedException(string.Concat(new object[]
- {
- "Oculus Utilities version ",
- OVRPlugin.wrapperVersion,
- " is too new for OVRPlugin version ",
- OVRPlugin._version.ToString(),
- ". Update to the latest version of Unity."
- }));
- }
- }
- return OVRPlugin._version;
- }
- }
- public static Version nativeSDKVersion
- {
- get
- {
- if (OVRPlugin._nativeSDKVersion == null)
- {
- try
- {
- string text = string.Empty;
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_1_0.version)
- {
- text = OVRPlugin.OVRP_1_1_0.ovrp_GetNativeSDKVersion();
- }
- else
- {
- text = OVRPlugin._versionZero.ToString();
- }
- if (text != null)
- {
- text = text.Split(new char[]
- {
- '-'
- })[0];
- OVRPlugin._nativeSDKVersion = new Version(text);
- }
- else
- {
- OVRPlugin._nativeSDKVersion = OVRPlugin._versionZero;
- }
- }
- catch
- {
- OVRPlugin._nativeSDKVersion = OVRPlugin._versionZero;
- }
- }
- return OVRPlugin._nativeSDKVersion;
- }
- }
- public static bool initialized
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetInitialized() == OVRPlugin.Bool.True;
- }
- }
- public static bool chromatic
- {
- get
- {
- return !(OVRPlugin.version >= OVRPlugin.OVRP_1_7_0.version) || OVRPlugin.OVRP_1_7_0.ovrp_GetAppChromaticCorrection() == OVRPlugin.Bool.True;
- }
- set
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_7_0.version)
- {
- OVRPlugin.OVRP_1_7_0.ovrp_SetAppChromaticCorrection(OVRPlugin.ToBool(value));
- }
- }
- }
- public static bool monoscopic
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetAppMonoscopic() == OVRPlugin.Bool.True;
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetAppMonoscopic(OVRPlugin.ToBool(value));
- }
- }
- public static bool rotation
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetTrackingOrientationEnabled() == OVRPlugin.Bool.True;
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetTrackingOrientationEnabled(OVRPlugin.ToBool(value));
- }
- }
- public static bool position
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetTrackingPositionEnabled() == OVRPlugin.Bool.True;
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetTrackingPositionEnabled(OVRPlugin.ToBool(value));
- }
- }
- public static bool useIPDInPositionTracking
- {
- get
- {
- return !(OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version) || OVRPlugin.OVRP_1_6_0.ovrp_GetTrackingIPDEnabled() == OVRPlugin.Bool.True;
- }
- set
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version)
- {
- OVRPlugin.OVRP_1_6_0.ovrp_SetTrackingIPDEnabled(OVRPlugin.ToBool(value));
- }
- }
- }
- public static bool positionSupported
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetTrackingPositionSupported() == OVRPlugin.Bool.True;
- }
- }
- public static bool positionTracked
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetNodePositionTracked(OVRPlugin.Node.EyeCenter) == OVRPlugin.Bool.True;
- }
- }
- public static bool powerSaving
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemPowerSavingMode() == OVRPlugin.Bool.True;
- }
- }
- public static bool hmdPresent
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetNodePresent(OVRPlugin.Node.EyeCenter) == OVRPlugin.Bool.True;
- }
- }
- public static bool userPresent
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetUserPresent() == OVRPlugin.Bool.True;
- }
- }
- public static bool headphonesPresent
- {
- get
- {
- return OVRPlugin.OVRP_1_3_0.ovrp_GetSystemHeadphonesPresent() == OVRPlugin.Bool.True;
- }
- }
- public static int recommendedMSAALevel
- {
- get
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version)
- {
- return OVRPlugin.OVRP_1_6_0.ovrp_GetSystemRecommendedMSAALevel();
- }
- return 2;
- }
- }
- public static OVRPlugin.SystemRegion systemRegion
- {
- get
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_5_0.version)
- {
- return OVRPlugin.OVRP_1_5_0.ovrp_GetSystemRegion();
- }
- return OVRPlugin.SystemRegion.Unspecified;
- }
- }
- public static string audioOutId
- {
- get
- {
- try
- {
- IntPtr intPtr = OVRPlugin.OVRP_1_1_0.ovrp_GetAudioOutId();
- if (intPtr != IntPtr.Zero)
- {
- OVRPlugin.GUID guid = (OVRPlugin.GUID)Marshal.PtrToStructure(intPtr, typeof(OVRPlugin.GUID));
- Guid guid2 = new Guid(guid.a, guid.b, guid.c, guid.d0, guid.d1, guid.d2, guid.d3, guid.d4, guid.d5, guid.d6, guid.d7);
- if (guid2 != OVRPlugin._cachedAudioOutGuid)
- {
- OVRPlugin._cachedAudioOutGuid = guid2;
- OVRPlugin._cachedAudioOutString = OVRPlugin._cachedAudioOutGuid.ToString();
- }
- return OVRPlugin._cachedAudioOutString;
- }
- }
- catch
- {
- }
- return string.Empty;
- }
- }
- public static string audioInId
- {
- get
- {
- try
- {
- IntPtr intPtr = OVRPlugin.OVRP_1_1_0.ovrp_GetAudioInId();
- if (intPtr != IntPtr.Zero)
- {
- OVRPlugin.GUID guid = (OVRPlugin.GUID)Marshal.PtrToStructure(intPtr, typeof(OVRPlugin.GUID));
- Guid guid2 = new Guid(guid.a, guid.b, guid.c, guid.d0, guid.d1, guid.d2, guid.d3, guid.d4, guid.d5, guid.d6, guid.d7);
- if (guid2 != OVRPlugin._cachedAudioInGuid)
- {
- OVRPlugin._cachedAudioInGuid = guid2;
- OVRPlugin._cachedAudioInString = OVRPlugin._cachedAudioInGuid.ToString();
- }
- return OVRPlugin._cachedAudioInString;
- }
- }
- catch
- {
- }
- return string.Empty;
- }
- }
- public static bool hasVrFocus
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetAppHasVrFocus() == OVRPlugin.Bool.True;
- }
- }
- public static bool shouldQuit
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetAppShouldQuit() == OVRPlugin.Bool.True;
- }
- }
- public static bool shouldRecenter
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetAppShouldRecenter() == OVRPlugin.Bool.True;
- }
- }
- public static string productName
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemProductName();
- }
- }
- public static string latency
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetAppLatencyTimings();
- }
- }
- public static float eyeDepth
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetUserEyeDepth();
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetUserEyeDepth(value);
- }
- }
- public static float eyeHeight
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetUserEyeHeight();
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetUserEyeHeight(value);
- }
- }
- public static float batteryLevel
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemBatteryLevel();
- }
- }
- public static float batteryTemperature
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemBatteryTemperature();
- }
- }
- public static int cpuLevel
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemCpuLevel();
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetSystemCpuLevel(value);
- }
- }
- public static int gpuLevel
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemGpuLevel();
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetSystemGpuLevel(value);
- }
- }
- public static int vsyncCount
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemVSyncCount();
- }
- set
- {
- OVRPlugin.OVRP_1_2_0.ovrp_SetSystemVSyncCount(value);
- }
- }
- public static float systemVolume
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemVolume();
- }
- }
- public static float ipd
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetUserIPD();
- }
- set
- {
- OVRPlugin.OVRP_1_1_0.ovrp_SetUserIPD(value);
- }
- }
- public static bool occlusionMesh
- {
- get
- {
- return OVRPlugin.OVRP_1_3_0.ovrp_GetEyeOcclusionMeshEnabled() == OVRPlugin.Bool.True;
- }
- set
- {
- OVRPlugin.OVRP_1_3_0.ovrp_SetEyeOcclusionMeshEnabled(OVRPlugin.ToBool(value));
- }
- }
- public static OVRPlugin.BatteryStatus batteryStatus
- {
- get
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetSystemBatteryStatus();
- }
- }
- public static OVRPlugin.Posef GetEyeVelocity(OVRPlugin.Eye eyeId)
- {
- return OVRPlugin.GetNodeVelocity((OVRPlugin.Node)eyeId, false);
- }
- public static OVRPlugin.Posef GetEyeAcceleration(OVRPlugin.Eye eyeId)
- {
- return OVRPlugin.GetNodeAcceleration((OVRPlugin.Node)eyeId, false);
- }
- public static OVRPlugin.Frustumf GetEyeFrustum(OVRPlugin.Eye eyeId)
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetNodeFrustum((OVRPlugin.Node)eyeId);
- }
- public static OVRPlugin.Sizei GetEyeTextureSize(OVRPlugin.Eye eyeId)
- {
- return OVRPlugin.OVRP_0_1_0.ovrp_GetEyeTextureSize(eyeId);
- }
- public static OVRPlugin.Posef GetTrackerPose(OVRPlugin.Tracker trackerId)
- {
- return OVRPlugin.GetNodePose((OVRPlugin.Node)(trackerId + 5), false);
- }
- public static OVRPlugin.Frustumf GetTrackerFrustum(OVRPlugin.Tracker trackerId)
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetNodeFrustum((OVRPlugin.Node)(trackerId + 5));
- }
- public static bool ShowUI(OVRPlugin.PlatformUI ui)
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_ShowSystemUI(ui) == OVRPlugin.Bool.True;
- }
- public static bool SetOverlayQuad(bool onTop, bool headLocked, IntPtr leftTexture, IntPtr rightTexture, IntPtr device, OVRPlugin.Posef pose, OVRPlugin.Vector3f scale, int layerIndex = 0, OVRPlugin.OverlayShape shape = OVRPlugin.OverlayShape.Quad)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version)
- {
- uint num = 0U;
- if (onTop)
- {
- num |= 1U;
- }
- if (headLocked)
- {
- num |= 2U;
- }
- if (shape == OVRPlugin.OverlayShape.Cylinder || shape == OVRPlugin.OverlayShape.Cubemap)
- {
- if (shape != OVRPlugin.OverlayShape.Cubemap || !(OVRPlugin.version >= OVRPlugin.OVRP_1_10_0.version))
- {
- return false;
- }
- num |= (uint)((uint)shape << 4);
- }
- return OVRPlugin.OVRP_1_6_0.ovrp_SetOverlayQuad3(num, leftTexture, rightTexture, device, pose, scale, layerIndex) == OVRPlugin.Bool.True;
- }
- return layerIndex == 0 && OVRPlugin.OVRP_0_1_1.ovrp_SetOverlayQuad2(OVRPlugin.ToBool(onTop), OVRPlugin.ToBool(headLocked), leftTexture, device, pose, scale) == OVRPlugin.Bool.True;
- }
- public static bool UpdateNodePhysicsPoses(int frameIndex, double predictionSeconds)
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && OVRPlugin.OVRP_1_8_0.ovrp_Update2(0, frameIndex, predictionSeconds) == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.Posef GetNodePose(OVRPlugin.Node nodeId, bool usePhysicsPose)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && usePhysicsPose)
- {
- return OVRPlugin.OVRP_1_8_0.ovrp_GetNodePose2(0, nodeId);
- }
- return OVRPlugin.OVRP_0_1_2.ovrp_GetNodePose(nodeId);
- }
- public static OVRPlugin.Posef GetNodeVelocity(OVRPlugin.Node nodeId, bool usePhysicsPose)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && usePhysicsPose)
- {
- return OVRPlugin.OVRP_1_8_0.ovrp_GetNodeVelocity2(0, nodeId);
- }
- return OVRPlugin.OVRP_0_1_3.ovrp_GetNodeVelocity(nodeId);
- }
- public static OVRPlugin.Posef GetNodeAcceleration(OVRPlugin.Node nodeId, bool usePhysicsPose)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && usePhysicsPose)
- {
- return OVRPlugin.OVRP_1_8_0.ovrp_GetNodeAcceleration2(0, nodeId);
- }
- return OVRPlugin.OVRP_0_1_3.ovrp_GetNodeAcceleration(nodeId);
- }
- public static bool GetNodePresent(OVRPlugin.Node nodeId)
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetNodePresent(nodeId) == OVRPlugin.Bool.True;
- }
- public static bool GetNodeOrientationTracked(OVRPlugin.Node nodeId)
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetNodeOrientationTracked(nodeId) == OVRPlugin.Bool.True;
- }
- public static bool GetNodePositionTracked(OVRPlugin.Node nodeId)
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetNodePositionTracked(nodeId) == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.ControllerState GetControllerState(uint controllerMask)
- {
- return OVRPlugin.OVRP_1_1_0.ovrp_GetControllerState(controllerMask);
- }
- public static bool SetControllerVibration(uint controllerMask, float frequency, float amplitude)
- {
- return OVRPlugin.OVRP_0_1_2.ovrp_SetControllerVibration(controllerMask, frequency, amplitude) == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.HapticsDesc GetControllerHapticsDesc(uint controllerMask)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version)
- {
- return OVRPlugin.OVRP_1_6_0.ovrp_GetControllerHapticsDesc(controllerMask);
- }
- return default(OVRPlugin.HapticsDesc);
- }
- public static OVRPlugin.HapticsState GetControllerHapticsState(uint controllerMask)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version)
- {
- return OVRPlugin.OVRP_1_6_0.ovrp_GetControllerHapticsState(controllerMask);
- }
- return default(OVRPlugin.HapticsState);
- }
- public static bool SetControllerHaptics(uint controllerMask, OVRPlugin.HapticsBuffer hapticsBuffer)
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version && OVRPlugin.OVRP_1_6_0.ovrp_SetControllerHaptics(controllerMask, hapticsBuffer) == OVRPlugin.Bool.True;
- }
- public static float GetEyeRecommendedResolutionScale()
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version)
- {
- return OVRPlugin.OVRP_1_6_0.ovrp_GetEyeRecommendedResolutionScale();
- }
- return 1f;
- }
- public static float GetAppCpuStartToGpuEndTime()
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_6_0.version)
- {
- return OVRPlugin.OVRP_1_6_0.ovrp_GetAppCpuStartToGpuEndTime();
- }
- return 0f;
- }
- public static bool GetBoundaryConfigured()
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && OVRPlugin.OVRP_1_8_0.ovrp_GetBoundaryConfigured() == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.BoundaryTestResult TestBoundaryNode(OVRPlugin.Node nodeId, OVRPlugin.BoundaryType boundaryType)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version)
- {
- return OVRPlugin.OVRP_1_8_0.ovrp_TestBoundaryNode(nodeId, boundaryType);
- }
- return default(OVRPlugin.BoundaryTestResult);
- }
- public static OVRPlugin.BoundaryTestResult TestBoundaryPoint(OVRPlugin.Vector3f point, OVRPlugin.BoundaryType boundaryType)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version)
- {
- return OVRPlugin.OVRP_1_8_0.ovrp_TestBoundaryPoint(point, boundaryType);
- }
- return default(OVRPlugin.BoundaryTestResult);
- }
- public static bool SetBoundaryLookAndFeel(OVRPlugin.BoundaryLookAndFeel lookAndFeel)
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && OVRPlugin.OVRP_1_8_0.ovrp_SetBoundaryLookAndFeel(lookAndFeel) == OVRPlugin.Bool.True;
- }
- public static bool ResetBoundaryLookAndFeel()
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && OVRPlugin.OVRP_1_8_0.ovrp_ResetBoundaryLookAndFeel() == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.BoundaryGeometry GetBoundaryGeometry(OVRPlugin.BoundaryType boundaryType)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version)
- {
- return OVRPlugin.OVRP_1_8_0.ovrp_GetBoundaryGeometry(boundaryType);
- }
- return default(OVRPlugin.BoundaryGeometry);
- }
- public static bool GetBoundaryGeometry2(OVRPlugin.BoundaryType boundaryType, IntPtr points, ref int pointsCount)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_9_0.version)
- {
- return OVRPlugin.OVRP_1_9_0.ovrp_GetBoundaryGeometry2(boundaryType, points, ref pointsCount) == OVRPlugin.Bool.True;
- }
- pointsCount = 0;
- return false;
- }
- public static OVRPlugin.AppPerfStats GetAppPerfStats()
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_9_0.version)
- {
- return OVRPlugin.OVRP_1_9_0.ovrp_GetAppPerfStats();
- }
- return default(OVRPlugin.AppPerfStats);
- }
- public static bool ResetAppPerfStats()
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_9_0.version && OVRPlugin.OVRP_1_9_0.ovrp_ResetAppPerfStats() == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.Vector3f GetBoundaryDimensions(OVRPlugin.BoundaryType boundaryType)
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version)
- {
- return OVRPlugin.OVRP_1_8_0.ovrp_GetBoundaryDimensions(boundaryType);
- }
- return default(OVRPlugin.Vector3f);
- }
- public static bool GetBoundaryVisible()
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && OVRPlugin.OVRP_1_8_0.ovrp_GetBoundaryVisible() == OVRPlugin.Bool.True;
- }
- public static bool SetBoundaryVisible(bool value)
- {
- return OVRPlugin.version >= OVRPlugin.OVRP_1_8_0.version && OVRPlugin.OVRP_1_8_0.ovrp_SetBoundaryVisible(OVRPlugin.ToBool(value)) == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.SystemHeadset GetSystemHeadsetType()
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_9_0.version)
- {
- return OVRPlugin.OVRP_1_9_0.ovrp_GetSystemHeadsetType();
- }
- return OVRPlugin.SystemHeadset.None;
- }
- public static OVRPlugin.Controller GetActiveController()
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_9_0.version)
- {
- return OVRPlugin.OVRP_1_9_0.ovrp_GetActiveController();
- }
- return OVRPlugin.Controller.None;
- }
- public static OVRPlugin.Controller GetConnectedControllers()
- {
- if (OVRPlugin.version >= OVRPlugin.OVRP_1_9_0.version)
- {
- return OVRPlugin.OVRP_1_9_0.ovrp_GetConnectedControllers();
- }
- return OVRPlugin.Controller.None;
- }
- private static OVRPlugin.Bool ToBool(bool b)
- {
- return (!b) ? OVRPlugin.Bool.False : OVRPlugin.Bool.True;
- }
- public static OVRPlugin.TrackingOrigin GetTrackingOriginType()
- {
- return OVRPlugin.OVRP_1_0_0.ovrp_GetTrackingOriginType();
- }
- public static bool SetTrackingOriginType(OVRPlugin.TrackingOrigin originType)
- {
- return OVRPlugin.OVRP_1_0_0.ovrp_SetTrackingOriginType(originType) == OVRPlugin.Bool.True;
- }
- public static OVRPlugin.Posef GetTrackingCalibratedOrigin()
- {
- return OVRPlugin.OVRP_1_0_0.ovrp_GetTrackingCalibratedOrigin();
- }
- public static bool SetTrackingCalibratedOrigin()
- {
- return OVRPlugin.OVRP_1_2_0.ovrpi_SetTrackingCalibratedOrigin() == OVRPlugin.Bool.True;
- }
- public static bool RecenterTrackingOrigin(OVRPlugin.RecenterFlags flags)
- {
- return OVRPlugin.OVRP_1_0_0.ovrp_RecenterTrackingOrigin((uint)flags) == OVRPlugin.Bool.True;
- }
- internal static bool ignoreVrFocus
- {
- set
- {
- OVRPlugin.OVRP_1_2_1.ovrp_SetAppIgnoreVrFocus(OVRPlugin.ToBool(value));
- }
- }
- public static readonly Version wrapperVersion = OVRPlugin.OVRP_1_10_0.version;
- private static Version _version;
- private static Version _nativeSDKVersion;
- private const int OverlayShapeFlagShift = 4;
- public const int AppPerfFrameStatsMaxCount = 5;
- private static Guid _cachedAudioOutGuid;
- private static string _cachedAudioOutString;
- private static Guid _cachedAudioInGuid;
- private static string _cachedAudioInString;
- private const string pluginName = "OVRPlugin";
- private static Version _versionZero = new Version(0, 0, 0);
- private struct GUID
- {
- public int a;
- public short b;
- public short c;
- public byte d0;
- public byte d1;
- public byte d2;
- public byte d3;
- public byte d4;
- public byte d5;
- public byte d6;
- public byte d7;
- }
- public enum Bool
- {
- False,
- True
- }
- public enum Eye
- {
- None = -1,
- Left,
- Right,
- Count
- }
- public enum Tracker
- {
- None = -1,
- Zero,
- One,
- Two,
- Three,
- Count
- }
- public enum Node
- {
- None = -1,
- EyeLeft,
- EyeRight,
- EyeCenter,
- HandLeft,
- HandRight,
- TrackerZero,
- TrackerOne,
- TrackerTwo,
- TrackerThree,
- Head,
- Count
- }
- public enum Controller
- {
- None,
- LTouch,
- RTouch,
- Touch,
- Remote,
- Gamepad = 16,
- Touchpad = 134217728,
- Active = -2147483648,
- All = -1
- }
- public enum TrackingOrigin
- {
- EyeLevel,
- FloorLevel,
- Count
- }
- public enum RecenterFlags
- {
- Default,
- IgnoreAll = -2147483648,
- Count
- }
- public enum BatteryStatus
- {
- Charging,
- Discharging,
- Full,
- NotCharging,
- Unknown
- }
- public enum PlatformUI
- {
- None = -1,
- GlobalMenu,
- ConfirmQuit,
- GlobalMenuTutorial
- }
- public enum SystemRegion
- {
- Unspecified,
- Japan,
- China
- }
- public enum SystemHeadset
- {
- None,
- GearVR_R320,
- GearVR_R321,
- GearVR_R322,
- GearVR_R323,
- Rift_DK1 = 4096,
- Rift_DK2,
- Rift_CV1
- }
- public enum OverlayShape
- {
- Quad,
- Cylinder,
- Cubemap
- }
- private enum OverlayFlag
- {
- None,
- OnTop,
- HeadLocked,
- ShapeFlag_Quad = 0,
- ShapeFlag_Cylinder = 16,
- ShapeFlag_Cubemap = 32,
- ShapeFlagRangeMask = 240
- }
- public struct Vector2i
- {
- public int x;
- public int y;
- }
- public struct Vector2f
- {
- public float x;
- public float y;
- }
- public struct Vector3f
- {
- public float x;
- public float y;
- public float z;
- }
- public struct Quatf
- {
- public float x;
- public float y;
- public float z;
- public float w;
- }
- public struct Posef
- {
- public OVRPlugin.Quatf Orientation;
- public OVRPlugin.Vector3f Position;
- }
- public struct ControllerState
- {
- public uint ConnectedControllers;
- public uint Buttons;
- public uint Touches;
- public uint NearTouches;
- public float LIndexTrigger;
- public float RIndexTrigger;
- public float LHandTrigger;
- public float RHandTrigger;
- public OVRPlugin.Vector2f LThumbstick;
- public OVRPlugin.Vector2f RThumbstick;
- }
- public struct HapticsBuffer
- {
- public IntPtr Samples;
- public int SamplesCount;
- }
- public struct HapticsState
- {
- public int SamplesAvailable;
- public int SamplesQueued;
- }
- public struct HapticsDesc
- {
- public int SampleRateHz;
- public int SampleSizeInBytes;
- public int MinimumSafeSamplesQueued;
- public int MinimumBufferSamplesCount;
- public int OptimalBufferSamplesCount;
- public int MaximumBufferSamplesCount;
- }
- public struct AppPerfFrameStats
- {
- public int HmdVsyncIndex;
- public int AppFrameIndex;
- public int AppDroppedFrameCount;
- public float AppMotionToPhotonLatency;
- public float AppQueueAheadTime;
- public float AppCpuElapsedTime;
- public float AppGpuElapsedTime;
- public int CompositorFrameIndex;
- public int CompositorDroppedFrameCount;
- public float CompositorLatency;
- public float CompositorCpuElapsedTime;
- public float CompositorGpuElapsedTime;
- public float CompositorCpuStartToGpuEndElapsedTime;
- public float CompositorGpuEndToVsyncElapsedTime;
- }
- public struct AppPerfStats
- {
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
- public OVRPlugin.AppPerfFrameStats[] FrameStats;
- public int FrameStatsCount;
- public OVRPlugin.Bool AnyFrameStatsDropped;
- public float AdaptiveGpuPerformanceScale;
- }
- public struct Sizei
- {
- public int w;
- public int h;
- }
- public struct Frustumf
- {
- public float zNear;
- public float zFar;
- public float fovX;
- public float fovY;
- }
- public enum BoundaryType
- {
- OuterBoundary = 1,
- PlayArea = 256
- }
- public struct BoundaryTestResult
- {
- public OVRPlugin.Bool IsTriggering;
- public float ClosestDistance;
- public OVRPlugin.Vector3f ClosestPoint;
- public OVRPlugin.Vector3f ClosestPointNormal;
- }
- public struct BoundaryLookAndFeel
- {
- public OVRPlugin.Colorf Color;
- }
- public struct BoundaryGeometry
- {
- public OVRPlugin.BoundaryType BoundaryType;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
- public OVRPlugin.Vector3f[] Points;
- public int PointsCount;
- }
- public struct Colorf
- {
- public float r;
- public float g;
- public float b;
- public float a;
- }
- private static class OVRP_0_1_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Sizei ovrp_GetEyeTextureSize(OVRPlugin.Eye eyeId);
- public static readonly Version version = new Version(0, 1, 0);
- }
- private static class OVRP_0_1_1
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetOverlayQuad2(OVRPlugin.Bool onTop, OVRPlugin.Bool headLocked, IntPtr texture, IntPtr device, OVRPlugin.Posef pose, OVRPlugin.Vector3f scale);
- public static readonly Version version = new Version(0, 1, 1);
- }
- private static class OVRP_0_1_2
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Posef ovrp_GetNodePose(OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetControllerVibration(uint controllerMask, float frequency, float amplitude);
- public static readonly Version version = new Version(0, 1, 2);
- }
- private static class OVRP_0_1_3
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Posef ovrp_GetNodeVelocity(OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Posef ovrp_GetNodeAcceleration(OVRPlugin.Node nodeId);
- public static readonly Version version = new Version(0, 1, 3);
- }
- private static class OVRP_0_5_0
- {
- public static readonly Version version = new Version(0, 5, 0);
- }
- private static class OVRP_1_0_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.TrackingOrigin ovrp_GetTrackingOriginType();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetTrackingOriginType(OVRPlugin.TrackingOrigin originType);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Posef ovrp_GetTrackingCalibratedOrigin();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_RecenterTrackingOrigin(uint flags);
- public static readonly Version version = new Version(1, 0, 0);
- }
- private static class OVRP_1_1_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetInitialized();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetVersion")]
- private static extern IntPtr _ovrp_GetVersion();
- public static string ovrp_GetVersion()
- {
- return Marshal.PtrToStringAnsi(OVRPlugin.OVRP_1_1_0._ovrp_GetVersion());
- }
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetNativeSDKVersion")]
- private static extern IntPtr _ovrp_GetNativeSDKVersion();
- public static string ovrp_GetNativeSDKVersion()
- {
- return Marshal.PtrToStringAnsi(OVRPlugin.OVRP_1_1_0._ovrp_GetNativeSDKVersion());
- }
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr ovrp_GetAudioOutId();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr ovrp_GetAudioInId();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetEyeTextureScale();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetEyeTextureScale(float value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetTrackingOrientationSupported();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetTrackingOrientationEnabled();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetTrackingOrientationEnabled(OVRPlugin.Bool value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetTrackingPositionSupported();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetTrackingPositionEnabled();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetTrackingPositionEnabled(OVRPlugin.Bool value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetNodePresent(OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetNodeOrientationTracked(OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetNodePositionTracked(OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Frustumf ovrp_GetNodeFrustum(OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.ControllerState ovrp_GetControllerState(uint controllerMask);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern int ovrp_GetSystemCpuLevel();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetSystemCpuLevel(int value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern int ovrp_GetSystemGpuLevel();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetSystemGpuLevel(int value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetSystemPowerSavingMode();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetSystemDisplayFrequency();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern int ovrp_GetSystemVSyncCount();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetSystemVolume();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.BatteryStatus ovrp_GetSystemBatteryStatus();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetSystemBatteryLevel();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetSystemBatteryTemperature();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetSystemProductName")]
- private static extern IntPtr _ovrp_GetSystemProductName();
- public static string ovrp_GetSystemProductName()
- {
- return Marshal.PtrToStringAnsi(OVRPlugin.OVRP_1_1_0._ovrp_GetSystemProductName());
- }
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_ShowSystemUI(OVRPlugin.PlatformUI ui);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetAppMonoscopic();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetAppMonoscopic(OVRPlugin.Bool value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetAppHasVrFocus();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetAppShouldQuit();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetAppShouldRecenter();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ovrp_GetAppLatencyTimings")]
- private static extern IntPtr _ovrp_GetAppLatencyTimings();
- public static string ovrp_GetAppLatencyTimings()
- {
- return Marshal.PtrToStringAnsi(OVRPlugin.OVRP_1_1_0._ovrp_GetAppLatencyTimings());
- }
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetUserPresent();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetUserIPD();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetUserIPD(float value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetUserEyeDepth();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetUserEyeDepth(float value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetUserEyeHeight();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetUserEyeHeight(float value);
- public static readonly Version version = new Version(1, 1, 0);
- }
- private static class OVRP_1_2_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetSystemVSyncCount(int vsyncCount);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrpi_SetTrackingCalibratedOrigin();
- public static readonly Version version = new Version(1, 2, 0);
- }
- private static class OVRP_1_2_1
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetAppIgnoreVrFocus(OVRPlugin.Bool value);
- public static readonly Version version = new Version(1, 2, 1);
- }
- private static class OVRP_1_3_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetEyeOcclusionMeshEnabled();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetEyeOcclusionMeshEnabled(OVRPlugin.Bool value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetSystemHeadphonesPresent();
- public static readonly Version version = new Version(1, 3, 0);
- }
- private static class OVRP_1_5_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.SystemRegion ovrp_GetSystemRegion();
- public static readonly Version version = new Version(1, 5, 0);
- }
- private static class OVRP_1_6_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetTrackingIPDEnabled();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetTrackingIPDEnabled(OVRPlugin.Bool value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.HapticsDesc ovrp_GetControllerHapticsDesc(uint controllerMask);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.HapticsState ovrp_GetControllerHapticsState(uint controllerMask);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetControllerHaptics(uint controllerMask, OVRPlugin.HapticsBuffer hapticsBuffer);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetOverlayQuad3(uint flags, IntPtr textureLeft, IntPtr textureRight, IntPtr device, OVRPlugin.Posef pose, OVRPlugin.Vector3f scale, int layerIndex);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetEyeRecommendedResolutionScale();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern float ovrp_GetAppCpuStartToGpuEndTime();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern int ovrp_GetSystemRecommendedMSAALevel();
- public static readonly Version version = new Version(1, 6, 0);
- }
- private static class OVRP_1_7_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetAppChromaticCorrection();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetAppChromaticCorrection(OVRPlugin.Bool value);
- public static readonly Version version = new Version(1, 7, 0);
- }
- private static class OVRP_1_8_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetBoundaryConfigured();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.BoundaryTestResult ovrp_TestBoundaryNode(OVRPlugin.Node nodeId, OVRPlugin.BoundaryType boundaryType);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.BoundaryTestResult ovrp_TestBoundaryPoint(OVRPlugin.Vector3f point, OVRPlugin.BoundaryType boundaryType);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetBoundaryLookAndFeel(OVRPlugin.BoundaryLookAndFeel lookAndFeel);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_ResetBoundaryLookAndFeel();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.BoundaryGeometry ovrp_GetBoundaryGeometry(OVRPlugin.BoundaryType boundaryType);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Vector3f ovrp_GetBoundaryDimensions(OVRPlugin.BoundaryType boundaryType);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetBoundaryVisible();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_SetBoundaryVisible(OVRPlugin.Bool value);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_Update2(int stateId, int frameIndex, double predictionSeconds);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Posef ovrp_GetNodePose2(int stateId, OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Posef ovrp_GetNodeVelocity2(int stateId, OVRPlugin.Node nodeId);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Posef ovrp_GetNodeAcceleration2(int stateId, OVRPlugin.Node nodeId);
- public static readonly Version version = new Version(1, 8, 0);
- }
- private static class OVRP_1_9_0
- {
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.SystemHeadset ovrp_GetSystemHeadsetType();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Controller ovrp_GetActiveController();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Controller ovrp_GetConnectedControllers();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_GetBoundaryGeometry2(OVRPlugin.BoundaryType boundaryType, IntPtr points, ref int pointsCount);
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.AppPerfStats ovrp_GetAppPerfStats();
- [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
- public static extern OVRPlugin.Bool ovrp_ResetAppPerfStats();
- public static readonly Version version = new Version(1, 9, 0);
- }
- private static class OVRP_1_10_0
- {
- public static readonly Version version = new Version(1, 10, 0);
- }
- }
|