参考射线检测的demo,将射线检测中,用点击屏幕的获取射线目标点,换成一个准心图标,检测结果位置有偏移。屏幕中间的准心点,需要做怎样的转换啊。
demo中,this.ami 是加在屏幕中的准心,做以下修改:
this.cameraCom.screenPointToRay(touch._point.x, touch._point.y, this._ray);
this.cameraCom.screenPointToRay(this.ami.node.worldPosition.x,this.ami.node.worldPosition.y, this._ray);