From Cedric Pinson,
Add check in RigTransformSoftware if bones are null Indent TimelineAnimationManager Add check for NaN in UpdateCallback.cpp Fix TimelineAnimationManager clear target (a refactore of Timeline is require for futur) Fix Computation of bounding box for RigGeometry
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGANIMATION_ANIMATION_MANAGER_BASE_H
|
||||
#define OSGANIMATION_ANIMATION_MANAGER_BASE_H
|
||||
#ifndef OSGANIMATION_ANIMATION_MANAGER_BASE
|
||||
#define OSGANIMATION_ANIMATION_MANAGER_BASE 1
|
||||
|
||||
#include <osgAnimation/LinkVisitor>
|
||||
#include <osgAnimation/Animation>
|
||||
@@ -55,7 +55,6 @@ namespace osgAnimation
|
||||
/// set a flag to define the behaviour
|
||||
void setAutomaticLink(bool);
|
||||
bool isAutomaticLink() const;
|
||||
|
||||
void dirty();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
* Michael Platings <mplatings@pixelpower.com>
|
||||
*/
|
||||
|
||||
#ifndef OSGANIMATION_INTERPOLATOR_H
|
||||
#define OSGANIMATION_INTERPOLATOR_H
|
||||
#ifndef OSGANIMATION_INTERPOLATOR
|
||||
#define OSGANIMATION_INTERPOLATOR 1
|
||||
|
||||
#include <osg/Notify>
|
||||
#include <osgAnimation/Keyframe>
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace osgAnimation
|
||||
{
|
||||
if (_bones.empty())
|
||||
{
|
||||
osg::notify(osg::WARN) << "RigTransformSoftware::UniqBoneSetVertexSet no bones found" << std::endl;
|
||||
osg::notify(osg::WARN) << this << " RigTransformSoftware::UniqBoneSetVertexSet no bones found" << std::endl;
|
||||
_result = osg::Matrix::identity();
|
||||
return;
|
||||
}
|
||||
@@ -96,6 +96,11 @@ namespace osgAnimation
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
const Bone* bone = _bones[i].getBone();
|
||||
if (!bone)
|
||||
{
|
||||
osg::notify(osg::WARN) << this << " RigTransformSoftware::computeMatrixForVertexSet Warning a bone is null, skip it" << std::endl;
|
||||
continue;
|
||||
}
|
||||
const osg::Matrix& invBindMatrix = bone->getInvBindMatrixInSkeletonSpace();
|
||||
const osg::Matrix& matrix = bone->getMatrixInSkeletonSpace();
|
||||
osg::Matrix::value_type w = _bones[i].getWeight();
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGANIMATION_TIMELINE_H
|
||||
#define OSGANIMATION_TIMELINE_H
|
||||
#ifndef OSGANIMATION_TIMELINE
|
||||
#define OSGANIMATION_TIMELINE 1
|
||||
|
||||
#include <osgAnimation/Export>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <osg/observer_ptr>
|
||||
#include <osg/Notify>
|
||||
#include <osg/Stats>
|
||||
#include <osgAnimation/Action>
|
||||
@@ -27,7 +28,7 @@
|
||||
|
||||
namespace osgAnimation
|
||||
{
|
||||
class OSGANIMATION_EXPORT Timeline : public Action //osg::Object
|
||||
class OSGANIMATION_EXPORT Timeline : public Action
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -79,9 +80,9 @@ namespace osgAnimation
|
||||
const ActionLayers& getActionLayers() const { return _actions; }
|
||||
|
||||
void processPendingOperation();
|
||||
|
||||
void setAnimationManager(AnimationManagerBase*);
|
||||
protected:
|
||||
|
||||
osg::observer_ptr<AnimationManagerBase> _animationManager;
|
||||
ActionLayers _actions;
|
||||
double _lastUpdate;
|
||||
double _speed;
|
||||
@@ -89,7 +90,7 @@ namespace osgAnimation
|
||||
unsigned int _previousFrameEvaluated;
|
||||
bool _initFirstFrame;
|
||||
TimelineStatus _state;
|
||||
|
||||
|
||||
bool _collectStats;
|
||||
osg::ref_ptr<osg::Stats> _stats;
|
||||
osg::ref_ptr<osgAnimation::StatsActionVisitor> _statsVisitor;
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGANIMATION_TIMELINE_ANIMATION_MANAGER_H
|
||||
#define OSGANIMATION_TIMELINE_ANIMATION_MANAGER_H
|
||||
#ifndef OSGANIMATION_TIMELINE_ANIMATION_MANAGER
|
||||
#define OSGANIMATION_TIMELINE_ANIMATION_MANAGER 1
|
||||
|
||||
#include <osgAnimation/Export>
|
||||
#include <osgAnimation/AnimationManagerBase>
|
||||
@@ -23,21 +23,21 @@
|
||||
namespace osgAnimation
|
||||
{
|
||||
|
||||
class OSGANIMATION_EXPORT TimelineAnimationManager : public AnimationManagerBase
|
||||
{
|
||||
protected:
|
||||
osg::ref_ptr<Timeline> _timeline;
|
||||
class OSGANIMATION_EXPORT TimelineAnimationManager : public AnimationManagerBase
|
||||
{
|
||||
protected:
|
||||
osg::ref_ptr<Timeline> _timeline;
|
||||
|
||||
public:
|
||||
META_Object(osgAnimation, TimelineAnimationManager);
|
||||
TimelineAnimationManager();
|
||||
TimelineAnimationManager(const AnimationManagerBase& manager);
|
||||
TimelineAnimationManager(const TimelineAnimationManager& nc,const osg::CopyOp&);
|
||||
public:
|
||||
META_Object(osgAnimation, TimelineAnimationManager);
|
||||
TimelineAnimationManager();
|
||||
TimelineAnimationManager(const AnimationManagerBase& manager);
|
||||
TimelineAnimationManager(const TimelineAnimationManager& nc,const osg::CopyOp&);
|
||||
|
||||
Timeline* getTimeline() { return _timeline.get(); }
|
||||
const Timeline* getTimeline() const { return _timeline.get(); }
|
||||
void update(double time);
|
||||
};
|
||||
Timeline* getTimeline() { return _timeline.get(); }
|
||||
const Timeline* getTimeline() const { return _timeline.get(); }
|
||||
void update(double time);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user