imesh/skeletonmodel.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2009-2012 Christian Van Brussel, Institute of Information 00003 and Communication Technologies, Electronics and Applied Mathematics 00004 at Universite catholique de Louvain, Belgium 00005 http://www.uclouvain.be/en-icteam.html 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public 00018 License along with this library; if not, write to the Free 00019 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 #ifndef __CS_IMESH_SKELETONMODEL_H__ 00022 #define __CS_IMESH_SKELETONMODEL_H__ 00023 00028 #include "csutil/scf_interface.h" 00029 00030 #include "imesh/animnode/skeleton2anim.h" 00031 #include "ivaria/colliders.h" 00032 00036 namespace CS { 00037 00038 namespace Mesh { 00039 00040 struct iAnimatedMeshFactory; 00041 00042 } // namespace Mesh 00043 00044 namespace Physics { 00045 00046 struct iJointFactory; 00047 struct iRigidBodyFactory; 00048 00049 } // namespace Physics 00050 00051 namespace Animation { 00052 00053 struct iSkeletonBoneModel; 00054 struct iSkeletonChain; 00055 struct iSkeletonChainNode; 00056 struct iSkeletonFactory; 00057 struct iSkeletonModel; 00058 00062 struct iSkeletonModelManager : public virtual iBase 00063 { 00064 SCF_INTERFACE (CS::Animation::iSkeletonModelManager, 1, 0, 0); 00065 00069 virtual csPtr<iSkeletonModel> CreateModel (iSkeletonFactory* skeletonFactory) = 0; 00070 }; 00071 00075 struct iSkeletonBoneModelIterator : public virtual iBase 00076 { 00077 SCF_INTERFACE (iSkeletonBoneModelIterator, 1, 0, 0); 00078 00079 virtual bool HasNext () const = 0; 00080 virtual iSkeletonBoneModel* Next () = 0; 00081 }; 00082 00086 struct iSkeletonChainIterator : public virtual iBase 00087 { 00088 SCF_INTERFACE (iSkeletonChainIterator, 1, 0, 0); 00089 00090 virtual bool HasNext () const = 0; 00091 virtual iSkeletonChain* Next () = 0; 00092 }; 00093 00100 struct iSkeletonModel : public virtual iBase 00101 { 00102 SCF_INTERFACE (CS::Animation::iSkeletonModel, 1, 0, 0); 00103 00105 virtual iObject* QueryObject () = 0; 00106 00110 virtual iSkeletonFactory* GetSkeletonFactory () const = 0; 00111 00115 virtual void ClearAll () = 0; 00116 00121 virtual iSkeletonBoneModel* CreateBoneModel (BoneID boneID) = 0; 00122 00126 virtual iSkeletonBoneModel* FindBoneModel (const char *name) const = 0; 00127 00131 virtual iSkeletonBoneModel* FindBoneModel (BoneID bone) const = 0; 00132 00136 virtual csPtr<iSkeletonBoneModelIterator> GetBoneModels () const = 0; 00137 00141 virtual void RemoveBoneModel (BoneID bone) = 0; 00142 00146 virtual void ClearBoneModels () = 0; 00147 00154 virtual iSkeletonChain* CreateChain (const char *name, BoneID rootBone) = 0; 00155 00159 virtual iSkeletonChain* FindChain (const char *name) const = 0; 00160 00164 virtual csPtr<iSkeletonChainIterator> GetChains () const = 0; 00165 00169 virtual void RemoveChain (const char* name) = 0; 00170 00174 virtual void ClearChains () = 0; 00175 00188 // TODO: tool class? 00189 virtual void PopulateDefaultModels 00190 (const CS::Mesh::iAnimatedMeshFactory* animeshFactory, 00191 CS::Collisions::ColliderType colliderType = CS::Collisions::COLLIDER_CAPSULE) = 0; 00192 00202 // TODO: tool class? 00203 virtual void PopulateDefaultChains () = 0; 00204 }; 00205 00209 struct iSkeletonBoneModel : public virtual iBase 00210 { 00211 SCF_INTERFACE (CS::Animation::iSkeletonBoneModel, 1, 0, 0); 00212 00216 virtual BoneID GetAnimeshBone () const = 0; 00217 00221 virtual void SetRigidBodyFactory (CS::Physics::iRigidBodyFactory* factory) = 0; 00222 00227 virtual CS::Physics::iRigidBodyFactory* GetRigidBodyFactory () const = 0; 00228 00233 virtual void SetJointFactory (CS::Physics::iJointFactory* factory) = 0; 00234 00239 virtual CS::Physics::iJointFactory* GetJointFactory () const = 0; 00240 00244 virtual void SetJointTransform (const csOrthoTransform &transform) = 0; 00245 00249 virtual const csOrthoTransform& GetJointTransform () const = 0; 00250 }; 00251 00256 struct iSkeletonChain : public virtual iBase 00257 { 00258 SCF_INTERFACE (CS::Animation::iSkeletonChain, 1, 0, 0); 00259 00263 virtual const char* GetName () const = 0; 00264 00268 virtual iSkeletonModel* GetSkeletonModel () = 0; 00269 00273 virtual iSkeletonChainNode* GetRootNode () = 0; 00274 00283 virtual bool AddSubChain (CS::Animation::BoneID subBone) = 0; 00284 00289 virtual bool AddAllSubChains () = 0; 00290 00294 virtual csString Description () const = 0; 00295 00301 // TODO: tool class? 00302 virtual void PopulateBoneMask (csBitArray& boneMask) const = 0; 00303 }; 00304 00309 struct iSkeletonChainNode : public virtual iBase 00310 { 00311 SCF_INTERFACE (CS::Animation::iSkeletonChainNode, 1, 0, 0); 00312 00317 virtual BoneID GetAnimeshBone () const = 0; 00318 00322 virtual size_t GetChildCount () const = 0; 00323 00327 virtual iSkeletonChainNode* GetChild (size_t index) const = 0; 00328 00333 virtual iSkeletonChainNode* GetParent () const = 0; 00334 00339 virtual iSkeletonChainNode* FindSubChild (CS::Animation::BoneID child) const = 0; 00340 00344 virtual csString Description () const = 0; 00345 }; 00346 00347 } // namespace Animation 00348 } // namespace CS 00349 00352 #endif // __CS_IMESH_SKELETONMODEL_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
