XRDepthInformation
XRDepthInformation 接口包含有关用户设备与用户环境中真实几何形状之间距离的信息。
此接口是以下接口的父接口:
XRCPUDepthInformation-
CPU 的深度信息(由
XRFrame.getDepthInformation()返回)。 XRWebGLDepthInformation-
WebGL 的深度信息(由
XRWebGLBinding.getDepthInformation()返回)。
通常,您将与这些子接口进行交互。但是,XRDepthInformation 提供了一些有用的、被继承的属性:
实例属性
XRDepthInformation.height只读 实验性-
包含深度缓冲区的高度(行数)。
XRDepthInformation.normDepthBufferFromNormView只读 实验性-
一个
XRRigidTransform,在索引深度缓冲区时需要应用它。该矩阵表示的变换将坐标系从归一化视图坐标系更改为归一化深度缓冲区坐标系,然后可以按深度缓冲区的width和height进行缩放,以获得绝对深度缓冲区坐标。 XRDepthInformation.rawValueToMeters只读 实验性-
包含原始深度值必须乘以才能获得米单位深度的比例因子。
XRDepthInformation.width只读 实验性-
包含深度缓冲区的宽度(列数)。
实例方法
无。
示例
有关代码示例,请参阅 XRCPUDepthInformation 和 XRWebGLDepthInformation。
规范
| 规范 |
|---|
| WebXR Depth Sensing 模块 # xrdepthinformation |
浏览器兼容性
加载中…