XRCylinderLayer: radius property
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 radius của giao diện XRCylinderLayer đại diện cho bán kính của hình trụ.
Giá trị
Số đại diện cho bán kính của hình trụ.
Ví dụ
>Lấy bán kính của lớp
Phương thức XRWebGLBinding.createCylinderLayer() tạo lớp hình trụ và cho phép chỉ định radius. Thuộc tính XRCylinder.radius có thể được dùng sau khi tạo lớp để lấy bán kính được dùng hoặc đặt thành bán kính mới.
js
const cylinderLayer = xrGlBinding.createCylinderLayer({
space: xrReferenceSpace,
viewPixelWidth: 1200,
viewPixelHeight: 600,
centralAngle: (60 * Math.PI) / 180,
aspectRatio: 2,
radius: 2,
transform: new XRRigidTransform(/* … */),
});
cylinderLayer.radius; // 2
Thông số kỹ thuật
| Specification |
|---|
| WebXR Layers API Level 1> # dom-xrcylinderlayer-radius> |