Skip to content

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

@trs79

Description

@trs79

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions