Android build settings + metaxr

This commit is contained in:
2025-05-14 14:00:02 +03:00
parent 6a2bb7475e
commit d5aa21f55c
594 changed files with 200530 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,430 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OVR_Plugin_Deprecated_h
#define OVR_Plugin_Deprecated_h
#include "OVR_Plugin.h"
#include "OVR_Plugin_Types_Deprecated.h"
#ifdef __cplusplus
extern "C" {
#endif
// Deprecated to avoid an extra shutdown/initialize on the mobile side
OVRP_EXPORT ovrpResult ovrp_PreInitialize3(void* activity);
// Deprecated for adding an ovrpPreinitializeFlags parameter
OVRP_EXPORT ovrpResult ovrp_PreInitialize4(void* activity, ovrpRenderAPIType apiType);
// Deprecated for getting extra Vulkan paramters from Unity Oculus XR Plugin
OVRP_EXPORT ovrpResult ovrp_Initialize6(
ovrpRenderAPIType apiType,
ovrpLogCallback logCallback,
void* activity,
void* vkInstance,
void* vkPhysicalDevice,
void* vkDevice,
void* vkQueue,
void* vkGetInstanceProcAddr, // PFN_vkGetInstanceProcAddr
unsigned int vkQueueFamilyIndex,
int initializeFlags,
OVRP_CONSTREF(ovrpVersion) version);
OVRP_EXPORT ovrpResult ovrp_Initialize5(
ovrpRenderAPIType apiType,
ovrpLogCallback logCallback,
void* activity,
void* vkInstance,
void* vkPhysicalDevice,
void* vkDevice,
void* vkQueue,
int initializeFlags,
OVRP_CONSTREF(ovrpVersion) version);
// Deprecated by VRAPI_Vulkan changes
OVRP_EXPORT ovrpResult ovrp_PreInitialize2();
OVRP_EXPORT ovrpResult ovrp_Initialize4(
ovrpRenderAPIType apiType,
ovrpLogCallback logCallback,
void* activity,
void* instance,
int initializeFlags,
OVRP_CONSTREF(ovrpVersion) version);
// Deprecated by CAPI_Vulkan changes
OVRP_EXPORT ovrpResult ovrp_Initialize3(
ovrpRenderAPIType apiType,
ovrpLogCallback logCallback,
void* activity,
int initializeFlags,
OVRP_CONSTREF(ovrpVersion));
OVRP_EXPORT ovrpResult ovrp_BeginFrame3(int frameIndex);
OVRP_EXPORT ovrpResult
ovrp_EndFrame3(int frameIndex, ovrpLayerSubmit const* const* layerSubmitPtrs, int layerSubmitCount);
// Deprecated by WaitToBeginFrame/BeginFrame/EndFrame changes
OVRP_EXPORT ovrpResult ovrp_BeginFrame2(int frameIndex);
OVRP_EXPORT ovrpResult
ovrp_EndFrame2(int frameIndex, ovrpLayerSubmit const* const* layerSubmitPtrs, int layerSubmitCount);
// Deprecated by ovrpResult changes
OVRP_EXPORT ovrpBool ovrp_PreInitialize();
OVRP_EXPORT ovrpBool ovrp_Shutdown();
OVRP_EXPORT const char* ovrp_GetVersion();
OVRP_EXPORT const char* ovrp_GetNativeSDKVersion();
OVRP_EXPORT void* ovrp_GetNativeSDKPointer();
OVRP_EXPORT const void* ovrp_GetDisplayAdapterId();
OVRP_EXPORT const void* ovrp_GetAudioOutId();
OVRP_EXPORT const void* ovrp_GetAudioOutDeviceId();
OVRP_EXPORT const void* ovrp_GetAudioInId();
OVRP_EXPORT const void* ovrp_GetAudioInDeviceId();
OVRP_EXPORT ovrpBool ovrp_SetupDistortionWindow2(int flags);
OVRP_EXPORT ovrpBool ovrp_DestroyDistortionWindow();
OVRP_EXPORT ovrpBool
ovrp_SetupMirrorTexture(void* device, int height, int width, ovrpTextureFormat format, ovrpTextureHandle* result);
OVRP_EXPORT ovrpBool ovrp_DestroyMirrorTexture();
OVRP_EXPORT float ovrp_GetAdaptiveGpuPerformanceScale();
OVRP_EXPORT float ovrp_GetAppCpuStartToGpuEndTime();
OVRP_EXPORT ovrpVector2f ovrp_GetEyePixelsPerTanAngleAtCenter(int eyeIndex);
OVRP_EXPORT ovrpVector3f ovrp_GetHmdToEyeOffset(int eyeIndex);
OVRP_EXPORT ovrpBool ovrp_Update2(ovrpStep step, int frameIndex, double predictionSeconds);
OVRP_EXPORT ovrpBool ovrp_BeginFrame(int frameIndex);
OVRP_EXPORT ovrpBool ovrp_GetTrackingOrientationSupported();
OVRP_EXPORT ovrpBool ovrp_GetTrackingOrientationEnabled();
OVRP_EXPORT ovrpBool ovrp_SetTrackingOrientationEnabled(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_GetTrackingPositionSupported();
OVRP_EXPORT ovrpBool ovrp_GetTrackingPositionEnabled();
OVRP_EXPORT ovrpBool ovrp_SetTrackingPositionEnabled(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_GetTrackingIPDEnabled();
OVRP_EXPORT ovrpBool ovrp_SetTrackingIPDEnabled(ovrpBool value);
OVRP_EXPORT ovrpPosef ovrp_GetTrackingCalibratedOrigin();
OVRP_EXPORT ovrpBool ovrpi_SetTrackingCalibratedOrigin();
OVRP_EXPORT ovrpTrackingOrigin ovrp_GetTrackingOriginType();
OVRP_EXPORT ovrpBool ovrp_SetTrackingOriginType(ovrpTrackingOrigin originType);
OVRP_EXPORT ovrpBool ovrp_RecenterTrackingOrigin(unsigned int flags);
OVRP_EXPORT ovrpBool ovrp_GetNodePresent(ovrpNode nodeId);
OVRP_EXPORT ovrpBool ovrp_GetNodeOrientationTracked(ovrpNode nodeId);
OVRP_EXPORT ovrpBool ovrp_GetNodePositionTracked(ovrpNode nodeId);
OVRP_EXPORT ovrpBool ovrp_SetNodePositionTracked(ovrpNode nodeId, ovrpBool tracked);
OVRP_EXPORT ovrpPoseStatef ovrp_GetNodePoseState(ovrpStep step, ovrpNode nodeId);
OVRP_EXPORT ovrpControllerState ovrp_GetControllerState(ovrpController controllerMask);
OVRP_EXPORT ovrpControllerState2 ovrp_GetControllerState2(ovrpController controllerMask);
OVRP_EXPORT ovrpResult ovrp_GetControllerState3(ovrpController controllerMask, ovrpControllerState2* controllerState);
OVRP_EXPORT ovrpController ovrp_GetActiveController();
OVRP_EXPORT ovrpController ovrp_GetConnectedControllers();
OVRP_EXPORT ovrpBool ovrp_SetControllerVibration(ovrpController controllerMask, float frequency, float amplitude);
OVRP_EXPORT ovrpHapticsDesc ovrp_GetControllerHapticsDesc(ovrpController controllerMask);
OVRP_EXPORT ovrpHapticsState ovrp_GetControllerHapticsState(ovrpController controllerMask);
OVRP_EXPORT ovrpBool ovrp_SetControllerHaptics(ovrpController controllerMask, ovrpHapticsBuffer hapticsBuffer);
OVRP_EXPORT int ovrp_GetSystemCpuLevel();
OVRP_EXPORT ovrpBool ovrp_SetSystemCpuLevel(int value);
OVRP_EXPORT ovrpBool ovrp_SetAppCPUPriority(ovrpBool priority);
OVRP_EXPORT ovrpBool ovrp_GetAppCPUPriority();
OVRP_EXPORT int ovrp_GetSystemGpuLevel();
OVRP_EXPORT ovrpBool ovrp_SetSystemGpuLevel(int value);
OVRP_EXPORT ovrpBool ovrp_GetSystemPowerSavingMode();
OVRP_EXPORT float ovrp_GetSystemDisplayFrequency();
OVRP_EXPORT int ovrp_GetSystemVSyncCount();
OVRP_EXPORT ovrpBool ovrp_SetSystemVSyncCount(int value);
OVRP_EXPORT float ovrp_GetSystemVolume();
OVRP_EXPORT ovrpBool ovrp_GetSystemHeadphonesPresent();
OVRP_EXPORT ovrpBatteryStatus ovrp_GetSystemBatteryStatus();
OVRP_EXPORT float ovrp_GetSystemBatteryLevel();
OVRP_EXPORT float ovrp_GetSystemBatteryTemperature();
OVRP_EXPORT const char* ovrp_GetSystemProductName();
OVRP_EXPORT ovrpSystemRegion ovrp_GetSystemRegion();
OVRP_EXPORT ovrpBool ovrp_ShowSystemUI(ovrpUI ui);
OVRP_EXPORT ovrpBool ovrp_GetAppHasVrFocus();
OVRP_EXPORT ovrpBool ovrp_GetAppShouldQuit();
OVRP_EXPORT ovrpBool ovrp_GetAppShouldRecenter();
OVRP_EXPORT ovrpBool ovrp_GetAppShouldRecreateDistortionWindow();
OVRP_EXPORT const char* ovrp_GetAppLatencyTimings();
OVRP_EXPORT ovrpBool ovrp_SetAppEngineInfo(const char* engineName, const char* engineVersion, ovrpBool isEditor);
OVRP_EXPORT ovrpBool ovrp_GetUserPresent();
OVRP_EXPORT float ovrp_GetUserIPD();
OVRP_EXPORT ovrpBool ovrp_SetUserIPD(float value);
OVRP_EXPORT float ovrp_GetUserEyeHeight();
OVRP_EXPORT ovrpBool ovrp_SetUserEyeHeight(float value);
OVRP_EXPORT ovrpVector2f ovrp_GetUserNeckEyeDistance();
OVRP_EXPORT ovrpBool ovrp_SetUserNeckEyeDistance(ovrpVector2f value);
OVRP_EXPORT ovrpBool ovrp_SetupDisplayObjects(void* device, void* display, void* window);
OVRP_EXPORT ovrpBool ovrp_GetSystemMultiViewSupported();
OVRP_EXPORT ovrpBool ovrp_GetEyeTextureArraySupported();
OVRP_EXPORT ovrpBool ovrp_GetBoundaryConfigured();
OVRP_EXPORT ovrpBoundaryTestResult ovrp_TestBoundaryNode(ovrpNode node, ovrpBoundaryType boundaryType);
OVRP_EXPORT ovrpBoundaryTestResult ovrp_TestBoundaryPoint(ovrpVector3f point, ovrpBoundaryType boundaryType);
OVRP_EXPORT ovrpBool ovrp_GetBoundaryGeometry2(ovrpBoundaryType boundaryType, ovrpVector3f* points, int* pointsCount);
OVRP_EXPORT ovrpVector3f ovrp_GetBoundaryDimensions(ovrpBoundaryType boundaryType);
OVRP_EXPORT ovrpBool ovrp_GetBoundaryVisible();
OVRP_EXPORT ovrpBool ovrp_SetBoundaryVisible(ovrpBool value);
OVRP_EXPORT ovrpSystemHeadset ovrp_GetSystemHeadsetType();
OVRP_EXPORT ovrpAppPerfStats ovrp_GetAppPerfStats();
OVRP_EXPORT ovrpBool ovrp_ResetAppPerfStats();
OVRP_EXPORT float ovrp_GetAppFramerate();
OVRP_EXPORT int ovrp_GetSystemRecommendedMSAALevel();
OVRP_EXPORT ovrpBool ovrp_SetInhibitSystemUX(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_SetDebugDumpEnabled(ovrpBool value);
// Deprecated by UE4 integration changes
OVRP_EXPORT ovrpBool
ovrp_Initialize2(ovrpRenderAPIType apiType, ovrpLogCallback logCallback, ovrpBool supportsMixedRendering);
OVRP_EXPORT ovrpBool ovrp_SetupDistortionWindow();
OVRP_EXPORT ovrpBool ovrp_SetupEyeTexture2(
ovrpEye eyeId,
int stage,
void* device,
int height,
int width,
int samples,
ovrpTextureFormat format,
void* result);
OVRP_EXPORT ovrpBool ovrp_DestroyEyeTexture(ovrpEye eyeId, int stage);
OVRP_EXPORT ovrpSizei ovrp_GetEyeTextureSize(ovrpEye eyeId);
OVRP_EXPORT int ovrp_GetEyeTextureStageCount();
OVRP_EXPORT float ovrp_GetEyeRecommendedResolutionScale();
OVRP_EXPORT ovrpBool ovrp_GetEyeTextureFlippedY();
OVRP_EXPORT ovrpBool ovrp_SetEyeTextureFlippedY(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_GetEyeTextureShared();
OVRP_EXPORT ovrpBool ovrp_SetEyeTextureShared(ovrpBool value);
OVRP_EXPORT float ovrp_GetEyeTextureScale();
OVRP_EXPORT ovrpBool ovrp_SetEyeTextureScale(float value);
OVRP_EXPORT float ovrp_GetEyeViewportScale();
OVRP_EXPORT ovrpBool ovrp_SetEyeViewportScale(float value);
OVRP_EXPORT ovrpBool ovrp_GetEyeOcclusionMesh(int eyeIndex, float** vertices, int** indices, int* indexCount);
OVRP_EXPORT ovrpBool ovrp_GetEyeOcclusionMeshEnabled();
OVRP_EXPORT ovrpBool ovrp_SetEyeOcclusionMeshEnabled(ovrpBool value);
OVRP_EXPORT ovrpTextureFormat ovrp_GetDesiredEyeTextureFormat();
OVRP_EXPORT ovrpBool ovrp_SetDesiredEyeTextureFormat(ovrpTextureFormat value);
OVRP_EXPORT ovrpBool ovrp_GetEyePreviewRect(int eyeIndex, ovrpRecti* outputRect);
OVRP_EXPORT ovrpBool ovrp_GetAppChromaticCorrection();
OVRP_EXPORT ovrpBool ovrp_SetAppChromaticCorrection(ovrpBool value);
OVRP_EXPORT ovrpResult ovrp_GetReorientHMDOnControllerRecenter(ovrpBool* recenter);
OVRP_EXPORT ovrpResult ovrp_SetReorientHMDOnControllerRecenter(ovrpBool recenter);
OVRP_EXPORT ovrpBool ovrp_EndEye(ovrpEye eye);
OVRP_EXPORT ovrpBool ovrp_EndFrame(int frameIndex);
OVRP_EXPORT ovrpBool ovrpi_SetTrackingCalibratedOrigin();
OVRP_EXPORT ovrpPosef ovrp_GetNodeVelocity2(ovrpStep step, ovrpNode nodeId);
OVRP_EXPORT ovrpPosef ovrp_GetNodeAcceleration2(ovrpStep step, ovrpNode nodeId);
OVRP_EXPORT ovrpFrustumf ovrp_GetNodeFrustum(ovrpNode nodeId);
OVRP_EXPORT ovrpBool ovrp_GetAppMonoscopic();
OVRP_EXPORT ovrpBool ovrp_SetAppMonoscopic(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_GetAppSRGB();
OVRP_EXPORT ovrpBool ovrp_SetAppSRGB(ovrpBool value);
OVRP_EXPORT float ovrp_GetUserEyeDepth();
OVRP_EXPORT ovrpBool ovrp_SetUserEyeDepth(float value);
OVRP_EXPORT ovrpBool ovrp_SetEyeTextureArrayEnabled(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_GetEyeTextureArrayEnabled();
OVRP_EXPORT ovrpResult ovrp_GetAppAsymmetricFov(ovrpBool* useAsymmetricFov);
OVRP_EXPORT ovrpResult ovrp_SetAppAsymmetricFov(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_SetOverlayQuad3(
unsigned int flags,
void* textureLeft,
void* textureRight,
void* device,
ovrpPosef pose,
ovrpVector3f scale,
int layerIndex);
OVRP_EXPORT ovrpResult ovrp_EnqueueSetupLayer(ovrpLayerDesc* desc, int* layerId);
OVRP_EXPORT ovrpResult ovrp_EnqueueSetupLayer2(ovrpLayerDesc* desc, int compositionDepth, int* layerId);
OVRP_EXPORT ovrpResult ovrp_EnqueueDestroyLayer(int* layerId);
OVRP_EXPORT ovrpResult ovrp_GetLayerTexturePtr(int layerId, int stage, ovrpEye eyeId, void** texturePtr);
OVRP_EXPORT ovrpResult ovrp_EnqueueSubmitLayer(
unsigned int flags,
void* textureLeft,
void* textureRight,
int layerId,
int frameIndex,
OVRP_CONSTREF(ovrpPosef) pose,
OVRP_CONSTREF(ovrpVector3f) scale,
int layerIndex);
OVRP_EXPORT ovrpResult ovrp_EnqueueSubmitLayer2(
unsigned int flags,
void* textureLeft,
void* textureRight,
int layerId,
int frameIndex,
OVRP_CONSTREF(ovrpPosef) pose,
OVRP_CONSTREF(ovrpVector3f) scale,
int layerIndex,
ovrpBool overrideTextureRectMatrix,
OVRP_CONSTREF(ovrpTextureRectMatrixf) textureRectMatrix,
ovrpBool overridePerLayerColorScaleAndOffset,
OVRP_CONSTREF(ovrpVector4f) colorScale,
OVRP_CONSTREF(ovrpVector4f) colorOffset);
// Previously deprecated
OVRP_EXPORT ovrpBool ovrp_Initialize(ovrpRenderAPIType apiType, void* platformArgs);
OVRP_EXPORT ovrpBoundaryGeometry ovrp_GetBoundaryGeometry(ovrpBoundaryType boundaryType);
OVRP_EXPORT void* ovrp_GetNativePointer();
OVRP_EXPORT ovrpBool ovrp_DismissHSW();
OVRP_EXPORT void* ovrp_GetAdapterId();
OVRP_EXPORT int ovrp_GetBufferCount();
OVRP_EXPORT ovrpBool ovrp_SetEyeTexture(ovrpEye eyeId, void* texture, void* device);
OVRP_EXPORT ovrpBool ovrp_RecreateEyeTexture(
ovrpEye eyeId,
int stage,
void* device,
int height,
int width,
int samples,
ovrpBool isSRGB,
void* result);
OVRP_EXPORT ovrpBool ovrp_ReleaseEyeTexture(ovrpEye eyeId, int stage);
OVRP_EXPORT ovrpPosef ovrp_GetEyePose(ovrpEye eyeId);
OVRP_EXPORT ovrpPosef ovrp_GetEyeVelocity(ovrpEye eyeId);
OVRP_EXPORT ovrpPosef ovrp_GetEyeAcceleration(ovrpEye eyeId);
OVRP_EXPORT ovrpFrustumf ovrp_GetEyeFrustum(ovrpEye eyeId);
OVRP_EXPORT ovrpPosef ovrp_GetTrackerPose(ovrpTracker trackerId);
OVRP_EXPORT ovrpFrustumf ovrp_GetTrackerFrustum(ovrpTracker trackerId);
OVRP_EXPORT ovrpBool ovrp_RecenterPose();
OVRP_EXPORT ovrpInputState ovrp_GetInputState(ovrpController controllerMask);
OVRP_EXPORT ovrpBatteryStatus ovrp_GetBatteryStatus();
OVRP_EXPORT ovrpBool ovrp_ShowUI(ovrpUI ui);
OVRP_EXPORT ovrpCaps ovrp_GetCaps();
OVRP_EXPORT unsigned int ovrp_GetCaps2(unsigned int query);
OVRP_EXPORT ovrpBool ovrp_SetCaps(ovrpCaps caps);
OVRP_EXPORT ovrpStatus ovrp_GetStatus();
OVRP_EXPORT unsigned int ovrp_GetStatus2(unsigned int query);
OVRP_EXPORT float ovrp_GetFloat(ovrpKey key);
OVRP_EXPORT ovrpBool ovrp_SetFloat(ovrpKey key, float value);
OVRP_EXPORT const char* ovrp_GetString(ovrpKey key);
OVRP_EXPORT ovrpBool
ovrp_SetOverlayQuad(ovrpBool onTop, void* texture, void* device, ovrpPosef pose, ovrpVector3f scale);
OVRP_EXPORT ovrpBool ovrp_SetOverlayQuad2(
ovrpBool onTop,
ovrpBool headLocked,
void* texture,
void* device,
ovrpPosef pose,
ovrpVector3f scale);
OVRP_EXPORT ovrpResult ovrp_CalculateEyeLayerDesc(
ovrpLayout layout,
float textureScale,
int mipLevels,
int sampleCount,
ovrpTextureFormat format,
int layerFlags,
ovrpLayerDesc_EyeFov* layerDesc);
OVRP_EXPORT ovrpBool ovrp_SetAppIgnoreVrFocus(ovrpBool value);
OVRP_EXPORT ovrpBool ovrp_GetHeadphonesPresent();
OVRP_EXPORT ovrpBool ovrp_Update(int frameIndex);
OVRP_EXPORT ovrpPosef ovrp_GetNodePose(ovrpNode nodeId);
OVRP_EXPORT ovrpPosef ovrp_GetNodeVelocity(ovrpNode nodeId);
OVRP_EXPORT ovrpPosef ovrp_GetNodeAcceleration(ovrpNode nodeId);
/// Gets the texture handle for a specific layer stage and eye.
OVRP_EXPORT ovrpResult ovrp_GetLayerTexture(int layerId, int stage, ovrpEye eyeId, ovrpTextureHandle* textureHandle);
OVRP_EXPORT ovrpBool ovrp_SetupEyeTexture(
ovrpEye eyeId,
int stage,
void* device,
int height,
int width,
int samples,
ovrpBool isSRGB,
void* result);
OVRP_EXPORT ovrpPosef ovrp_GetNodePose2(ovrpStep step, ovrpNode nodeId);
OVRP_EXPORT ovrpResult ovrp_SetFunctionPointer(ovrpFunctionType funcType, void* funcPtr);
// Return success if updating depth info is finished
OVRP_EXPORT ovrpResult ovrp_SetDepthCompositingInfo(float zNear, float zFar, ovrpBool isReverseZ);
OVRP_EXPORT ovrpResult ovrp_SetOctilinearInfo(ovrpOctilinearLayout OctilinearLayout[ovrpEye_Count]);
/// Gets the current pose, acceleration, and velocity of the given node on the given update cadence.
OVRP_EXPORT ovrpResult ovrp_GetNodePoseState2(ovrpStep step, ovrpNode nodeId, ovrpPoseStatef* nodePoseState);
// Called by Unity render thread after finished each eye rendering
OVRP_EXPORT ovrpResult ovrp_EndEye2(ovrpEye eye, int frameIndex);
// Update depth projection info, this is a replacement of ovrp_SetDepthCompositingInfo for more generic purpose
OVRP_EXPORT ovrpResult ovrp_SetDepthProjInfo(float zNear, float zFar, ovrpBool isReverseZ);
// Deprecated
OVRP_EXPORT ovrpResult ovrp_SetASWEnable(ovrpBool enable);
// Deprecated
OVRP_EXPORT ovrpResult ovrp_GetASWEnable(ovrpBool* enable);
OVRP_EXPORT ovrpResult ovrp_GetSkeleton(ovrpSkeletonType skeletonType, ovrpSkeleton* skeleton);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,119 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OVR_Plugin_Insight_h
#define OVR_Plugin_Insight_h
#include "OVR_Plugin_Types.h"
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif
/// Tests if Insight Passthrough is supported on the device
OVRP_EXPORT ovrpResult ovrp_IsInsightPassthroughSupported(ovrpBool* supported);
/// Initialize Insight Passthrough functionality
OVRP_EXPORT ovrpResult ovrp_InitializeInsightPassthrough();
/// Shutdown Insight Passthrough functionality
OVRP_EXPORT ovrpResult ovrp_ShutdownInsightPassthrough();
/// Check whether Insight Passthrough functionality has been initialized
OVRP_EXPORT ovrpBool ovrp_GetInsightPassthroughInitialized();
/// Check whether Insight Passthrough functionality has been initialized
OVRP_EXPORT ovrpResult ovrp_GetInsightPassthroughInitializationState();
/// Create and initialize an Insight Passthrough triangle mesh
OVRP_EXPORT ovrpResult ovrp_CreateInsightTriangleMesh(
int layerId,
float* vertices,
int vertexCount,
int* triangles,
int triangleCount,
uint64_t* outMeshHandle);
/// Destroy a triangle mesh
OVRP_EXPORT ovrpResult ovrp_DestroyInsightTriangleMesh(uint64_t meshHandle);
/// Add a triangle mesh to the passthrough projection surface
OVRP_EXPORT ovrpResult ovrp_AddInsightPassthroughSurfaceGeometry(
int layerId,
uint64_t meshHandle,
ovrpMatrix4f transformation,
uint64_t* geometryInstanceHandle);
/// Remove a geometry instance from the passthrough projection surface and destroy it.
OVRP_EXPORT ovrpResult ovrp_DestroyInsightPassthroughGeometryInstance(uint64_t geometryInstanceHandle);
/// Update a transform of a geometry instance.
OVRP_EXPORT ovrpResult
ovrp_UpdateInsightPassthroughGeometryTransform(uint64_t geometryInstanceHandle, ovrpMatrix4f transformation);
OVRP_EXPORT ovrpResult ovrp_SetInsightPassthroughStyle(int layerId, ovrpInsightPassthroughStyle style);
// Set hands intensity
OVRP_EXPORT ovrpResult
ovrp_SetInsightPassthroughKeyboardHandsIntensity(int layerId, ovrpInsightPassthroughKeyboardHandsIntensity intensity);
// Gets passthrough capabilities.
OVRP_EXPORT ovrpResult ovrp_GetPassthroughCapabilityFlags(ovrpInsightPassthroughCapabilityFlags* capabilities);
OVRP_EXPORT ovrpResult ovrp_GetPassthroughCapabilities(ovrpInsightPassthroughCapabilities* capabilities);
OVRP_EXPORT ovrpResult ovrp_SetInsightPassthroughStyle2(int layerId, const ovrpInsightPassthroughStyle* style);
OVRP_EXPORT ovrpResult ovrp_CreatePassthroughColorLut(
ovrpPassthroughColorLutChannels channels,
ovrpUInt32 resolution,
ovrpPassthroughColorLutData data,
ovrpPassthroughColorLut* colorLut);
OVRP_EXPORT ovrpResult ovrp_DestroyPassthroughColorLut(ovrpPassthroughColorLut colorLut);
OVRP_EXPORT ovrpResult
ovrp_UpdatePassthroughColorLut(ovrpPassthroughColorLut colorLut, ovrpPassthroughColorLutData data);
OVRP_EXPORT ovrpResult ovrp_GetPassthroughPreferences(ovrpPassthroughPreferences* preferences);
#ifdef __cplusplus
}
#endif
#endif // OVR_Plugin_Insight_h

View File

@@ -0,0 +1,47 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OVR_Plugin_KtxLoader_h
#define OVR_Plugin_KtxLoader_h
#include "OVR_Plugin_Types.h"
#include <ktx.h>
#ifdef __cplusplus
extern "C" {
#endif
OVRP_EXPORT ovrpResult ovrp_KtxLoadFromMemory(unsigned char** data, unsigned int length, ktxTexture2** texture);
OVRP_EXPORT ovrpResult ovrp_KtxDestroy(ktxTexture2* texture);
OVRP_EXPORT ovrpResult ovrp_KtxNeedsTranscoding(ktxTexture2* texture, bool* needsTranscoding);
OVRP_EXPORT ovrpResult ovrp_KtxTranscode(ktxTexture2* texture, unsigned int format);
OVRP_EXPORT ovrpResult ovrp_KtxTextureWidth(ktxTexture2* texture, unsigned int* width);
OVRP_EXPORT ovrpResult ovrp_KtxTextureHeight(ktxTexture2* texture, unsigned int* height);
OVRP_EXPORT ovrpResult ovrp_KtxTextureSize(ktxTexture2* texture, unsigned int* size);
OVRP_EXPORT ovrpResult ovrp_KtxGetTextureData(ktxTexture2* texture, unsigned char* data, unsigned int bufferSize);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,112 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OVR_Plugin_Media_h
#define OVR_Plugin_Media_h
#include "OVR_Plugin_Types.h"
#ifdef __cplusplus
extern "C" {
#endif
OVRP_EXPORT ovrpResult ovrp_Media_Initialize();
OVRP_EXPORT ovrpResult ovrp_Media_Shutdown();
OVRP_EXPORT ovrpResult ovrp_Media_GetInitialized(ovrpBool* initialized);
OVRP_EXPORT ovrpResult ovrp_Media_Update();
OVRP_EXPORT ovrpResult ovrp_Media_GetMrcActivationMode(ovrpMediaMrcActivationMode* activationMode);
OVRP_EXPORT ovrpResult ovrp_Media_SetMrcActivationMode(ovrpMediaMrcActivationMode activationMode);
OVRP_EXPORT ovrpResult ovrp_Media_SetPlatformInitialized();
OVRP_EXPORT ovrpResult ovrp_Media_GetPlatformCameraMode(ovrpPlatformCameraMode* platformCameraMode);
OVRP_EXPORT ovrpResult ovrp_Media_SetPlatformCameraMode(ovrpPlatformCameraMode platformCameraMode);
OVRP_EXPORT ovrpResult ovrp_Media_IsMrcEnabled(ovrpBool* mrcEnabled);
OVRP_EXPORT ovrpResult ovrp_Media_IsMrcActivated(ovrpBool* mrcActivated);
OVRP_EXPORT ovrpResult ovrp_Media_UseMrcDebugCamera(ovrpBool* useMrcDebugCamera);
OVRP_EXPORT ovrpResult ovrp_Media_SetMrcInputVideoBufferType(ovrpMediaInputVideoBufferType inputVideoBufferType);
OVRP_EXPORT ovrpResult ovrp_Media_GetMrcInputVideoBufferType(ovrpMediaInputVideoBufferType* inputVideoBufferType);
OVRP_EXPORT ovrpResult ovrp_Media_SetMrcFrameSize(int frameWidth, int frameHeight);
OVRP_EXPORT ovrpResult ovrp_Media_GetMrcFrameSize(int* frameWidth, int* frameHeight);
OVRP_EXPORT ovrpResult ovrp_Media_SetMrcAudioSampleRate(int sampleRate);
OVRP_EXPORT ovrpResult ovrp_Media_GetMrcAudioSampleRate(int* sampleRate);
OVRP_EXPORT ovrpResult ovrp_Media_SetMrcFrameImageFlipped(ovrpBool flipped);
OVRP_EXPORT ovrpResult ovrp_Media_GetMrcFrameImageFlipped(ovrpBool* flipped);
OVRP_EXPORT ovrpResult ovrp_Media_SetMrcFrameInverseAlpha(ovrpBool inverseAlpha);
OVRP_EXPORT ovrpResult ovrp_Media_GetMrcFrameInverseAlpha(ovrpBool* inverseAlpha);
OVRP_EXPORT ovrpResult ovrp_Media_SetAvailableQueueIndexVulkan(unsigned int queueIndexVk);
OVRP_EXPORT ovrpResult ovrp_Media_EncodeMrcFrame(
void* videoData,
float* audioData,
int audioDataLen,
int audioChannels,
double timestamp,
int* outSyncId);
OVRP_EXPORT ovrpResult ovrp_Media_EncodeMrcFrameWithDualTextures(
void* backgroundTextureHandle,
void* foregroundTextureHandle,
float* audioData,
int audioDataLen,
int audioChannels,
double timestamp,
int* outSyncId);
OVRP_EXPORT ovrpResult ovrp_Media_SyncMrcFrame(int syncId);
OVRP_EXPORT ovrpResult ovrp_Media_EncodeMrcFrameWithPoseTime(
void* videoData,
float* audioData,
int audioDataLen,
int audioChannels,
double timestamp,
double poseTime,
int* outSyncId);
OVRP_EXPORT ovrpResult ovrp_Media_EncodeMrcFrameDualTexturesWithPoseTime(
void* backgroundTextureHandle,
void* foregroundTextureHandle,
float* audioData,
int audioDataLen,
int audioChannels,
double timestamp,
double poseTime,
int* outSyncId);
OVRP_EXPORT ovrpResult
ovrp_Media_SetHeadsetControllerPose(ovrpPosef headsetPose, ovrpPosef leftControllerPose, ovrpPosef rightControllerPose);
OVRP_EXPORT ovrpResult
ovrp_Media_EnumerateCameraAnchorHandles(int* inoutAnchorCount, ovrpCameraAnchorHandle* outHandleArray);
OVRP_EXPORT ovrpResult ovrp_Media_GetCurrentCameraAnchorHandle(ovrpCameraAnchorHandle* outHandle);
OVRP_EXPORT ovrpResult
ovrp_Media_GetCameraAnchorName(ovrpCameraAnchorHandle anchorHandle, char outAnchorName[OVRP_ANCHOR_NAME_SIZE]);
OVRP_EXPORT ovrpResult ovrp_Media_GetCameraAnchorHandle(const char* anchorName, ovrpCameraAnchorHandle* outHandle);
OVRP_EXPORT ovrpResult
ovrp_Media_GetCameraAnchorType(ovrpCameraAnchorHandle anchorHandle, ovrpCameraAnchorType* outAnchorType);
OVRP_EXPORT ovrpResult ovrp_Media_CreateCustomCameraAnchor(const char* anchorName, ovrpCameraAnchorHandle* outHandle);
OVRP_EXPORT ovrpResult ovrp_Media_DestroyCustomCameraAnchor(ovrpCameraAnchorHandle anchorHandle);
OVRP_EXPORT ovrpResult ovrp_Media_GetCustomCameraAnchorPose(ovrpCameraAnchorHandle anchorHandle, ovrpPosef* outPose);
OVRP_EXPORT ovrpResult ovrp_Media_SetCustomCameraAnchorPose(ovrpCameraAnchorHandle anchorHandle, ovrpPosef pose);
OVRP_EXPORT ovrpResult
ovrp_Media_GetCameraMinMaxDistance(ovrpCameraAnchorHandle anchorHandle, double* outMinDistance, double* outMaxDistance);
OVRP_EXPORT ovrpResult
ovrp_Media_SetCameraMinMaxDistance(ovrpCameraAnchorHandle anchorHandle, double minDistance, double maxDistance);
OVRP_EXPORT ovrpResult ovrp_Media_IsCastingToRemoteClient(ovrpBool* isCasting);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,146 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OVR_Plugin_MixedReality_h
#define OVR_Plugin_MixedReality_h
#include "OVR_Plugin_Types.h"
#if OVRP_MIXED_REALITY_PRIVATE
#include "OVR_Plugin_MixedReality_Private.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
//////////////////// Tracked Camera //////////////////////////
/// Initialize Mixed Reality functionalities
OVRP_EXPORT ovrpResult ovrp_InitializeMixedReality();
/// Shutdown Mixed Reality functionalities
OVRP_EXPORT ovrpResult ovrp_ShutdownMixedReality();
/// Check whether Mixed Reality functionalities has been initialized
OVRP_EXPORT ovrpBool ovrp_GetMixedRealityInitialized();
/// Update external camera. Need to be called before accessing the camera count or individual camera information
OVRP_EXPORT ovrpResult ovrp_UpdateExternalCamera();
/// Get the number of external cameras
OVRP_EXPORT ovrpResult ovrp_GetExternalCameraCount(int* cameraCount);
/// Get the name of an external camera
OVRP_EXPORT ovrpResult ovrp_GetExternalCameraName(int cameraId, char cameraName[OVRP_EXTERNAL_CAMERA_NAME_SIZE]);
/// Get intrinsics of an external camera
OVRP_EXPORT ovrpResult ovrp_GetExternalCameraIntrinsics(int cameraId, ovrpCameraIntrinsics* cameraIntrinsics);
/// Get extrinsics of an external camera
OVRP_EXPORT ovrpResult ovrp_GetExternalCameraExtrinsics(int cameraId, ovrpCameraExtrinsics* cameraExtrinsics);
/// Get the raw transform pose when the external camera was calibrated
OVRP_EXPORT ovrpResult ovrp_GetExternalCameraCalibrationRawPose(int cameraId, ovrpPosef* rawPose);
/// Override the FOV of the external camera
OVRP_EXPORT ovrpResult ovrp_OverrideExternalCameraFov(int cameraId, ovrpBool useOverriddenFov, const ovrpFovf* fov);
/// Get if the FOV of the external camera is overridden
OVRP_EXPORT ovrpResult ovrp_GetUseOverriddenExternalCameraFov(int cameraId, ovrpBool* useOverriddenFov);
/// Override the Pose of the external camera.
OVRP_EXPORT ovrpResult
ovrp_OverrideExternalCameraStaticPose(int cameraId, ovrpBool useOverriddenPose, const ovrpPosef* pose);
/// Get if the Pose of the external camera is overridden
OVRP_EXPORT ovrpResult ovrp_GetUseOverriddenExternalCameraStaticPose(int cameraId, ovrpBool* useOverriddenStaticPose);
/// Helper function to get the camera pose in the tracking space
OVRP_EXPORT ovrpResult ovrp_GetExternalCameraPose(int cameraId, ovrpPosef* cameraPose);
/// Helper function to get convert a pose in tracking space to camera space
OVRP_EXPORT ovrpResult
ovrp_ConvertPoseToCameraSpace(int cameraId, ovrpPosef* trackingSpacePose, ovrpPosef* cameraSpacePose);
/// Reset the manual external camera
/// On Quest, it would stop listenting to the MRC port if needed
OVRP_EXPORT ovrpResult ovrp_ResetDefaultExternalCamera();
/// Set a manual external camera to the system. The manual external camera is valid when there is no camera
/// configuration can be loaded On Quest, it would start listenting to the MRC port if needed
OVRP_EXPORT ovrpResult ovrp_SetDefaultExternalCamera(
const char* cameraName,
const ovrpCameraIntrinsics* cameraIntrinsics,
const ovrpCameraExtrinsics* cameraExtrinsics);
/// (PC only) set external camera intrinsics and extrinsics
OVRP_EXPORT ovrpResult ovrp_SetExternalCameraProperties(
const char* cameraName,
const ovrpCameraIntrinsics* cameraIntrinsics,
const ovrpCameraExtrinsics* cameraExtrinsics);
// {{ DEPRECATED
// The following functions will be moved to OVR_Plugin_MixedReality_Deprecated.h after Unreal Plugin revision
OVRP_EXPORT ovrpResult
ovrp_EnumerateAllCameraDevices(ovrpCameraDevice* deviceArray, int deviceArraySize, int* deviceCount);
OVRP_EXPORT ovrpResult
ovrp_EnumerateAvailableCameraDevices(ovrpCameraDevice* deviceArray, int deviceArraySize, int* deviceCount);
OVRP_EXPORT ovrpResult ovrp_UpdateCameraDevices();
OVRP_EXPORT ovrpResult ovrp_IsCameraDeviceAvailable2(ovrpCameraDevice camera, ovrpBool* available);
OVRP_EXPORT ovrpResult
ovrp_SetCameraDevicePreferredColorFrameSize(ovrpCameraDevice camera, ovrpSizei preferredColorFrameSize);
OVRP_EXPORT ovrpResult ovrp_OpenCameraDevice(ovrpCameraDevice camera);
OVRP_EXPORT ovrpResult ovrp_CloseCameraDevice(ovrpCameraDevice camera);
OVRP_EXPORT ovrpResult ovrp_HasCameraDeviceOpened2(ovrpCameraDevice camera, ovrpBool* opened);
OVRP_EXPORT ovrpResult ovrp_GetCameraDeviceIntrinsicsParameters(
ovrpCameraDevice camera,
ovrpBool* supportIntrinsics,
ovrpCameraDeviceIntrinsicsParameters* intrinsicsParameters);
OVRP_EXPORT ovrpResult ovrp_IsCameraDeviceColorFrameAvailable2(ovrpCameraDevice camera, ovrpBool* available);
OVRP_EXPORT ovrpResult ovrp_GetCameraDeviceColorFrameSize(ovrpCameraDevice camera, ovrpSizei* colorFrameSize);
OVRP_EXPORT ovrpResult ovrp_GetCameraDeviceColorFrameBgraPixels(
ovrpCameraDevice camera,
const ovrpByte** colorFrameBgraPixels,
int* colorFrameRowPitch);
OVRP_EXPORT ovrpResult ovrp_DoesCameraDeviceSupportDepth(ovrpCameraDevice camera, ovrpBool* supportDepth);
OVRP_EXPORT ovrpResult
ovrp_GetCameraDeviceDepthSensingMode(ovrpCameraDevice camera, ovrpCameraDeviceDepthSensingMode* depthSensingMode);
OVRP_EXPORT ovrpResult
ovrp_SetCameraDeviceDepthSensingMode(ovrpCameraDevice camera, ovrpCameraDeviceDepthSensingMode depthSensingMode);
OVRP_EXPORT ovrpResult
ovrp_GetCameraDevicePreferredDepthQuality(ovrpCameraDevice camera, ovrpCameraDeviceDepthQuality* depthQuality);
OVRP_EXPORT ovrpResult
ovrp_SetCameraDevicePreferredDepthQuality(ovrpCameraDevice camera, ovrpCameraDeviceDepthQuality depthQuality);
OVRP_EXPORT ovrpResult ovrp_IsCameraDeviceDepthFrameAvailable(ovrpCameraDevice camera, ovrpBool* available);
OVRP_EXPORT ovrpResult ovrp_GetCameraDeviceDepthFrameSize(ovrpCameraDevice camera, ovrpSizei* depthFrameSize);
OVRP_EXPORT ovrpResult
ovrp_GetCameraDeviceDepthFramePixels(ovrpCameraDevice camera, const float** depthFramePixels, int* depthFrameRowPitch);
OVRP_EXPORT ovrpResult ovrp_GetCameraDeviceDepthConfidencePixels(
ovrpCameraDevice camera,
const float** depthConfidencePixels,
int* depthConfidenceRowPitch);
// }} DEPRECATED
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,38 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OVR_Plugin_MixedReality_Deprecated_h
#define OVR_Plugin_MixedReality_Deprecated_h
#include "OVR_Plugin_MixedReality.h"
#ifdef __cplusplus
extern "C" {
#endif
OVRP_EXPORT ovrpBool ovrp_IsCameraDeviceAvailable(ovrpCameraDevice camera);
OVRP_EXPORT ovrpBool ovrp_HasCameraDeviceOpened(ovrpCameraDevice camera);
OVRP_EXPORT ovrpBool ovrp_IsCameraDeviceColorFrameAvailable(ovrpCameraDevice camera);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,237 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* Licensed under the Oculus SDK License Agreement (the "License");
* you may not use the Oculus SDK except in compliance with the License,
* which is provided at the time of installation or download, or which
* otherwise accompanies this software in either electronic or hard copy form.
*
* You may obtain a copy of the License at
*
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Oculus SDK
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OVR_Plugin_Types_Deprecated_h
#define OVR_Plugin_Types_Deprecated_h
#include "OVR_Plugin_Types.h"
#if defined ANDROID || defined __linux__
#define __cdecl
#endif
/// Symmetric frustum for a camera.
typedef struct {
/// Near clip plane.
float zNear;
/// Far clip plane.
float zFar;
/// Horizontal field of view.
float fovX;
/// Vertical field of view.
float fovY;
} ovrpFrustumf;
const static ovrpFrustumf s_identityFrustum = {0, 0, 0, 0};
/// Describes Input State for use with Gamepads and Oculus Controllers.
typedef struct {
unsigned int ConnectedControllerTypes;
unsigned int Buttons;
unsigned int Touches;
unsigned int NearTouches;
float IndexTrigger[2];
float HandTrigger[2];
ovrpVector2f Thumbstick[2];
ovrpVector2f Touchpad[2];
} ovrpControllerState2;
/// Describes Input State for use with Gamepads and Oculus Controllers.
typedef struct {
unsigned int ConnectedControllerTypes;
unsigned int Buttons;
unsigned int Touches;
unsigned int NearTouches;
float IndexTrigger[2];
float HandTrigger[2];
ovrpVector2f Thumbstick[2];
} ovrpControllerState;
typedef ovrpControllerState ovrpInputState;
typedef struct ovrpSkeleton_ {
ovrpSkeletonType SkeletonType;
unsigned int NumBones;
unsigned int NumBoneCapsules;
ovrpBone Bones[ovrpSkeletonConstants_MaxHandBones];
ovrpBoneCapsule BoneCapsules[ovrpSkeletonConstants_MaxBoneCapsules];
} ovrpSkeleton;
// Old UUID type
typedef struct ovrpSpatialEntityUuid {
// unique id value
ovrpUInt64 value[OVRP_SPATIAL_ENTITY_UUID_SIZE];
} ovrpSpatialEntityUuid;
// Backward compatibility for Unreal integration
typedef ovrpSpatialAnchorCreateInfo ovrpSpaceAnchorCreateInfo;
// Single Space Load is no longer supported
typedef struct ovrpEventSpaceStorageLoadResult_ {
ovrpEventType EventType;
ovrpUInt64 requestId;
ovrpSpace space;
ovrpResult result;
ovrpSpatialEntityUuid uuid;
} ovrpEventSpaceStorageLoadResult;
/// Capability bits that control the plugin's configuration.
/// Each value corresponds to a left-shift offset in the bitfield.
typedef enum {
/// If true, sRGB read-write occurs, reducing eye texture aliasing.
ovrpCap_SRGB = 0,
/// If true, the image will be corrected for chromatic aberration.
ovrpCap_Chromatic,
/// If true, eye textures are flipped on the Y axis before display.
ovrpCap_FlipInput,
/// If true, head tracking affects the rotation reported by ovrp_GetEyePose.
ovrpCap_Rotation,
/// (Deprecated) If true, head rotation affects the position reported by ovrp_GetEyePose.
ovrpCap_HeadModel,
/// If true, head position tracking affects the poses returned by ovrp_GetEyePose.
ovrpCap_Position,
/// If true, the runtime collects performance statistics for debugging.
ovrpCap_CollectPerf,
/// If true, a debugging heads-up display appears in the scene.
ovrpCap_DebugDisplay,
/// If true, the left eye image is shown to both eyes. Right is ignored.
ovrpCap_Monoscopic,
/// If true, both eyes share texture 0, with the left eye on the left side.
ovrpCap_ShareTexture,
/// If true, a clip mesh will be provided for both eyes
ovrpCap_OcclusionMesh,
ovrpCap_EnumSize = 0x7fffffff
} ovrpCaps;
/// Read-only bits that reflect the plugins' current status.
/// Each value corresponds to a left-shift offset in the bitfield.
typedef enum {
/// If true, the VR display is virtual and no physical device is attached.
ovrpStatus_Debug = 0,
/// (Deprecated) If true, the health & safety warning is currently visible.
ovrpStatus_HSWVisible,
/// If true, the HMD supports position tracking (e.g. a camera is attached).
ovrpStatus_PositionSupported,
/// If true, position tracking is active and not obstructed.
ovrpStatus_PositionTracked,
/// If true, the system has reduced performance to save power.
ovrpStatus_PowerSaving,
/// If true, the plugin is initialized and ready for use.
ovrpStatus_Initialized,
/// If true, a working VR display is present, but it may be a "debug" display.
ovrpStatus_HMDPresent,
/// If true, the user is currently wearing the VR display and it is not idle.
ovrpStatus_UserPresent,
/// If true, the app has VR focus.
ovrpStatus_HasVrFocus,
/// If true, the app should quit as soon as possible.
ovrpStatus_ShouldQuit,
/// If true, the app should call ovrp_RecenterPose as soon as possible.
ovrpStatus_ShouldRecenter,
/// If true, we need to recreate the session
ovrpStatus_ShouldRecreateDistortionWindow,
ovrpStatus_EnumSize = 0x7fffffff
} ovrpStatus;
typedef enum {
/// (String) Identifies the version of OVRPlugin you are using. Format: "major.minor.release"
ovrpKey_Version,
/// (String) Identifies the type of VR display device in use, if any.
ovrpKey_ProductName,
/// (String) The latest measured latency.
ovrpKey_Latency,
/// (Float) The physical distance from the front of the player's eye to the back of their neck
/// in meters.
ovrpKey_EyeDepth,
/// (Float) The physical height of the player's eyes from the ground in meters.
ovrpKey_EyeHeight,
/// (Float, read-only) The current available battery charge, ranging from 0 (empty) to 1 (full).
ovrpKey_BatteryLevel,
/// (Float, read-only) The current battery temperature in degrees Celsius.
ovrpKey_BatteryTemperature,
/// (Float) The current CPU performance level, rounded down to nearest integer in the range 0-2.
ovrpKey_CpuLevel,
/// (Float) The current GPU performance level, rounded down to nearest integer in the range 0-2.
ovrpKey_GpuLevel,
/// (Float, read-only) The current system volume level.
ovrpKey_SystemVolume,
/// (Float) The fraction of a frame ahead to predict poses and allow GPU-CPU parallelism.
/// Trades latency for performance.
ovrpKey_QueueAheadFraction,
/// (Float) The physical inter-pupillary distance (IPD) separating the user's eyes in meters.
ovrpKey_IPD,
/// (Float) The number of allocated eye texture texels per screen pixel in each direction
/// (horizontal and vertical).
ovrpKey_NativeTextureScale,
/// (Float) The number of rendered eye texture texels per screen pixel based on viewport scaling.
ovrpKey_VirtualTextureScale,
/// (Float) The native refresh rate of the HMD.
ovrpKey_Frequency,
/// (String) The version of the underlying SDK in use.
ovrpKey_SDKVersion,
ovrpKey_EnumSize = 0x7fffffff
} ovrpKey;
typedef ovrpShape ovrpOverlayShape;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpedantic"
#endif // __clang__
typedef enum {
ovrpOverlayFlag_None = 0x00000000,
/// If true, the overlay appears on top of all lower-indexed layers and the eye buffers.
ovrpOverlayFlag_OnTop = 0x00000001,
/// If true, the overlay bypasses TimeWarp and directly follows head motion.
ovrpOverlayFlag_HeadLocked = 0x00000002,
/// If true, the overlay will not allow depth compositing on Rift.
ovrpOverlayFlag_NoDepth = 0x00000004,
// If true, the overlay will use the VrApi supersample flag, which can be helpful but is extremely expensive.
ovrpOverlayFlag_ExpensiveSuperSample = 0x00000008,
// if true, the overlay will use the Vrapi efficient supersample flag
ovrpOverlayFlag_EfficientSuperSample = 0x00000010,
// If true, the overlay will use the Vrapi sharpen flag
ovrpOverlayFlag_EfficientSharpen = 0x00000020,
// If true, the overlay will use bicubic filtering flag
ovrpOverlayFlag_BicubicFiltering = 0x00000040,
// If true, the overlay will use the Vrapi sharpen flag
ovrpOverlayFlag_QualitySharpen = 0x00000080,
// If true, the overlay will be "secure content"; the contents cannot be recorded by users
ovrpOverlayFlag_SecureContent = 0x00000100,
ovrpOverlayFlag_Hidden = 0x00000200,
ovrpOverlayFlag_AutoFilter = 0x00000400,
// Internal flags
/// If true, the overlay is a loading screen.
ovrpOverlayFlag_LoadingScreen = 0x40000000,
/// If true, the overlay bypasses distortion and is copied directly to the display
/// (possibly with scaling).
ovrpOverlayFlag_Undistorted = 0x80000000,
ovrpOverlayFlag_EnumSize = 0x7fffffff
} ovrpOverlayFlag;
#ifdef __clang__
#pragma clang diagnostic pop
#endif // __clang__
#endif

View File

@@ -0,0 +1,17 @@
Copyright (c) Meta Platforms, Inc. and affiliates.
All rights reserved.
Licensed under the Oculus SDK License Agreement (the "License");
you may not use the Oculus SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
https://developer.oculus.com/licenses/oculussdk/
Unless required by applicable law or agreed to in writing, the Oculus SDK
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,25 @@
// @lint-ignore-every LICENSELINT
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class OVRPluginXR : ModuleRules
{
public OVRPluginXR(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
string SourceDirectory = "$(PluginDir)/Source/ThirdParty/OVRPlugin/OVRPlugin/";
PublicIncludePaths.Add(SourceDirectory + "Include");
if (Target.Platform == UnrealTargetPlatform.Android)
{
RuntimeDependencies.Add(SourceDirectory + "Lib/arm64-v8a/OpenXR/libOVRPlugin.so");
}
}
}