File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
engine/src/editor/viewport
modules/editor/particletools Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -293,18 +293,19 @@ void CameraController::doRotation(const Vector3 &vector) {
293293
294294void CameraController::cameraZoom (float delta) {
295295 if (m_activeCamera) {
296+ float scale = delta * 0 .01f ;
297+
296298 if (m_activeCamera->orthographic ()) {
297- float scale = m_activeCamera->orthoSize () * 0 .001f ;
298- m_activeCamera->setOrthoSize (CLAMP (m_activeCamera->orthoSize () - delta, m_zoomLimit.x , m_zoomLimit.y ));
299+ scale = CLAMP (m_activeCamera->orthoSize () - scale, m_zoomLimit.x , m_zoomLimit.y );
300+
301+ m_activeCamera->setOrthoSize (scale);
299302 } else {
300- float scale = delta * 0 .01f ;
301303 float focal = CLAMP (m_activeCamera->focal () - scale, m_zoomLimit.x , m_zoomLimit.y );
302- if (focal > 0 .0f ) {
303- m_activeCamera->setFocal (focal);
304304
305- Transform *t = m_activeCamera->transform ();
306- t->setPosition (t->position () - t->quaternion () * Vector3 (0 .0f , 0 .0f , scale));
307- }
305+ m_activeCamera->setFocal (focal);
306+
307+ Transform *t = m_activeCamera->transform ();
308+ t->setPosition (t->position () - t->quaternion () * Vector3 (0 .0f , 0 .0f , scale));
308309 }
309310 }
310311}
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ static const char *meta = \
1818" \" description\" : \" Particle Tools plugin\" ,"
1919" \" author\" : \" Evgeniy Prikazchikov\" ,"
2020" \" objects\" : {"
21- " \" EffectConverter\" : \" converter\" ,"
2221" \" EffectBuilder\" : \" converter\" ,"
2322" \" ParticleEdit\" : \" editor\" "
2423" }"
You can’t perform that action at this time.
0 commit comments