|
| 1 | +# Camera Configuration |
| 2 | + |
| 3 | +To configure the camera feed, add the `xrconfig` component to your `a-scene`: |
| 4 | + |
| 5 | +`<a-scene xrconfig>` |
| 6 | + |
| 7 | +## xrconfig Attributes (all optional) {#xrconfig-attributes} |
| 8 | + |
| 9 | +Component | Type | Default | Description |
| 10 | +--------- | ---- | ------- | ----------- |
| 11 | +cameraDirection | `String` | `'back'` | Desired camera to use. Choose from: `back` or `front`. Use `cameraDirection: front;` with `mirroredDisplay: true;` for selfie mode. Note that world tracking is only supported with `cameraDirection: back;`.` |
| 12 | +allowedDevices | `String` | `'mobile-and-headsets'` | Supported device classes. Choose from: `'mobile-and-headsets'` , `'mobile'` or `'any'`. Use `'any'` to enable laptop or desktop-type devices with built-in or attached webcams. Note that world tracking is only supported on `'mobile-and-headsets'` or `mobile`. |
| 13 | +mirroredDisplay | `Boolean` | `false` | If true, flip left and right in the output geometry and reverse the direction of the camera feed. Use `'mirroredDisplay: true;'` with `'cameraDirection: front;'` for selfie mode. Should not be enabled if World Tracking (SLAM) is enabled. |
| 14 | +disableXrTablet | `Boolean` | `false` | Disable the tablet visible in immersive sessions. |
| 15 | +xrTabletStartsMinimized | `Boolean` | `false` | The tablet will start minimized. |
| 16 | +disableDefaultEnvironment | `Boolean` | `false` | Disable the default "void space" background. |
| 17 | +disableDesktopCameraControls | `Boolean` | `false` | Disable WASD and mouse look for camera. |
| 18 | +disableDesktopTouchEmulation | `Boolean` | `false` | Disable desktop fake touches. |
| 19 | +disableXrTouchEmulation | `Boolean` | `false` | Don’t emit touch events based on controller raycasts with the scene. |
| 20 | +disableCameraReparenting | `Boolean` | `false` | Disable camera -> controller object move |
| 21 | +defaultEnvironmentFloorScale | `Number` | `1` | Shrink or grow the floor texture. |
| 22 | +defaultEnvironmentFloorTexture | Asset | | Specify an alternative texture asset or URL for the tiled floor. |
| 23 | +defaultEnvironmentFloorColor | Hex Color | `#1A1C2A` | Set the floor color. |
| 24 | +defaultEnvironmentFogIntensity | `Number` | `1` | Increase or decrease fog density. |
| 25 | +defaultEnvironmentSkyTopColor | Hex Color | `#BDC0D6` | Set the color of the sky directly above the user. |
| 26 | +defaultEnvironmentSkyBottomColor | Hex Color | `#1A1C2A` | Set the color of the sky at the horizon. |
| 27 | +defaultEnvironmentSkyGradientStrength | `Number` | `1` | Control how sharply the sky gradient transitions. |
| 28 | + |
| 29 | +Notes: |
| 30 | + |
| 31 | +* `cameraDirection`: When using `xrweb` to provide world tracking (SLAM), only the `back` camera is |
| 32 | +supported. If you are using the `front` camera, you must disable world tracking by setting |
| 33 | +`disableWorldTracking: true` on `xrweb`. |
| 34 | + |
| 35 | +## xrconfigComponent() |
| 36 | + |
| 37 | +`XR8.AFrame.xrconfigComponent()` |
| 38 | + |
| 39 | +Creates an A-Frame component which can be registered with `AFRAME.registerComponent()`. This, |
| 40 | +however, generally won't need to be called directly. On 8th Wall Web script load, this component |
| 41 | +will be registered automatically if it is detected that A-Frame has loaded (i.e if `window.AFRAME` |
| 42 | +exists). |
| 43 | + |
| 44 | +```javascript |
| 45 | +window.AFRAME.registerComponent('xrconfig', XR8.AFrame.xrconfigComponent()) |
| 46 | +``` |
0 commit comments