How to use the troika-3d.Canvas3D.contextType function in troika-3d

To help you get started, we’ve selected a few troika-3d examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github protectwise / troika / packages / troika-xr / src / react / XRAware.jsx View on Github external
xrSupported={xrSupported}
        xrSession={xrSession}
        onSelectSession={this._onLauncherSelect}
      />

      const contextValue = {
        worldFacade: WorldXRFacade,
        worldProps: {
          xrSession,
          xrSessionMode,
          xrReferenceSpace,
          xrReferenceSpaceType
        }
      }

      return React.createElement(Canvas3D.contextType.Provider, {value: contextValue},
        React.createElement(
          ReactClass,
          utils.assign({}, props, {
            xrSupported,
            xrSupportedSessionModes,
            xrSession,
            xrSessionMode,
            xrReferenceSpace,
            xrReferenceSpaceType,
            xrLauncher
          }),
          props.children
        )
      )
    }
  }
github protectwise / troika / packages / troika-xr / src / webvr-deprecated / react / VrAware.jsx View on Github external
const VrButtonImpl = options.buttonRenderer
      const vrButton = 

      const contextValue = {
        worldFacade: WorldVrFacade,
        worldProps: { vrDisplay },
        onCanvasRef: this._registerVrCanvas,
        canvasStyle: vrDisplay ? vrCanvasStyles[options.screenViewEye] : null
      }

      return React.createElement(Canvas3D.contextType.Provider, {value: contextValue},
        React.createElement(
          BaseReactComponent,
          utils.assign({}, props, {
            vrAvailable,
            vrDisplay,
            vrButton
          }),
          props.children
        )
      )
    }
  }

troika-3d

Troika 3D

MIT
Latest version published 1 month ago

Package Health Score

75 / 100
Full package analysis

Similar packages