mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +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:
|
||||
if (ActiveView)
|
||||
lcGetActiveModel()->Zoom(ActiveView->mCamera, 10.0f);
|
||||
ActiveView->Zoom(10.0f);
|
||||
break;
|
||||
|
||||
case LC_VIEW_ZOOM_OUT:
|
||||
if (ActiveView)
|
||||
lcGetActiveModel()->Zoom(ActiveView->mCamera, -10.0f);
|
||||
ActiveView->Zoom(-10.0f);
|
||||
break;
|
||||
|
||||
case LC_VIEW_ZOOM_EXTENTS:
|
||||
|
|
|
@ -84,6 +84,7 @@ void View::SetSelectedSubmodelActive()
|
|||
mActiveSubmodelInstance = Piece;
|
||||
ActiveModel = mActiveSubmodelInstance->mPieceInfo->GetModel();
|
||||
ActiveModel->SetActive(true);
|
||||
RemoveCamera();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1968,6 +1969,13 @@ void View::MoveCamera(const lcVector3& Direction)
|
|||
ActiveModel->MoveCamera(mCamera, Direction);
|
||||
}
|
||||
|
||||
void View::Zoom(float Amount)
|
||||
{
|
||||
lcModel* ActiveModel = GetActiveModel();
|
||||
if (ActiveModel)
|
||||
ActiveModel->Zoom(mCamera, Amount);
|
||||
}
|
||||
|
||||
void View::UpdateTrackTool()
|
||||
{
|
||||
lcTool CurrentTool = gMainWindow->GetTool();
|
||||
|
|
|
@ -112,6 +112,7 @@ public:
|
|||
void LookAt();
|
||||
void ZoomExtents();
|
||||
void MoveCamera(const lcVector3& Direction);
|
||||
void Zoom(float Amount);
|
||||
|
||||
void RemoveCamera();
|
||||
void SetCamera(lcCamera* Camera, bool ForceCopy);
|
||||
|
|
Loading…
Reference in a new issue