mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
minor camera refactoring, division by zero guards
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user