From Cedric Pinson, Fix Skeleton to compute correctly bind matrix, fix compile issue on osganimationhardware after fixing Skeleton

This commit is contained in:
Cedric Pinson
2009-11-13 13:39:21 +00:00
parent cd2d69506b
commit 5842677662
2 changed files with 37 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
@@ -12,12 +12,11 @@
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGANIMATION_SKELETON_H
#define OSGANIMATION_SKELETON_H
#ifndef OSGANIMATION_SKELETON
#define OSGANIMATION_SKELETON 1
#include <osg/MatrixTransform>
#include <osgAnimation/Bone>
#include <osgAnimation/Export>
#include <osgAnimation/Bone>
namespace osgAnimation
{
@@ -31,18 +30,19 @@ namespace osgAnimation
{
public:
META_Object(osgAnimation, UpdateSkeleton);
UpdateSkeleton() : _needValidate(true) {}
UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : osg::Object(us, copyop), osg::NodeCallback(us, copyop) { _needValidate = true;}
UpdateSkeleton();
UpdateSkeleton(const UpdateSkeleton&, const osg::CopyOp&);
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
bool needToValidate() const;
protected:
bool _needValidate;
};
Skeleton(const Skeleton& b, const osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : Bone(b,copyop) {}
Skeleton();
void setDefaultUpdateCallback(void);
void computeBindMatrix() { _invBindInSkeletonSpace = osg::Matrix::inverse(_bindInBoneSpace); _needToRecomputeBindMatrix = false; }
Skeleton(const Skeleton&, const osg::CopyOp&);
void setDefaultUpdateCallback();
void computeBindMatrix();
};
}