Add <expression> to animations
Allow complex animation expressions
Example: translate along the y-axis following a sin
function.
<animation>
<type>translate</type>
<axis>
<y>1</y>
</axis>
<expression>
<sin>
<product>
<property>/some/position-norm</property>
<value>6.28</value>
</product>
</sin>
</expression>
</animation>
This commit is contained in:
@@ -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<double>* value = 0;
|
||||
|
||||
std::string inputPropertyName = configNode->getStringValue("property", "");
|
||||
|
||||
Reference in New Issue
Block a user