New Geometry source callback

Set Geometry callback applies and interpolates position, scale and rotation of a source. Implemented UI and XML.
This commit is contained in:
Bruno Herbelin
2022-02-21 12:32:48 +01:00
parent aa50d818ec
commit 2e167d260d
10 changed files with 324 additions and 102 deletions

View File

@@ -589,9 +589,9 @@ void SessionVisitor::visit (Source& s)
std::list<SourceCallback *> callbacks = s.inputCallbacks(*i);
for (auto c = callbacks.begin(); c != callbacks.end(); ++c) {
xmlCurrent_ = xmlDoc_->NewElement( "Callback" );
callbackselement->InsertEndChild(xmlCurrent_);
xmlCurrent_->SetAttribute("input", *i);
(*c)->accept(*this);
callbackselement->InsertEndChild(xmlCurrent_);
}
}
}
@@ -784,6 +784,22 @@ void SessionVisitor::visit (SetDepth &c)
xmlCurrent_->SetAttribute("bidirectional", c.bidirectional());
}
void SessionVisitor::visit (SetGeometry &c)
{
xmlCurrent_->SetAttribute("duration", c.duration());
xmlCurrent_->SetAttribute("bidirectional", c.bidirectional());
// get geometry of target
Group g;
c.getTarget(&g);
XMLElement *geom = xmlDoc_->NewElement( "Geometry" );
xmlCurrent_->InsertEndChild(geom);
xmlCurrent_ = geom;
g.accept(*this);
}
void SessionVisitor::visit (Loom &c)
{
xmlCurrent_->SetAttribute("delta", c.value());