最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - How to add pivotPoint to object in Reality Composer PRO? - Stack Overflow

programmeradmin3浏览0评论

I'm new to VisionOS development, and I'm stuck on a pretty straightforward question. I want to add a punching bag where the user can punch it with their hands, so I want it to be responsive to its actions. But I cannot figure out how it sticks, let's say, to the virtual scene ceiling. So it could swing but don't fall when the user punches it?

I'm new to VisionOS development, and I'm stuck on a pretty straightforward question. I want to add a punching bag where the user can punch it with their hands, so I want it to be responsive to its actions. But I cannot figure out how it sticks, let's say, to the virtual scene ceiling. So it could swing but don't fall when the user punches it?

Share Improve this question asked Mar 16 at 18:49 Alex FilatovAlex Filatov 2,3413 gold badges33 silver badges45 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

To simulate the physical behavior of the punching bag you definitely need to use the dynamics pin constraint. I believe that in RealityKit 2025, the role of a pin constraint, allowing free rotation along all axes, can be performed by such an object as PhysicsSphericalJoint. On the other hand, this functioning can partially be performed by the single-axis PhysicsRevoluteJoint, which is also capable of simulating such phenomena as the operation of door hinges, a clock's pendulum, or Newton's cradle. Unfortunately, at the moment I don't see any way to configure dynamics pin constraints in the Reality Composer Pro 2.0 interface, so you can only do it programmatically.

As a bonus, I want to tell you that similar capabilities can be implemented in SceneKit using the SCNPhysicsBallSocketJoint object. But remember that any SceneKit scene can only be represented in visionOS as a 2D screen.

发布评论

评论列表(0)

  1. 暂无评论