~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/gameengine/Converter/BL_SkinDeformer.h

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: BL_SkinDeformer.h 14444 2008-04-16 22:40:48Z hos $
 
2
 * $Id: BL_SkinDeformer.h 16736 2008-09-26 02:27:59Z erwin $
3
3
 *
4
4
 * ***** BEGIN GPL LICENSE BLOCK *****
5
5
 *
50
50
{
51
51
public:
52
52
//      void SetArmatureController (BL_ArmatureController *cont);
53
 
        virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map)
54
 
        {
55
 
                void **h_obj = (*map)[m_armobj];
56
 
                if (h_obj){
57
 
                        SetArmature( (BL_ArmatureObject*)(*h_obj) );
58
 
                }
59
 
                else
60
 
                        m_armobj=NULL;
61
 
        }
 
53
        virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map);
62
54
        void SetArmature (class BL_ArmatureObject *armobj);
63
55
 
64
 
        BL_SkinDeformer(struct Object *bmeshobj, 
 
56
        BL_SkinDeformer(BL_DeformableGameObject *gameobj,
 
57
                                        struct Object *bmeshobj, 
65
58
                                        class BL_SkinMeshObject *mesh,
66
 
                                        BL_ArmatureObject* arma = NULL)
67
 
                                        :       //
68
 
                                                BL_MeshDeformer(bmeshobj, mesh),
69
 
                                                m_armobj(arma),
70
 
                                                m_lastUpdate(-1),
71
 
                                                m_defbase(&bmeshobj->defbase),
72
 
                                                m_releaseobject(false),
73
 
                                                m_restoremat(false)
74
 
        {
75
 
        };
 
59
                                        BL_ArmatureObject* arma = NULL);
76
60
 
77
61
        /* this second constructor is needed for making a mesh deformable on the fly. */
78
 
        BL_SkinDeformer(struct Object *bmeshobj_old,
 
62
        BL_SkinDeformer(BL_DeformableGameObject *gameobj,
 
63
                                        struct Object *bmeshobj_old,
79
64
                                        struct Object *bmeshobj_new,
80
65
                                        class BL_SkinMeshObject *mesh,
81
66
                                        bool release_object,
82
67
                                        BL_ArmatureObject* arma = NULL);
83
68
 
84
69
        virtual void ProcessReplica();
85
 
        virtual RAS_Deformer *GetReplica();
 
70
        virtual RAS_Deformer *GetReplica(class KX_GameObject* replica);
86
71
        virtual ~BL_SkinDeformer();
87
 
        void Update (void);
 
72
        bool Update (void);
88
73
        bool Apply (class RAS_IPolyMaterial *polymat);
 
74
        bool PoseUpdated(void)
 
75
                { 
 
76
                        if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()) {
 
77
                                return true;
 
78
                        }
 
79
                        return false;
 
80
                }
 
81
 
 
82
        void ForceUpdate()
 
83
        {
 
84
                m_lastArmaUpdate = -1.0;
 
85
        };
89
86
 
90
87
protected:
91
88
        BL_ArmatureObject*              m_armobj;       //      Our parent object
92
89
        float                                   m_time;
93
 
        double                                  m_lastUpdate;
 
90
        double                                  m_lastArmaUpdate;
94
91
        ListBase*                               m_defbase;
95
 
        float                                   m_obmat[4][4];  // the original object matrice in case of dynamic mesh replacement
96
 
        bool                                    m_restoremat;           
 
92
        float                                   m_obmat[4][4];  // the reference matrix for skeleton deform
97
93
        bool                                    m_releaseobject;
 
94
        bool                                    m_poseApplied;
98
95
 
99
96
};
100
97