@@ -1548,7 +1548,7 @@ struct WorldEditorImpl : public WorldEditor
15481548 mtx.setZVector (dir);
15491549
15501550 positions.push (pos);
1551- mtx. getRotation ( rotations.emplace ());
1551+ rotations.emplace (mtx. getRotation ());
15521552 }
15531553 }
15541554 MoveEntityCommand* cmd = LUMIX_NEW (m_allocator, MoveEntityCommand)(*this ,
@@ -1827,7 +1827,7 @@ struct WorldEditorImpl : public WorldEditor
18271827 }
18281828 else
18291829 {
1830- pos = universe->getPosition (m_camera) + universe->getRotation (m_camera) * Vec3 (0 , 0 , -2 );
1830+ pos = universe->getPosition (m_camera) + universe->getRotation (m_camera). rotate ( Vec3 (0 , 0 , -2 ) );
18311831 }
18321832 AddEntityCommand* command = LUMIX_NEW (m_allocator, AddEntityCommand)(*this , pos);
18331833 executeCommand (command);
@@ -1854,7 +1854,7 @@ struct WorldEditorImpl : public WorldEditor
18541854 }
18551855 else
18561856 {
1857- pos = universe->getPosition (m_camera) + universe->getRotation (m_camera) * Vec3 (0 , 0 , -2 );
1857+ pos = universe->getPosition (m_camera) + universe->getRotation (m_camera). rotate ( Vec3 (0 , 0 , -2 ) );
18581858 }
18591859 return pos;
18601860 }
@@ -2204,7 +2204,7 @@ struct WorldEditorImpl : public WorldEditor
22042204 m_go_to_parameters.m_t = 0 ;
22052205 m_go_to_parameters.m_from = universe->getPosition (m_camera);
22062206 Quat camera_rot = universe->getRotation (m_camera);
2207- Vec3 dir = camera_rot * Vec3 (0 , 0 , 1 );
2207+ Vec3 dir = camera_rot. rotate ( Vec3 (0 , 0 , 1 ) );
22082208 m_go_to_parameters.m_to = universe->getPosition (m_selected_entities[0 ]) + dir * 10 ;
22092209 float len = (m_go_to_parameters.m_to - m_go_to_parameters.m_from ).length ();
22102210 m_go_to_parameters.m_speed = Math::maximum (100 .0f / (len > 0 ? len : 1 ), 2 .0f );
@@ -2465,9 +2465,9 @@ struct WorldEditorImpl : public WorldEditor
24652465
24662466 right = m_is_orbit ? 0 : right;
24672467
2468- pos += rot * Vec3 (0 , 0 , -1 ) * forward * speed;
2469- pos += rot * Vec3 (1 , 0 , 0 ) * right * speed;
2470- pos += rot * Vec3 (0 , 1 , 0 ) * up * speed;
2468+ pos += rot. rotate ( Vec3 (0 , 0 , -1 ) ) * forward * speed;
2469+ pos += rot. rotate ( Vec3 (1 , 0 , 0 ) ) * right * speed;
2470+ pos += rot. rotate ( Vec3 (0 , 1 , 0 ) ) * up * speed;
24712471 universe->setPosition (m_camera, pos);
24722472 }
24732473
@@ -2570,8 +2570,8 @@ struct WorldEditorImpl : public WorldEditor
25702570 m_orbit_delta.y += y;
25712571 }
25722572
2573- pos += rot * Vec3 (x, 0 , 0 );
2574- pos += rot * Vec3 (0 , -y, 0 );
2573+ pos += rot. rotate ( Vec3 (x, 0 , 0 ) );
2574+ pos += rot. rotate ( Vec3 (0 , -y, 0 ) );
25752575
25762576 universe->setPosition (m_camera, pos);
25772577 }
@@ -2599,28 +2599,28 @@ struct WorldEditorImpl : public WorldEditor
25992599
26002600 float yaw = -Math::signum (x) * (Math::pow (Math::abs ((float )x / m_mouse_sensitivity.x ), 1 .2f ));
26012601 Quat yaw_rot (Vec3 (0 , 1 , 0 ), yaw);
2602- rot = rot * yaw_rot ;
2602+ rot = yaw_rot * rot ;
26032603 rot.normalize ();
26042604
2605- Vec3 pitch_axis = rot * Vec3 (1 , 0 , 0 );
2605+ Vec3 pitch_axis = rot. rotate ( Vec3 (1 , 0 , 0 ) );
26062606 float pitch = -Math::signum (y) * (Math::pow (Math::abs ((float )y / m_mouse_sensitivity.y ), 1 .2f ));
26072607 Quat pitch_rot (pitch_axis, pitch);
2608- rot = rot * pitch_rot ;
2608+ rot = pitch_rot * rot ;
26092609 rot.normalize ();
26102610
26112611 if (m_is_orbit && !m_selected_entities.empty ())
26122612 {
2613- Vec3 dir = rot * Vec3 (0 , 0 , 1 );
2613+ Vec3 dir = rot. rotate ( Vec3 (0 , 0 , 1 ) );
26142614 Vec3 entity_pos = universe->getPosition (m_selected_entities[0 ]);
26152615 Vec3 nondelta_pos = pos;
26162616
2617- nondelta_pos -= old_rot * Vec3 (0 , -1 , 0 ) * m_orbit_delta.y ;
2618- nondelta_pos -= old_rot * Vec3 (1 , 0 , 0 ) * m_orbit_delta.x ;
2617+ nondelta_pos -= old_rot. rotate ( Vec3 (0 , -1 , 0 ) ) * m_orbit_delta.y ;
2618+ nondelta_pos -= old_rot. rotate ( Vec3 (1 , 0 , 0 ) ) * m_orbit_delta.x ;
26192619
26202620 float dist = (entity_pos - nondelta_pos).length ();
26212621 pos = entity_pos + dir * dist;
2622- pos += rot * Vec3 (1 , 0 , 0 ) * m_orbit_delta.x ;
2623- pos += rot * Vec3 (0 , -1 , 0 ) * m_orbit_delta.y ;
2622+ pos += rot. rotate ( Vec3 (1 , 0 , 0 ) ) * m_orbit_delta.x ;
2623+ pos += rot. rotate ( Vec3 (0 , -1 , 0 ) ) * m_orbit_delta.y ;
26242624 }
26252625
26262626 universe->setRotation (m_camera, rot);
0 commit comments