~ubuntu-branches/debian/experimental/openscenegraph/experimental

« back to all changes in this revision

Viewing changes to OpenSceneGraph/include/osgAnimation/UpdateCallback

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Luaces
  • Date: 2011-01-29 11:36:29 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110129113629-qisrm2kdqlurc7t3
Tags: 2.9.11-1
* Removed bug-555869-ftbfs_with_binutils_gold.dpatch since upstream has
  already taken care of the issue.
* Removed bug-528229.dpatch since the pkgconfig files are now also split
  in upstream.
* Removed explicit dependency on GLU.
* Upstream no longer includes osgIntrospection (Closes: #592420).
* Disabled zip plugin as its implementation stores an embedded copy of
  zlib.
* Enabled Qt support. Thanks James Goppert.
* Enabled SVG and PDF plugins. Thanks James Goppert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  -*-c++-*- 
2
 
 *  Copyright (C) 2008 Cedric Pinson <mornifle@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 OSGANIMATION_UPDATE_CALLBACK_H
16
 
#define OSGANIMATION_UPDATE_CALLBACK_H
17
 
 
18
 
#include <osg/Vec3>
19
 
#include <osg/NodeCallback>
20
 
#include <osg/observer_ptr>
21
 
#include <osgAnimation/AnimationManagerBase>
22
 
#include <osgAnimation/Export>
23
 
 
24
 
namespace osgAnimation 
25
 
{
26
 
 
27
 
    class OSGANIMATION_EXPORT AnimationUpdateCallback : public osg::NodeCallback
28
 
    {
29
 
    protected:
30
 
        osg::observer_ptr<osgAnimation::AnimationManagerBase> _manager;
31
 
 
32
 
    public:
33
 
        AnimationUpdateCallback(const std::string& name = "") { setName(name); }
34
 
        AnimationUpdateCallback(const AnimationUpdateCallback& apc,const osg::CopyOp& copyop);
35
 
        osgAnimation::AnimationManagerBase* getAnimationManager();
36
 
        virtual bool needLink() const = 0;
37
 
        virtual bool link(osgAnimation::Channel* channel) = 0;
38
 
        virtual int link(osgAnimation::Animation* animation);
39
 
        virtual void updateLink();
40
 
    };
41
 
  
42
 
 
43
 
    class OSGANIMATION_EXPORT UpdateTransform : public AnimationUpdateCallback
44
 
    {
45
 
    protected:
46
 
        osg::ref_ptr<osgAnimation::Vec3Target> _euler;
47
 
        osg::ref_ptr<osgAnimation::Vec3Target> _position;
48
 
        osg::ref_ptr<osgAnimation::Vec3Target> _scale;
49
 
    
50
 
    public:
51
 
 
52
 
        META_Object(osgAnimation, UpdateTransform);
53
 
 
54
 
        UpdateTransform(const std::string& name = "");
55
 
        UpdateTransform(const UpdateTransform& apc,const osg::CopyOp& copyop);
56
 
 
57
 
        /** Callback method called by the NodeVisitor when visiting a node.*/
58
 
        virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
59
 
        void update(osg::MatrixTransform& mat);
60
 
        void update(osg::PositionAttitudeTransform& pat);
61
 
        bool needLink() const;
62
 
        bool link(osgAnimation::Channel* channel);
63
 
    };
64
 
 
65
 
 
66
 
}
67
 
 
68
 
#endif