OpenSceneGraph question

Post: #1
Sorry i did not found a real special OpenSceneGraph forum, so i hope someone can help me here.

I have an osg file that contains this:
DataVariance DYNAMIC
name "mydraw"
nodeMask 0xff
cullingActive TRUE
UpdateCallbacks {
AnimationPathCallback {
DataVariance DYNAMIC
pivotPoint 0 0 0
timeOffset 0
timeMultiplier 1
AnimationPath {
DataVariance DYNAMIC
LoopMode LOOP
ControlPoints {/* .... */

In my CPP file "mydraw" is an osg node and points to the "mydraw" MatrixTransform Node. Now i want to access theAnimationPath and change some properties there. The following code does not work:

[INDENT]// make mydraw point to mydraw
osg::Node *mydraw = findNamedNode ("mydraw",GetScene()->GetSceneNode());

// get a pointer to "AnimationPathCallback"
osg::NodeCallback *mypath = mydraw->getUpdateCallback()->getNestedCallback();

// cast it to an "AnimationPathCallback"
osg::AnimationPathCallback *mycb = dynamic_cast<osg::AnimationPathCallback*> (mypath);

// change the animation path

The last line causes an exeption.
Does anyone know what I do wrong?
Quote this message in a reply
Posts: 45
Joined: 2006.11
Post: #2
What kind of exception are you getting?

Quote this message in a reply
Post Reply