Channels and animation managers

Now it's time to handle samplers full of preset key-frames. The osgAnimation::TemplateChannel<> class accepts a certain sampler class as the argument and represents the association of the sampler and a "target". The channel's name is set by the setName() method, and the target it is looking for is defined by the setTargetName() method.

The target objects are often osgAnimation built-in update callbacks. They should be attached to specific nodes with the setUpdateCallback() method. The osgAnimation::UpdateMatrixTransform is a typical one. It updates the host osg::MatrixTransform node and changes the transformation matrix using the channel results per frame. We will have a look at its usage in the following example. ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.