From 122d7f681ff28e84159b4c220852f6dd62c14c2c Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Fri, 7 Jan 2011 22:43:46 +0100 Subject: [PATCH] Add to animations Allow complex animation expressions Example: translate along the y-axis following a sin function. translate 1 /some/position-norm 6.28 --- simgear/scene/model/animation.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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", ""); -- 2.39.5