add package files

This commit is contained in:
VR164000
2023-06-15 09:52:08 +08:00
parent 06d41412be
commit a0b3b91879
382 changed files with 44971 additions and 0 deletions

View File

@@ -0,0 +1,382 @@
// Unity Native Plugin API copyright © 2019 Unity Technologies ApS
//
// Licensed under the Unity Companion License for Unity - dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
//
// Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions.
#pragma once
#if UNITY
# include "Modules/XR/ProviderInterface/UnityXRTypes.h"
# include "Modules/XR/ProviderInterface/UnityXRSubsystemTypes.h"
#else
# include "UnityXRTypes.h"
# include "UnityXRSubsystemTypes.h"
#endif
#include <stddef.h>
#include <stdint.h>
/// @file IUnityXRMeshing.h
/// @brief XR interface for mesh generation and allocation of related data structures.
/// @see IUnityXRMeshInterface
/// The format used for an index buffer
typedef enum UnityXRIndexFormat
{
kUnityXRIndexFormat16Bit, ///< 16 bit indices, e.g., uint16_t
kUnityXRIndexFormat32Bit ///< 32 bit indices, e.g., uint32_t
} UnityXRIndexFormat;
/// The type of mesh data, e.g., points, triangles, quads, etc.
/// This affects how the vertex and index data are interpreted.
typedef enum UnityXRMeshTopology
{
/// The mesh data represents triangles, with 3 indices per triangle.
kUnityXRMeshTopologyTriangles,
/// The mesh data represents a triangle strip. There are 3 indices
/// for the first triangle, then every point after that is another triangle.
kUnityXRMeshTopologyTriangleStrip,
/// The mesh data represents quads, with 4 indices per quad.
kUnityXRMeshTopologyQuads,
/// The mesh data represents lines, with 2 indices per line.
kUnityXRMeshTopologyLines,
/// The mesh data represents a line strip. The are 2 indices
/// for the first line, then every index after that is another line.
kUnityXRMeshTopologyLineStrip,
/// The mesh data represents individual points, with 1 index per point.
kUnityXRMeshTopologyPoints
} UnityXRMeshTopology;
/// Flags representing vertex attributes
typedef enum UnityXRMeshVertexAttributeFlags
{
/// The vertex contains normal data
kUnityXRMeshVertexAttributeFlagsNormals = 1 << 0,
/// The vertex contains tangent data
kUnityXRMeshVertexAttributeFlagsTangents = 1 << 1,
/// The vertex contains uv data
kUnityXRMeshVertexAttributeFlagsUvs = 1 << 2,
/// The vertex contains color data
kUnityXRMeshVertexAttributeFlagsColors = 1 << 3
} UnityXRMeshVertexAttributeFlags;
/// Describes a single mesh, with buffers pointing to each vertex attribute.
/// Note: Unity uses a left-handed coordinate system with clockwise triangle winding.
/// +X is right
/// +Y is up
/// +Z is forward
typedef struct UnityXRMeshDescriptor
{
/// Pointer to positions buffer. May not be null.
UnityXRVector3* positions;
/// Pointer to normals buffer. May be null.
UnityXRVector3* normals;
/// Pointer to tangents buffer. May be null.
UnityXRVector4* tangents;
/// Pointer to uvs buffer. May be null.
UnityXRVector2* uvs;
/// Pointer to colors buffer. May be null.
UnityXRColorRGBA32* colors;
/// Index buffers
union
{
uint16_t* indices16; ///< Used if @a indexFormat is @a kUnityXRIndexFormat16Bit
uint32_t* indices32; ///< Used if @a indexFormat is @a kUnityXRIndexFormat32Bit
};
/// The number of vertices. Each non-null buffer above must
/// contain this number of elements.
size_t vertexCount;
/// The number of indices in the mesh.
size_t indexCount;
/// Which index format should be used, 16 or 32 bit.
UnityXRIndexFormat indexFormat;
/// The primitive type of the mesh data (e.g., points, lines, triangles, quads)
UnityXRMeshTopology topology;
} UnityXRMeshDescriptor;
/// Interface for allocating or setting mesh-related data
typedef struct UnityXRMeshDataAllocator UnityXRMeshDataAllocator;
/// A unique id assignable to a 'trackable', e.g. a plane or
/// point cloud point. Although this id is 128 bits, it may
/// not necessarily be globally unique; it just needs to be
/// unique to a particular XREnvironment session.
typedef struct UnityXRMeshId
{
/// 128-bit id data
uint64_t idPart[2];
} UnityXRMeshId;
#ifdef __cplusplus
inline bool operator==(const UnityXRMeshId& a, const UnityXRMeshId& b)
{
return
(a.idPart[0] == b.idPart[0]) &&
(a.idPart[1] == b.idPart[1]);
}
inline bool operator!=(const UnityXRMeshId& a, const UnityXRMeshId& b)
{
return
(a.idPart[0] != b.idPart[0]) ||
(a.idPart[1] != b.idPart[1]);
}
/// A comparator for UnityXRMeshId suitable for algorithms or containers that
/// require ordered UnityXRMeshIds, e.g. std::map
struct MeshIdLessThanComparator
{
bool operator()(const UnityXRMeshId& lhs, const UnityXRMeshId& rhs) const
{
if (lhs.idPart[0] == rhs.idPart[0])
{
return lhs.idPart[1] < rhs.idPart[1];
}
return lhs.idPart[0] < rhs.idPart[0];
}
};
#endif // __cplusplus
/// Information related to a mesh
typedef struct UnityXRMeshInfo
{
/// A session-unique identifier for the mesh.
UnityXRMeshId meshId;
/// True if the mesh has been updated (e.g., since the last query).
bool updated;
/// A hint for the system that determines when it should update
/// the corresponding Unity mesh.
int priorityHint;
} UnityXRMeshInfo;
/// An allocator for the @a UnityXRMeshInfo type.
typedef struct UnityXRMeshInfoAllocator UnityXRMeshInfoAllocator;
/// Enum describing the type of the bounding volume that will be passed
/// into @a SetBoundingVolume.
typedef enum UnityXRBoundingVolumeType
{
/// Axis Aligned Bounding Box bounding volume
kUnityXRBoundingVolumeAABB,
} UnityXRBoundingVolumeType;
/// Definition for an Axis Aligned Bounding Box (AABB).
/// This type of volume is aligned with the axis of the
/// current coordinate space. The definition of the
/// dimensions (m, cm, ft, etc.) is left up to the provider.
typedef struct UnityXRAABBBoundingVolume
{
/// The origin or center point for the AABB
/// In the current coordinate space.
UnityXRVector3 origin;
/// The extents of the AABB in each major axis
/// in the current coordinate space.
UnityXRVector3 extents;
} UnityXRAABBBoundingVolume;
/// Generic definition for a bounding volume passed to the
/// @a SetBoundingVolume api.
typedef struct UnityXRBoundingVolume
{
/// The type of the bounding volume described by
/// an instance of this struct.
/// See @a UnityXRBoundingVolumeType
UnityXRBoundingVolumeType type;
/// The actual bounding volume definition for
/// an instance of this struct. The specific field
/// to be used will be determined by what is set in the
/// @a type field.
union
{
/// See @a UnityXRAABBBoundingVolume
UnityXRAABBBoundingVolume aabb;
};
} UnityXRBoundingVolume;
/// Implement this interface for your mesh provider. A mesh provider will typically
/// provide multiple meshes, addressable by @a UnityXRMeshId.
typedef struct SUBSYSTEM_PROVIDER UnityXRMeshProvider
{
/// Plugin-specific data pointer. Every function in this structure will
/// be passed this data by the Unity runtime. The plugin should allocate
/// an appropriate data container for any information that is needed when
/// a callback function is called.
void* userData;
/// Invoked by Unity to retrieve information about every tracked mesh.
///
/// @param handle Handle obtained from UnityLifecycleProvider callbacks.
/// @param userData Value of userData field when provider was registered.
/// @param allocator Use this allocator to get a buffer of @a UnityXRMeshInfo.
/// This method should populate the buffer.
/// @return A @a UnitySubsystemErrorCode indicating success or failure.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * GetMeshInfos)(
UnitySubsystemHandle handle, void* userData, UnityXRMeshInfoAllocator * allocator);
/// Invoked from any thread by Unity to acquire a particular mesh by id.
/// This method should fill out a @a UnityXRMeshDescriptor using the provided
/// @a allocator. If the plugin owns the mesh memory, it should not mutate
/// the data until @a ReleaseMesh is called (see below).
///
/// @param handle Handle obtained from UnityLifecycleProvider callbacks.
/// @param userData Value of userData field when provider was registered.
/// @param meshId The session-unique identifier associated with this mesh.
/// @param allocator Used to either allocate a @a UnityXRMeshDescriptor from Unity
/// or provide one owned by the plugin.
/// @return A @a UnitySubsystemErrorCode indicating success or failure.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * AcquireMesh)(
UnitySubsystemHandle handle,
void* userData,
const UnityXRMeshId * meshId,
UnityXRMeshDataAllocator * allocator);
/// Invoked by Unity on the main thread to release a mesh by id.
/// This method should perform any required cleanup for the mesh.
///
/// @param handle Handle obtained from UnityLifecycleProvider callbacks.
/// @param userData Value of userData field when provider was registered.
/// @param meshId The session-unique identifier associated with this mesh.
/// @param mesh If the plugin owns the memory, then this is the same mesh
/// descriptor provided by the plugin in @a AcquireMesh. Otherwise, if Unity
/// owns the memory, then @a mesh will be null.
/// @param pluginData A pointer provided by the provider during @a AcquireMesh.
/// @return A @a UnitySubsystemErrorCode indicating success or failure.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * ReleaseMesh)(
UnitySubsystemHandle handle,
void* userData,
const UnityXRMeshId * meshId,
const UnityXRMeshDescriptor * mesh,
void* pluginData);
/// Invoked by Unity on the main thread to request a change in the density
/// of the generated meshes. Density level will be given as a value in the
/// range [0.0-1.0] and the provider will determine how best to map that
/// value to their implementation.
///
/// Setting this value does not guarantee an immediate change in the density
/// of any currently created mesh and may only change the density for new or
/// updated meshes.
///
/// @param handle Handle obtained from UnityLifecycleProvider callbacks.
/// @param userData Value of userData field when provider was registered.
/// @param density The requested density of generated meshes. Defined as a
/// float in the range [0.0-1.0]
/// @return A @a UnitySubsystemErrorCode indicating success or failure.
/// @a kUnitySubsystemErrorCodeSuccess Returned if everything is ok.
/// @a kUnitySubsystemErrorCodeInvalidArguments Returned if the density level
/// falls outside the expected range.
/// @a kUnitySubsystemErrorCodeNotSupported Returned if the provider does not
/// support this API in their implementation.
/// @a kUnitySubsystemErrorCodeFailure Returned for ny other error or issue
/// not defined above.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * SetMeshDensity)(
UnitySubsystemHandle handle,
void* userData,
float density);
/// Set the bounding volume to be used to restrict the space in which meshes will
/// be generated and tracked.
///
/// @param handle Handle obtained from UnityLifecycleProvider callbacks.
/// @param userData Value of userData field when provider was registered.
/// @param boundingVolume The bounding volume definition to use.
/// @return A @a UnitySubsystemErrorCode indicating success or failure.
/// @a kUnitySubsystemErrorCodeSuccess Returned if everything is ok.
/// @a kUnitySubsystemErrorCodeInvalidArguments Returned it the bounding
/// volume is null or the definition is incorrect.
/// @a kUnitySubsystemErrorCodeNotSupported Returned if the provider does not
/// support this API.
/// @a kUnitySubsystemErrorCodeNotSupported Returned if the provider does not
/// support the type of bounding volume being requested.
/// @a kUnitySubsystemErrorCodeFailure Returned for ny other error or issue
/// not defined above.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * SetBoundingVolume)(
UnitySubsystemHandle handle,
void* userData,
const UnityXRBoundingVolume* boundingVolume);
} UnityXRMeshProvider;
/// @brief XR interface for mesh generation and allocation of related data structures.
UNITY_DECLARE_INTERFACE(SUBSYSTEM_INTERFACE IUnityXRMeshInterface)
{
/// Allocates @a count @a UnityXRMeshInfo. Unity will periodically invoke your
/// plugin's @a GetMeshInfos function. Your plugin should then call
/// this function to allocate an array of @a UnityXRMeshInfo and populate them.
///
/// @param count The number of meshes currently tracked.
/// @return An array of @a UnityXRMeshInfo which the caller should populate with mesh info.
UnityXRMeshInfo* (UNITY_INTERFACE_API * MeshInfoAllocator_Allocate)(
UnityXRMeshInfoAllocator * allocator, size_t count);
/// Allocates mesh data according to the attributes specified in @a attributes.
/// Use this method if you want Unity to manage the mesh memory.
///
/// @param vertexCount The number of vertices to allocate.
/// @param triangleCount The number of triangles to allocate.
/// @param indexFormat The @a UnityXRIndexFormat indicating 16 or 32 bit indices
/// @param attributes The vertex attributes for which to allocate buffers.
UnityXRMeshDescriptor* (UNITY_INTERFACE_API * MeshDataAllocator_AllocateMesh)(
UnityXRMeshDataAllocator * allocator,
size_t vertexCount,
size_t indexCount,
UnityXRIndexFormat indexFormat,
UnityXRMeshVertexAttributeFlags attributes,
UnityXRMeshTopology topology);
/// Sets the mesh descriptor to use. Use this method if the plugin manages the memory.
/// The buffers pointed to by @a mesh must exist until Unity invokes @a ReleaseMesh.
///
/// @param meshDescriptor The mesh descriptor for a mesh. Unused vertex attributes should
/// be null. @a positions must be non null.
void(UNITY_INTERFACE_API * MeshDataAllocator_SetMesh)(
UnityXRMeshDataAllocator * allocator, const UnityXRMeshDescriptor * meshDescriptor);
/// (Optional) Set user data associated with this mesh. The userData pointer
/// will be passed back to the provider's @a ReleaseMesh method.
/// Use this to store additional data required to release the mesh.
///
/// @param userData A pointer which will be passed to ReleaseMesh
void(UNITY_INTERFACE_API * MeshDataAllocator_SetUserData)(
UnityXRMeshDataAllocator * allocator, void* userData);
/// Registers a mesh provider for your plugin to communicate mesh data back to Unity.
/// @param meshProvider The @a UnityXRMeshProvider which will be invoked by Unity to
/// retrieve mesh data.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * SUBSYSTEM_REGISTER_PROVIDER(UnityXRMeshProvider) RegisterMeshProvider)(
UnitySubsystemHandle handle, const UnityXRMeshProvider * meshProvider);
/// Entry-point for getting callbacks when the mesh subsystem is initialized / started / stopped / shutdown.
///
/// @param[in] pluginName Name of the plugin which was registered in your xr.json
/// @param[in] id Id of the subsystem that was registered in your xr.json
/// @param[in] provider Callbacks to register.
/// @return Status of function execution.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * RegisterLifecycleProvider)(
const char* pluginName, const char* id, const UnityLifecycleProvider * provider);
};
UNITY_REGISTER_INTERFACE_GUID(0x3007fd5885a346efULL, 0x9eeb2c84aa0a9dd9ULL, IUnityXRMeshInterface)

View File

@@ -0,0 +1,89 @@
// Unity Native Plugin API copyright © 2019 Unity Technologies ApS
//
// Licensed under the Unity Companion License for Unity - dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
//
// Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions.
#pragma once
#if UNITY
#include "Runtime/PluginInterface/Headers/IUnityInterface.h"
#else
#include "IUnityInterface.h"
#endif
#include "stddef.h"
/// Error codes for Subsystem operations
typedef enum UnitySubsystemErrorCode
{
/// Indicates a successful operation
kUnitySubsystemErrorCodeSuccess,
/// Indicates the operation failed
kUnitySubsystemErrorCodeFailure,
/// Indicates invalid arguments were passed to the method
kUnitySubsystemErrorCodeInvalidArguments,
/// Indicates this feature is not supported
kUnitySubsystemErrorCodeNotSupported,
// A request to allocate memory by a subsystem has failed or can not be completed.
kUnitySubsystemErrorCodeOutOfMemory
} UnitySubsystemErrorCode;
/// An UnitySubsystemHandle is an opaque type that's passed between the plugin and Unity. (C-API)
typedef void* UnitySubsystemHandle;
/// Event handler implemented by the plugin for subsystem specific lifecycle events (C-API).
typedef struct UnityLifecycleProvider
{
/// Plugin-specific data pointer. Every function in this structure will
/// be passed this data by the Unity runtime. The plugin should allocate
/// an appropriate data container for any information that is needed when
/// a callback function is called.
void* userData;
/// Initialize the subsystem.
///
/// @param handle Handle for the current subsystem which can be passed to methods related to that subsystem.
/// @param data Value of userData field when provider was registered.
/// @return Status of function execution.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * Initialize)(UnitySubsystemHandle handle, void* data);
/// Start the subsystem.
///
/// @param handle Handle for the current subsystem which can be passed to methods related to that subsystem.
/// @param data Value of userData field when provider was registered.
/// @return Status of function execution.
UnitySubsystemErrorCode(UNITY_INTERFACE_API * Start)(UnitySubsystemHandle handle, void* data);
/// Stop the subsystem.
///
/// @param handle Handle for the current subsystem which can be passed to methods related to that subsystem.
/// @param data Value of userData field when provider was registered.
void(UNITY_INTERFACE_API * Stop)(UnitySubsystemHandle handle, void* data);
/// Shutdown the subsystem.
///
/// @param handle Handle for the current subsystem which can be passed to methods related to that subsystem.
/// @param data Value of userData field when provider was registered.
void(UNITY_INTERFACE_API * Shutdown)(UnitySubsystemHandle handle, void* data);
} UnityLifecycleProvider;
// Macros and defines for back-compatibility code-gen (#defined to no-op when code-gen not running)
#if SUBSYSTEM_CODE_GEN
#define SUBSYSTEM_PROVIDER __attribute__((annotate("provider")))
#define SUBSYSTEM_INTERFACE __attribute__((annotate("interface")))
#define SUBSYSTEM_ADAPT_FROM(FUNC_NAME) __attribute__((annotate("adapt_from_" #FUNC_NAME)))
#define SUBSYSTEM_REGISTER_PROVIDER(PROVIDER) __attribute__((annotate("register_provider_" #PROVIDER)))
#define SUBSYSTEM_ADAPT_IN_PROVIDER_REGISTRATION __attribute__((annotate("in_provider_registration")))
#define UNITY_DECLARE_INTERFACE(NAME) struct NAME
#define UNITY_INTERFACE_API
#else
#define SUBSYSTEM_PROVIDER
#define SUBSYSTEM_INTERFACE
#define SUBSYSTEM_ADAPT_FROM(FUNC_NAME)
#define SUBSYSTEM_REGISTER_PROVIDER(PROVIDER)
#define SUBSYSTEM_ADAPT_IN_PROVIDER_REGISTRATION
#endif

View File

@@ -0,0 +1,17 @@
// Unity Native Plugin API copyright © 2019 Unity Technologies ApS
//
// Licensed under the Unity Companion License for Unity - dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
//
// Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions.
#pragma once
#include <stdint.h>
/// @cond undoc
#ifndef __cplusplus
#include <stdbool.h>
#endif
/// @endcond
/// The maximum length of a string, used in some structs with the subsystem headers
enum { kUnitySubsystemsStringSize = 128 };

View File

@@ -0,0 +1,15 @@
// Unity Native Plugin API copyright © 2019 Unity Technologies ApS
//
// Licensed under the Unity Companion License for Unity - dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
//
// Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions.
#pragma once
#if UNITY
#include "Modules/Subsystems/ProviderInterface/UnitySubsystemTypes.h"
#include "Runtime/PluginInterface/Headers/IUnityInterface.h"
#else
#include "UnitySubsystemTypes.h"
#include "IUnityInterface.h"
#endif
#include "stddef.h"

View File

@@ -0,0 +1,146 @@
// Unity Native Plugin API copyright © 2019 Unity Technologies ApS
//
// Licensed under the Unity Companion License for Unity - dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
//
// Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions.
#pragma once
#if UNITY
#include "Modules/Subsystems/ProviderInterface/UnityTypes.h"
#else
#include "UnityTypes.h"
#endif
/// The maximum length of a string, used in some structs with the XR headers
enum { kUnityXRStringSize = kUnitySubsystemsStringSize };
/// Simple 2-Element Float Vector
typedef struct UnityXRVector2
{
/// X component of the vector.
float x;
/// Y component of the vector.
float y;
} UnityXRVector2;
/// Simple 3-Element float vector
typedef struct UnityXRVector3
{
/// X component of the vector.
float x;
/// Y component of the vector.
float y;
/// Z component of the vector.
float z;
} UnityXRVector3;
/// Simple 4 Element Quaternion with indices ordered x, y, z, and w in order
typedef struct UnityXRVector4
{
/// X component of the vector.
float x;
/// Y component of the vector.
float y;
/// Z component of the vector.
float z;
/// W component of the vector.
float w;
} UnityXRVector4;
/// A simple struct representing a point in space with position and orientation
typedef struct UnityXRPose
{
/// Position of the pose.
UnityXRVector3 position;
/// Rotation of the pose, stored as a quaternion.
UnityXRVector4 rotation;
} UnityXRPose;
/// A 4x4 column-major matrix
typedef struct UnityXRMatrix4x4
{
///. The columns of the matrix
UnityXRVector4 columns[4];
} UnityXRMatrix4x4;
/// Multiple ways of representing a projection.
typedef enum UnityXRProjectionType
{
/// Projection represented as tangents of half angles from center.
kUnityXRProjectionTypeHalfAngles,
/// Projection represented as a 4x4 matrix.
kUnityXRProjectionTypeMatrix
} UnityXRProjectionType;
/// Projection as tangent of half angles on near plane.
typedef struct UnityXRProjectionHalfAngles
{
/// Tangent of the half angle from center to left clipping plane. (should be negative)
float left;
/// Tangent of the half angle from center to right clipping plane. (should be positive)
float right;
/// Tangent of the half angle from center to top clipping plane. (should be positive)
float top;
/// Tangent of the half angle from center to bottom clipping plane. (should be negative)
float bottom;
} UnityXRProjectionHalfAngles;
/// Container for the different methods of representing a projection matrix.
typedef struct UnityXRProjection
{
/// Choose the way this projection is represented.
UnityXRProjectionType type;
union
{
/// Valid if type is kUnityXRProjectionTypeHalfAngles.
UnityXRProjectionHalfAngles halfAngles;
/// Valid if type is kUnityXRProjectionTypeMatrix.
UnityXRMatrix4x4 matrix;
} data; ///< Contains all supported ways of representing a projection matrix.
} UnityXRProjection;
/// A 2D rectangle defined by X and Y position, width and height.
typedef struct UnityXRRectf
{
/// X position of the rectangle.
float x;
/// Y position of the rectangle.
float y;
/// Width of the rectangle.
float width;
/// Height of the rectangle.
float height;
} UnityXRRectf;
/// An RGBA color
typedef struct UnityXRColorRGBA32
{
/// The red channel
uint8_t red;
/// The green channel
uint8_t green;
/// The blue channel
uint8_t blue;
/// The alpha channel
uint8_t alpha;
} UnityXRColorRGBA32;
/// Represents milliseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.
typedef int64_t UnityXRTimeStamp;