Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 89143

射线检测点击屏幕的点,换成一个准心图标,射线位置有偏移。

$
0
0

@pzhifeng 写道:

参考射线检测的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);

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 89143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>