|
Revision 10562, 1.3 kB
(checked in by cedricpinson, 4 years ago)
|
|
From Cedric Pinson, add missing files
|
| Rev | Line | |
|---|
| [10562] | 1 | /* -*-c++-*- |
|---|
| 2 | * Copyright (C) 2008 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 | |
|---|
| 15 | #ifndef COMPUTE_BIND_MATRIX_VISITOR_H |
|---|
| 16 | #define COMPUTE_BIND_MATRIX_VISITOR_H 1 |
|---|
| 17 | |
|---|
| 18 | #include <osg/NodeVisitor> |
|---|
| 19 | #include <osgAnimation/Bone> |
|---|
| 20 | |
|---|
| 21 | namespace osgAnimation |
|---|
| 22 | { |
|---|
| 23 | |
|---|
| 24 | class ComputeBindMatrixVisitor : public osg::NodeVisitor |
|---|
| 25 | { |
|---|
| 26 | public: |
|---|
| 27 | ComputeBindMatrixVisitor(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} |
|---|
| 28 | void apply(osg::Node& node) { return; } |
|---|
| 29 | void apply(osg::Transform& node) |
|---|
| 30 | { |
|---|
| 31 | osgAnimation::Bone* bone = dynamic_cast<osgAnimation::Bone*>(&node); |
|---|
| 32 | if (!bone) |
|---|
| 33 | return; |
|---|
| 34 | if (bone->needToComputeBindMatrix()) |
|---|
| 35 | bone->computeBindMatrix(); |
|---|
| 36 | |
|---|
| 37 | traverse(node); |
|---|
| 38 | } |
|---|
| 39 | }; |
|---|
| 40 | |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | #endif |
|---|