Scenekit检测用户点击的对象 [英] Scenekit detecting User tapped object

查看:85
本文介绍了Scenekit检测用户点击的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始在iOS 8中使用scenekit for scenekit。我在检测用户是否轻敲或按下了对象时遇到了困难。有没有办法做到这一点?

I recently started using scenekit for scenekit in iOS 8. I am facing difficulty in detecting whether the user has tapped or pressed on the object. Is there any way to do that?

推荐答案

请参阅 hitTest 方法。从您处理触摸事件的任何地方调用该信息,以获取在2D屏幕点下的3D场景对象/位置列表。

See the documentation for the hitTest method. Call that from wherever you're handling touch events to get a list of 3D scene objects/locations "under" a 2D screen point.

这篇关于Scenekit检测用户点击的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆