16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 05:29:18 +02:00

scenery groups export and deserialization, associated events included in scenery node groups, AI brake charging tweak, door locking and vehicle hunting oscillation sounds

This commit is contained in:
tmj-fstate
2018-08-24 21:11:35 +02:00
parent 24eda2d63f
commit 09f24df109
14 changed files with 304 additions and 118 deletions

View File

@@ -37,9 +37,10 @@ basic_editor::translate( scene::basic_node *Node, glm::dvec3 const &Location, bo
else {
// translate entire group
// TODO: contextual switch between group and item translation
auto nodegroup { scene::Groups.group( Node->group() ) };
// TODO: translation of affected/relevant events
auto &nodegroup { scene::Groups.group( Node->group() ).nodes };
std::for_each(
nodegroup.first, nodegroup.second,
std::begin( nodegroup ), std::end( nodegroup ),
[&]( auto *node ) {
translate_node( node, node->location() + translation ); } );
}
@@ -59,9 +60,10 @@ basic_editor::translate( scene::basic_node *Node, float const Offset ) {
else {
// translate entire group
// TODO: contextual switch between group and item translation
auto nodegroup { scene::Groups.group( Node->group() ) };
// TODO: translation of affected/relevant events
auto &nodegroup { scene::Groups.group( Node->group() ).nodes };
std::for_each(
nodegroup.first, nodegroup.second,
std::begin( nodegroup ), std::end( nodegroup ),
[&]( auto *node ) {
translate_node( node, offset ); } );
}
@@ -146,10 +148,11 @@ basic_editor::rotate( scene::basic_node *Node, glm::vec3 const &Angle, float con
else {
// rotate entire group
// TODO: contextual switch between group and item rotation
// TODO: translation of affected/relevant events
auto const rotationcenter { Node->location() };
auto nodegroup { scene::Groups.group( Node->group() ) };
auto &nodegroup { scene::Groups.group( Node->group() ).nodes };
std::for_each(
nodegroup.first, nodegroup.second,
std::begin( nodegroup ), std::end( nodegroup ),
[&]( auto *node ) {
rotate_node( node, rotation );
if( node != Node ) {