minor camera refactoring, division by zero guards

This commit is contained in:
tmj-fstate
2018-08-03 16:07:50 +02:00
parent ff6bed67a9
commit ec1a625c12
20 changed files with 110 additions and 116 deletions

View File

@@ -43,7 +43,7 @@ basic_editor::translate( scene::basic_node *Node, float const Offset ) {
// NOTE: offset scaling is calculated early so the same multiplier can be applied to potential whole group
auto location { Node->location() };
auto const distance { glm::length( location - glm::dvec3{ Global.pCamera->Pos } ) };
auto const distance { glm::length( location - glm::dvec3{ Global.pCamera.Pos } ) };
auto const offset { Offset * std::max( 1.0, distance * 0.01 ) };
auto *node { Node }; // placeholder for operations on multiple nodes