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

I'm new to VisionOS development, and I'm stuck on a pretty straightforward question. I want t

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744589454a4582512.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信