Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
trs70's avatar
trs70
Start Member
7 months ago

Grabbed object with custom pose "wiggles" when moving controller or hands rapidly back and forth

I posted an issue at https://github.com/oculus-samples/Unreal-InteractionSDK-Sample/issues/16 but adding here for visibility also.

I found that if I grabbed an object with a custom pose and moved the controller back and forth quickly the grabbed object doesn't seem to to track my virtual hand quite right. It kind of looks like the object "wiggles" or jiggles/lags behind the hands. This was only happening with pose mode set to "Snap Object to Pose". I tracked it down to CalculateInteractorSnapTransform() in OculusInteraction\Private\Interaction\Grabbable\IsdkGrabTransformerComponent.cpp but I'm not sure the best way to fix. I notice some of the other branches in UIsdkGrabTransformerComponent::UpdateTransform() end up calling TransformTarget->SetRelativeTransform(TargetRelativeTransform); which doesn't exhibit the issue. Hands tracking also seems to have the same issue.

I asked Gemini for a solution and it suggested this code:

FTransform UIsdkGrabTransformerComponent::CalculateInteractorSnapTransform( FTransform& TargetTransformIn, FTransform& InteractorTransformIn) {
const FTransform OffsetInverse = InteractorSnapOffset.Inverse();
const FTransform FinalTransform = OffsetInverse * InteractorTransformIn;
return FinalTransform;
}

It did fix the problem, but I'm not sure what other purposes the original code had as it was more complex. Thanks!

Replies have been turned off for this discussion