2
\$\begingroup\$

I tried to override FEdMode:

virtual bool DisallowMouseDeltaTracking() const override
{
    UE_LOG(LogTemp, Warning, TEXT("do not allow mouse delta tracking!"));
    return true; // I also tried to return false
}

but the problem is that the cursor stops moving (and gets invisible).

Is it possible to change the camera moves (to make it like in 3Ds max or sketchup)?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

I update the mouse position in the Render() function:

void FPBEdMode::Render(const FSceneView* View, FViewport* Viewport, FPrimitiveDrawInterface* PDI)
{
    MousePosition.X = FMath::Clamp(Viewport->GetMouseX(), 0, Viewport->GetSizeXY().X-1);
    MousePosition.Y = FMath::Clamp(Viewport->GetMouseY(), 0, Viewport->GetSizeXY().Y-1);
 }

and I reset the mouse position on mouse release (taken from FoliageEdMode.cpp):

bool FPBEdMode::InputKey(FEditorViewportClient *ViewportClient, FViewport *Viewport, FKey Key, EInputEvent Event)
{
    if (Event == IE_Released && Key == EKeys::LeftMouseButton)
    {
        Viewport->SetPreCaptureMousePosFromSlateCursor();
    }
}
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .