-
Notifications
You must be signed in to change notification settings - Fork 12
Description
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 for any help!