From Cedric Pinson, fix constructors for cloning osgAnimation objects

This commit is contained in:
Cedric Pinson
2009-06-22 14:24:59 +00:00
parent c0c47b2eca
commit 658d96aa64
10 changed files with 50 additions and 21 deletions

View File

@@ -31,7 +31,7 @@ namespace osgAnimation
META_Object(osgAnimation, Animation)
Animation() : _duration(0), _weight(0), _startTime(0), _playmode(LOOP) {}
Animation(const osgAnimation::Animation& anim, const osg::CopyOp&);
Animation(const osgAnimation::Animation&, const osg::CopyOp&);
enum PlayMode
{

View File

@@ -46,7 +46,6 @@ namespace osgAnimation
void clearTargets();
void normalizeTargets();
protected:
AnimationList _animations;

View File

@@ -29,7 +29,9 @@ namespace osgAnimation
public:
Channel();
Channel(const Channel& channel);
virtual ~Channel();
virtual Channel* clone() const = 0;
virtual void update(float time) = 0;
virtual void reset() = 0;
@@ -66,8 +68,16 @@ namespace osgAnimation
typedef typename SamplerType::UsingType UsingType;
typedef TemplateTarget<UsingType> TargetType;
typedef TemplateKeyframeContainer<typename SamplerType::KeyframeType> KeyframeContainerType;
Channel* clone() const { return new TemplateChannel<SamplerType>(*this); }
TemplateChannel (SamplerType* s = 0,TargetType* target = 0)
TemplateChannel (const TemplateChannel& channel) :
Channel(channel),
_target(new TargetType),
_sampler(channel._sampler.get())
{
}
TemplateChannel (SamplerType* s = 0,TargetType* target = 0)
{
if (target)
_target = target;

View File

@@ -31,7 +31,7 @@ namespace osgAnimation
{
META_Object(osgAnimation, UpdateSkeleton);
UpdateSkeleton() {}
UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : osg::NodeCallback(us, copyop) {}
UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : osg::Object(us, copyop), osg::NodeCallback(us, copyop) {}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
};