XRCPUDepthInformation: phương thức getDepthInMeters()
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.
Phương thức getDepthInMeters() của giao diện XRCPUDepthInformation trả về độ sâu tính bằng mét tại (x, y) trong tọa độ view chuẩn hóa (gốc tọa độ ở góc trên bên trái).
Cú pháp
js
getDepthInMeters(x, y)
Tham số
Giá trị trả về
Không có (undefined).
Ngoại lệ
- Một
RangeErrorđược ném ra nếuxhoặcylớn hơn 1.0 hoặc nhỏ hơn 0.0.
Ví dụ
js
const distance = depthInfo.getDepthInMeters(x, y);
Thông số kỹ thuật
| Specification |
|---|
| WebXR Depth Sensing Module> # dom-xrcpudepthinformation-getdepthinmeters> |