@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!
Post
Replies
Boosts
Views
Activity
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?
Hi @DTS Engineer,
I could not attach a .ips file in the developer forums, so I sent it in an email to you.
Thanks!