Using translation, rotation and scale vectors to define transform of

node (matrix computed at update). GUI to modify transform adapted
accordingly. Initialization nodes done at first run of draw (prevents
mistake of forgetting to init).
This commit is contained in:
brunoherbelin
2020-04-05 01:21:29 +02:00
parent cf72a4d658
commit bef60e3e13
8 changed files with 92 additions and 43 deletions

View File

@@ -26,8 +26,12 @@ void SessionVisitor::visit(Node &n)
XMLElement *newelement = xmlDoc_->NewElement("Node");
newelement->SetAttribute("visible", n.visible_);
XMLElement *transform = XMLElementFromGLM(xmlDoc_, n.transform_);
newelement->InsertEndChild(transform);
XMLElement *scale = XMLElementFromGLM(xmlDoc_, n.scale_);
newelement->InsertEndChild(scale);
XMLElement *translation = XMLElementFromGLM(xmlDoc_, n.translation_);
newelement->InsertEndChild(translation);
XMLElement *rotation = XMLElementFromGLM(xmlDoc_, n.rotation_);
newelement->InsertEndChild(rotation);
// insert into hierarchy
xmlCurrent_->InsertEndChild(newelement);