engine icon indicating copy to clipboard operation
engine copied to clipboard

射线使用问题

Open xuxiaodao opened this issue 1 year ago • 1 comments

新建了以下坐标点的射线 new Ray(new Vector3(0, 3, -4), new Vector3(0, 3, -10)); 界面上还有一个位于Vector3(-10, 3, -10)的entity, 理论上射线检测是检测不到这个entity的,但实际上检测结果一直返回true,帮忙看看是哪里写法有问题。

代码:https://codesandbox.io/s/lite-raycast-galacean-object-object-forked-w3vtke?file=/index.ts

xuxiaodao avatar May 17 '23 06:05 xuxiaodao

两个问题:

  • @xuxiaodao Ray 构造函数的传参是起点与方向,不是起点与终点,可能要注意下
  • 这个确实是引擎 Bug,本地试了下 lite 和 physx 表现不一致,但是小程序目前应该无法使用 wasm,所以需要场外求助 @yangfengzzz

cptbtptpbcptdtptp avatar May 17 '23 13:05 cptbtptpbcptdtptp