Hi, Recently we've implemented a model of a building with moving doors by adding osgSim::DOFTransform nodes for the doors (the geometry added as child of the DOFTransform). While this works quite well, there's an issue I've had with enabling the animation to open the door.
When setAnimationOn(true) is called, the node is set such that is will be visited by the UpdateVisitor. On the first pass through DOFTransform::traverse the delta time is calculated from _previousTime and the timestamp in the UpdateVisitor. However, _previousTime has never been set before, which means that the first frame of animation is erratic. For the doors this behavior is not acceptable, and I feel that this should be fixed in OSG. I've made a quick fix by checking the _previousTraversalNumber and if it's set to -1 then the DOFTransform::animate function isn't called, only the _previousTime and _previousTraversalNumber are updated. On the second animated frame the delta time is then correctly calculated. (when calling setAnimationOn(false) I now reset _previousTraversalNumber to -1). Is this issue recognized as an issue by other people so that I should make a proper fix and submit it, or am I missing something which would enable the proper behavior of the doors? Thank you! Kind regards, Rick ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18381#18381 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org