-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
OpenSceneGraph 3.0: Beginner's Guide
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.
A channel that contains a 3D vector's sampler can be replaced by the osgAnimation::Vec3LinearChannel class, and the one with a spherical linear quaternion sampler is called osgAnimation::QuatSphericalLinearChannel, and so on.
After finishing...
Change the font size
Change margin width
Change background colour