mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Detach camera when diving into a submodel.
This commit is contained in:
parent
378ece224f
commit
8f59a67924
3 changed files with 11 additions and 2 deletions
|
@ -2775,12 +2775,12 @@ void lcMainWindow::HandleCommand(lcCommandId CommandId)
|
||||||
|
|
||||||
case LC_VIEW_ZOOM_IN:
|
case LC_VIEW_ZOOM_IN:
|
||||||
if (ActiveView)
|
if (ActiveView)
|
||||||
lcGetActiveModel()->Zoom(ActiveView->mCamera, 10.0f);
|
ActiveView->Zoom(10.0f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LC_VIEW_ZOOM_OUT:
|
case LC_VIEW_ZOOM_OUT:
|
||||||
if (ActiveView)
|
if (ActiveView)
|
||||||
lcGetActiveModel()->Zoom(ActiveView->mCamera, -10.0f);
|
ActiveView->Zoom(-10.0f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LC_VIEW_ZOOM_EXTENTS:
|
case LC_VIEW_ZOOM_EXTENTS:
|
||||||
|
|
|
@ -84,6 +84,7 @@ void View::SetSelectedSubmodelActive()
|
||||||
mActiveSubmodelInstance = Piece;
|
mActiveSubmodelInstance = Piece;
|
||||||
ActiveModel = mActiveSubmodelInstance->mPieceInfo->GetModel();
|
ActiveModel = mActiveSubmodelInstance->mPieceInfo->GetModel();
|
||||||
ActiveModel->SetActive(true);
|
ActiveModel->SetActive(true);
|
||||||
|
RemoveCamera();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1968,6 +1969,13 @@ void View::MoveCamera(const lcVector3& Direction)
|
||||||
ActiveModel->MoveCamera(mCamera, Direction);
|
ActiveModel->MoveCamera(mCamera, Direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::Zoom(float Amount)
|
||||||
|
{
|
||||||
|
lcModel* ActiveModel = GetActiveModel();
|
||||||
|
if (ActiveModel)
|
||||||
|
ActiveModel->Zoom(mCamera, Amount);
|
||||||
|
}
|
||||||
|
|
||||||
void View::UpdateTrackTool()
|
void View::UpdateTrackTool()
|
||||||
{
|
{
|
||||||
lcTool CurrentTool = gMainWindow->GetTool();
|
lcTool CurrentTool = gMainWindow->GetTool();
|
||||||
|
|
|
@ -112,6 +112,7 @@ public:
|
||||||
void LookAt();
|
void LookAt();
|
||||||
void ZoomExtents();
|
void ZoomExtents();
|
||||||
void MoveCamera(const lcVector3& Direction);
|
void MoveCamera(const lcVector3& Direction);
|
||||||
|
void Zoom(float Amount);
|
||||||
|
|
||||||
void RemoveCamera();
|
void RemoveCamera();
|
||||||
void SetCamera(lcCamera* Camera, bool ForceCopy);
|
void SetCamera(lcCamera* Camera, bool ForceCopy);
|
||||||
|
|
Loading…
Add table
Reference in a new issue