Small optimization - Removed unneeded normalization from gizmos Move, Rotate and Scale
This commit is contained in:
parent
d94bb65563
commit
bf48848b00
3 changed files with 5 additions and 5 deletions
|
@ -339,7 +339,7 @@ double GLGizmoMove3D::calc_projection(const UpdateData& data) const
|
|||
// use ray-plane intersection see i.e. https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection algebric form
|
||||
// in our case plane normal and ray direction are the same (orthogonal view)
|
||||
// when moving to perspective camera the negative z unit axis of the camera needs to be transformed in world space and used as plane normal
|
||||
const Vec3d inters = data.mouse_ray.a + (m_starting_drag_position - data.mouse_ray.a).dot(mouse_dir) / mouse_dir.squaredNorm() * mouse_dir;
|
||||
const Vec3d inters = data.mouse_ray.a + (m_starting_drag_position - data.mouse_ray.a).dot(mouse_dir) * mouse_dir;
|
||||
// vector from the starting position to the found intersection
|
||||
const Vec3d inters_vec = inters - m_starting_drag_position;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue