From Cedric Pinson, fix constructors for cloning osgAnimation objects
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace osgAnimation
|
||||
void clearTargets();
|
||||
void normalizeTargets();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
AnimationList _animations;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user