WVR_SetProjectedPassthroughMesh

WVR_EXPORT WVR_Result WVR_SetProjectedPassthroughMesh(float * vertexBuffer, uint32_t vertextCount, uint32_t * indices, uint32_t indexCount)

Function to set the rectangle area for the projected passthrough.

This function must be called after calling WVR_RenderInit().

Version
API Level 7
Note
Supported from Runtime version 7 or higher (certain devices only).
Parameters
  • vertexBuffer: Set the vertex data.
  • vertextCount: Set the count of vertex data.
  • indices: Set the triangle indices.
  • indexCount: Set the count of indices.
Return Value
  • WVR_SUCCESS: The setting is valid.
  • WVR_Error_RuntimeVersionNotSupport: This feature is supported from Runtime version 7 or higher.
  • WVR_Error_FeatureNotSupport: This feature is not supported on this device.

How to use

The following example sets the Mesh for the projected passthrough by pressing button A:

#include <wvr/wvr_system.h>

void pollEvent() {
    if (event.common.type == WVR_EventType_ButtonUnpressed) {
        if (event.input.inputId == WVR_InputId_Alias1_A) {
            float size = 0.125f;
            std::vector<float> vertex = { -size, -size, 0.0f,
                                          size, -size, 0.0f,
                                          size, size, 0.0f,
                                          -size, size, 0.0f };
            std::vector<uint32_t> indices = { 0, 1, 2, 0, 2, 3 };
            WVR_SetProjectedPassthroughMesh(&vertex[0], vertex.size(), &indices[0], indices.size());
            WVR_ShowProjectedPassthrough(true);
        }
    }
}