if (!_found)
{
std::list<std::string>::const_iterator i;
- string info;
+ std::string info;
for (i = _objectNames.begin(); i != _objectNames.end(); ++i)
{
if (!info.empty())
SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
const osgDB::Options* options,
- const string &path, int i)
+ const std::string &path, int i)
{
std::string type = configNode->getStringValue("type", "none");
if (type == "alpha-test") {
} else if (type == "timed") {
SGTimedAnimation animInst(configNode, modelRoot);
animInst.apply(node);
- } else if (type == "track-to" || type == "locked-track") {
+ } else if (type == "locked-track") {
SGTrackToAnimation animInst(node, configNode, modelRoot);
animInst.apply(node);
} else if (type == "translate") {
center = readVec3("center", "-m", center);
}
+//------------------------------------------------------------------------------
+SGExpressiond* SGAnimation::readOffsetValue(const char* tag_name) const
+{
+ const SGPropertyNode* node = _configNode->getChild(tag_name);
+ if( !node )
+ return 0;
+
+ SGExpressiond_ref expression;
+ if( !node->nChildren() )
+ expression = new SGConstExpression<double>(node->getDoubleValue());
+ else
+ expression = SGReadDoubleExpression(_modelRoot, node->getChild(0));
+
+ if( !expression )
+ return 0;
+
+ expression = expression->simplify();
+
+ if( expression->isConst() && expression->getValue() == 0 )
+ return 0;
+
+ return expression.release();
+}
+
void
SGAnimation::removeMode(osg::Node& node, osg::StateAttribute::GLMode mode)
{
if (!cv)
return;
if (!_condition || _condition->test()) {
- double t = nv->getFrameStamp()->getReferenceTime();
+ double t = nv->getFrameStamp()->getSimulationTime();
double rps = _animationValue->getValue() / 60.0;
ref_ptr<ReferenceValues>
refval(static_cast<ReferenceValues*>(_referenceValues.get()));
_current_index = _current_index % nChildren;
// update the time and compute the current systems time value
- double t = nv->getFrameStamp()->getReferenceTime();
+ double t = nv->getFrameStamp()->getSimulationTime();
if (_last_time_sec == SGLimitsd::max()) {
_last_time_sec = t;
} else {