root/OpenSceneGraph/trunk/src/osgAnimation/BoneMapVisitor.cpp @ 10562

Revision 10562, 1.2 kB (checked in by cedricpinson, 5 years ago)

From Cedric Pinson, add missing files

RevLine 
[10562]1/*  -*-c++-*-
2 *  Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
3 *
4 * This library is open source and may be redistributed and/or modified under 
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version.  The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * OpenSceneGraph Public License for more details.
13 *
14 * Authors:
15 *         Cedric Pinson <cedric.pinson@plopbyte.net>
16 */
17
18#include <osgAnimation/BoneMapVisitor>
19
20osgAnimation::BoneMapVisitor::BoneMapVisitor() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
21
22void osgAnimation::BoneMapVisitor::apply(osg::Node&) { return; }
23void osgAnimation::BoneMapVisitor::apply(osg::Transform& node)
24{
25    Bone* bone = dynamic_cast<Bone*>(&node);
26    if (bone)
27    {
28        _map[bone->getName()] = bone;
29        traverse(node);
30    }
31}
32const osgAnimation::Bone::BoneMap& osgAnimation::BoneMapVisitor::getBoneMap() const
33{
34    return _map;
35}
Note: See TracBrowser for help on using the browser.