From: Torsten Dreyer Date: Fri, 7 Jan 2011 21:43:46 +0000 (+0100) Subject: Add to animations X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=122d7f681ff28e84159b4c220852f6dd62c14c2c;p=simgear.git Add to animations Allow complex animation expressions Example: translate along the y-axis following a sin function. translate 1 /some/position-norm 6.28 --- diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index a6734c1e..dae46ea2 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -206,6 +206,10 @@ SGExpressiond* read_value(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const char* unit, double defMin, double defMax) { + const SGPropertyNode * expression = configNode->getNode( "expression" ); + if( expression != NULL ) + return SGReadDoubleExpression( modelRoot, expression->getChild(0) ); + SGExpression* value = 0; std::string inputPropertyName = configNode->getStringValue("property", "");