Post

Replies

Boosts

Views

Activity

Reply to Generating MeshResource.Skeleton for IKComponent in RealityComposerPro/XCode
Hi @Vision Pro Engineer! Thank you so much for this information. The implementation works great for controlling the entities based on a single gesture from the end effector. I am interested in extending this functionality to allow the user to select different joints along the hierarchy with DragGestures to control, and have IKComponent solve the IK for the desired joint positions regardless of what joint is selected. How would I go about implementing this?
Oct ’24
Reply to Generating MeshResource.Skeleton for IKComponent in RealityComposerPro/XCode
@Vision Pro Engineer Fantastic, thank you for the detailed response. This approach makes sense, but I am still wondering about setting the hand position at every frame. Could you please share an implementation for this using the Entity Component System as you mentioned? I'd like to use a DragGesture() targeted to the 'handJoint' to direct its position at each frame, which I have been able to implement without IK. I'm thinking along these lines, but I do not know what I am missing (note this example code does not successfully update the handJoint and other joint positions): .gesture( DragGesture() .targetedToEntity(shapes.handJoint) .onChanged { value in let currentHandPosition = value.convert(value.location3D, from: .local, to: shapes.skeletonContainerEntity) var ikComponent = shapes.skeletonContainerEntity.components[IKComponent.self]! ikComponent.solvers[0].constraints["end_constraint"]!.target.translation = currentHandPosition shapes.skeletonContainerEntity.components.set(ikComponent) } ) Thank you very much!
Aug ’24