浏览代码

Examples: Fixed webxr_vr_handinput_pointerclick.

Mr.doob 2 年之前
父节点
当前提交
c4befe1e2f
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      examples/webxr_vr_handinput_pointerclick.html

+ 3 - 4
examples/webxr_vr_handinput_pointerclick.html

@@ -254,10 +254,9 @@
 
 
 						const offset = entity.getComponent( OffsetFromCamera );
 						const offset = entity.getComponent( OffsetFromCamera );
 						const object = entity.getComponent( Object3D ).object;
 						const object = entity.getComponent( Object3D ).object;
-						const xrCamera = this.renderer.xr.getCamera();
-						object.position.x = xrCamera.position.x + offset.x;
-						object.position.y = xrCamera.position.y + offset.y;
-						object.position.z = xrCamera.position.z + offset.z;
+						object.position.x = camera.position.x + offset.x;
+						object.position.y = camera.position.y + offset.y;
+						object.position.z = camera.position.z + offset.z;
 						entity.removeComponent( NeedCalibration );
 						entity.removeComponent( NeedCalibration );
 
 
 					}
 					}