Physics handle rotation


How do you achieve this type of rotation physics?

Current code:

if(bIsRotatingObject)
            {
                bIsCameraMovementDisabled = true;
                float MouseDeltaX, MouseDeltaY;
                GetWorld()->GetFirstPlayerController()->GetInputMouseDelta(MouseDeltaX, MouseDeltaY);
                float RotationSpeed = 5.f;
                FRotator RotationDelta = FRotator(MouseDeltaY * RotationSpeed, -MouseDeltaX * RotationSpeed, 0.f);
                StoredRotationDifference += RotationDelta;
                
                FRotator TargetRot = CamRot + StoredRotationDifference;
                PhysicsHandleComponent->SetTargetLocationAndRotation(GetLineTraceEnd(), TargetRot);
            }
            else
            {
                
                
                PhysicsHandleComponent->SetTargetLocation(GetLineTraceEnd());

                CamRot = PlayerCameraComponent->GetComponentRotation();

                FRotator TargetRot = CamRot + StoredRotationDifference;
                
            
                PhysicsHandleComponent->SetTargetRotation(TargetRot);
            }