API reference
API reference
Select your platform
No SDKs available
No versions available

OVRGLTFAccessor Class

Extends IDisposable
This class follows the GLTF 2.0 specification for loading data. For more information, refer to the Binary Data Storage section on the GLTF 2.0 specification site.
This class is intended to be used in conjunction with the . It is not recommended to use these functions outside of the context of GLTF loading.

Static Member Functions

Tries to create a OVRGLTFAccessor object by checking if the binary stream data provided is a valid GLTF binary chunk.
Parameters
accessorsRoot
JSON node containing the GLTF accessors.
bufferViewsRoot
JSON node containing the GLTF buffer views.
buffersRoot
JSON node containing the GLTF buffers.
binaryChunk
Binary stream of the entire GLTF file.
dataAccessor
A valid OVRGLTFAccessor that can be used to access data in the GLTF binary stream.
Returns
If the OVRGLTFAccessor was created successfully.

Member Functions

Indexes into the GLTF accessors JSONNode provided to the TryCreate method and moves the binary data stream position based on the accessor's data.
Parameters
accessorIndex
The index to a accessor in the accessor array.
onlyBufferView
If the position should be set to just the start of the buffer view.
Reads data as floats from the binary stream, using the current accessor set by Seek.
Returns
An array of floats.
Read data as integers from the binary stream, using the current accessor set by Seek.
Returns
An array of integers.
Read data as 2D vectors from the binary stream, using the current accessor set by Seek
Returns
An array of Vector2s
Read data from the binary stream as 3D vectors, using the current accessor set by Seek.
Parameters
conversionScale
Coversion scale that is applied to each Vector3.
Returns
An array of Vector3s
Read data from the binary stream as 4D vectors, using the current accessor set by Seek.
Parameters
conversionScale
Coversion scale that is applied to each Vector4.
Returns
An array of Vector4s
Read data from the binary stream as colors, using the current accessor set by Seek.
Returns
An array of Colors.
Read data from the binary stream as bone weights, using the current accessor set by Seek.
Parameters
resultsBoneWeights
Output array of BoneWeights.
Read data from the binary stream as bone indices, using the current accessor set by Seek.
Parameters
resultsBoneWeights
Output array of BoneWeights.
Read data from the binary stream as Quaternions, using the current accessor set by Seek.
Parameters
gltfToUnitySpaceRotation
The conversion value to apply to translate from GLTF space to Unity space.
Returns
An array of Quaternions.
Read data from the binary stream as a Matrix 4x4, using the current accessor set by Seek.
Parameters
conversionScale
Conversion scale to be applied to each 4x4 matrix.
Returns
An array of Matrix4x4.
Read the binary stream using a specific buffer view.
Parameters
bufferViewIndex
Index of a buffer view to use out of all buffer views.
Returns
An array of byte data the buffer view points to.
Disposes the BinaryReader if being used for accessing the Stream.
Gets the total number of GLTF accessors loaded from the GLTF file.
Returns
Total number of GLTF accessors.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon