XRCubeLayer: thuộc tính orientation
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Thuộc tính orientation của giao diện XRCubeLayer đại diện cho hướng tương đối với thuộc tính space.
Giá trị
Một DOMPointReadOnly.
Ví dụ
>Cập nhật hướng của cube layer
Phương thức XRWebGLBinding.createCubeLayer() tạo một cube layer và cho phép chỉ định orientation. Thuộc tính XRCubeLayer.orientation có thể được sử dụng sau khi tạo layer để lấy hướng hiện tại hoặc đặt nó thành một hướng mới.
js
const cubeLayer = xrGlBinding.createCubeLayer({
space: xrReferenceSpace,
viewPixelWidth: 512,
viewPixelHeight: 512,
orientation: DOMPointReadOnly.fromPoint({ x: 0.0, y: 0.0, z: 0.0, w: 1.0 }),
});
cubeLayer.orientation = someOtherPoint;
Thông số kỹ thuật
| Specification |
|---|
| WebXR Layers API Level 1> # dom-xrcubelayer-orientation> |