imesh/animesh.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2008 by Marten Svanfeldt 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_IMESH_ANIMESH_H__ 00020 #define __CS_IMESH_ANIMESH_H__ 00021 00022 #include "csutil/scf_interface.h" 00023 00024 #include "imesh/skeleton2.h" 00025 00026 struct iRenderBuffer; 00027 struct iMaterialWrapper; 00028 struct iShaderVariableContext; 00029 00030 struct iAnimatedMeshFactory; 00031 struct iAnimatedMeshFactorySubMesh; 00032 struct iAnimatedMesh; 00033 struct iAnimatedMeshSubMesh; 00034 struct iAnimatedMeshMorphTarget; 00035 00036 class csReversibleTransform; 00037 00045 struct csAnimatedMeshBoneInfluence 00046 { 00048 BoneID bone; 00049 00054 float influenceWeight; 00055 }; 00056 00060 struct iAnimatedMeshSocketFactory : public virtual iBase 00061 { 00062 public: 00063 SCF_INTERFACE(iAnimatedMeshSocketFactory, 1, 0, 0); 00064 00068 virtual const char* GetName () const = 0; 00069 00073 virtual const csReversibleTransform& GetTransform () const = 0; 00074 00078 virtual void SetTransform (csReversibleTransform& tf) = 0; 00079 00083 virtual BoneID GetBone () const = 0; 00084 00088 virtual iAnimatedMeshFactory* GetFactory () = 0; 00089 }; 00090 00094 struct iAnimatedMeshSocket : public virtual iBase 00095 { 00096 public: 00097 SCF_INTERFACE(iAnimatedMeshSocket, 1, 0, 0); 00098 00102 virtual const char* GetName () const = 0; 00103 00107 virtual iAnimatedMeshSocketFactory* GetFactory () = 0; 00108 00112 virtual const csReversibleTransform& GetTransform () const = 0; 00113 00117 virtual void SetTransform (csReversibleTransform& tf) = 0; 00118 00122 virtual const csReversibleTransform GetFullTransform () const = 0; 00123 00127 virtual BoneID GetBone () const = 0; 00128 00132 virtual iAnimatedMesh* GetMesh () const = 0; 00133 00137 virtual iSceneNode* GetSceneNode () const = 0; 00138 00142 virtual void SetSceneNode (iSceneNode* sn) = 0; 00143 }; 00144 00145 00155 struct iAnimatedMeshFactory : public virtual iBase 00156 { 00157 SCF_INTERFACE(iAnimatedMeshFactory, 2, 2, 0); 00158 00168 virtual iAnimatedMeshFactorySubMesh* CreateSubMesh (iRenderBuffer* indices, 00169 const char* name, bool visible) = 0; 00170 00179 virtual iAnimatedMeshFactorySubMesh* CreateSubMesh ( 00180 const csArray<iRenderBuffer*>& indices, 00181 const csArray<csArray<unsigned int> >& boneIndices, 00182 const char* name, bool visible) = 0; 00183 00187 virtual iAnimatedMeshFactorySubMesh* GetSubMesh (size_t index) const = 0; 00188 00192 virtual size_t FindSubMesh (const char* name) const = 0; 00193 00197 virtual size_t GetSubMeshCount () const = 0; 00198 00202 virtual void DeleteSubMesh (iAnimatedMeshFactorySubMesh* mesh) = 0; 00203 00212 virtual uint GetVertexCount () const = 0; 00213 00219 virtual iRenderBuffer* GetVertices () = 0; 00220 00227 virtual bool SetVertices (iRenderBuffer* renderBuffer) = 0; 00228 00234 virtual iRenderBuffer* GetTexCoords () = 0; 00235 00241 virtual bool SetTexCoords (iRenderBuffer* renderBuffer) = 0; 00242 00248 virtual iRenderBuffer* GetNormals () = 0; 00249 00255 virtual bool SetNormals (iRenderBuffer* renderBuffer) = 0; 00256 00262 virtual iRenderBuffer* GetTangents () = 0; 00263 00269 virtual bool SetTangents (iRenderBuffer* renderBuffer) = 0; 00270 00276 virtual iRenderBuffer* GetBinormals () = 0; 00277 00283 virtual bool SetBinormals (iRenderBuffer* renderBuffer) = 0; 00284 00290 virtual iRenderBuffer* GetColors () = 0; 00291 00297 virtual bool SetColors (iRenderBuffer* renderBuffer) = 0; 00298 00302 virtual void Invalidate () = 0; 00303 00314 virtual void SetSkeletonFactory (iSkeletonFactory2* skeletonFactory) = 0; 00315 00319 virtual iSkeletonFactory2* GetSkeletonFactory () const = 0; 00320 00326 virtual void SetBoneInfluencesPerVertex (uint num) = 0; 00327 00331 virtual uint GetBoneInfluencesPerVertex () const = 0; 00332 00337 virtual csAnimatedMeshBoneInfluence* GetBoneInfluences () = 0; 00338 00350 virtual iAnimatedMeshMorphTarget* CreateMorphTarget (const char* name) = 0; 00351 00355 virtual iAnimatedMeshMorphTarget* GetMorphTarget (uint target) = 0; 00356 00360 virtual uint GetMorphTargetCount () const = 0; 00361 00365 virtual void ClearMorphTargets () = 0; 00366 00371 virtual uint FindMorphTarget (const char* name) const = 0; 00372 00384 virtual void CreateSocket (BoneID bone, 00385 const csReversibleTransform& transform, const char* name) = 0; 00386 00390 virtual size_t GetSocketCount () const = 0; 00391 00395 virtual iAnimatedMeshSocketFactory* GetSocket (size_t index) const = 0; 00396 00401 virtual uint FindSocket (const char* name) const = 0; 00403 }; 00404 00408 struct iAnimatedMeshFactorySubMesh : public virtual iBase 00409 { 00410 SCF_INTERFACE(iAnimatedMeshFactorySubMesh, 1, 2, 0); 00411 00415 virtual iRenderBuffer* GetIndices (size_t set) = 0; 00416 00420 virtual uint GetIndexSetCount () const = 0; 00421 00425 virtual const csArray<unsigned int>& GetBoneIndices (size_t set) = 0; 00426 00430 virtual iMaterialWrapper* GetMaterial () const = 0; 00431 00435 virtual void SetMaterial (iMaterialWrapper* material) = 0; 00436 00440 virtual const char* GetName () const = 0; 00441 }; 00442 00446 struct iAnimatedMesh : public virtual iBase 00447 { 00448 SCF_INTERFACE(iAnimatedMesh, 1, 0, 0); 00449 00456 virtual void SetSkeleton (iSkeleton2* skeleton) = 0; 00457 00461 virtual iSkeleton2* GetSkeleton () const = 0; 00462 00466 virtual iAnimatedMeshSubMesh* GetSubMesh (size_t index) const = 0; 00467 00471 virtual size_t GetSubMeshCount () const = 0; 00472 00476 virtual void SetMorphTargetWeight (uint target, float weight) = 0; 00477 00481 virtual float GetMorphTargetWeight (uint target) const = 0; 00482 00489 virtual size_t GetSocketCount () const = 0; 00490 00494 virtual iAnimatedMeshSocket* GetSocket (size_t index) const = 0; 00496 }; 00497 00501 struct iAnimatedMeshSubMesh : public virtual iBase 00502 { 00503 SCF_INTERFACE(iAnimatedMeshSubMesh, 1, 2, 0); 00504 00508 virtual iAnimatedMeshFactorySubMesh* GetFactorySubMesh () = 0; 00509 00513 virtual void SetRendering (bool doRender) = 0; 00514 00518 virtual bool IsRendering () const = 0; 00519 00523 virtual iShaderVariableContext* GetShaderVariableContext(size_t buffer) const = 0; 00524 00528 virtual iMaterialWrapper* GetMaterial () const = 0; 00529 00533 virtual void SetMaterial (iMaterialWrapper* material) = 0; 00534 }; 00535 00539 struct iAnimatedMeshMorphTarget : public virtual iBase 00540 { 00541 SCF_INTERFACE(iAnimatedMeshMorphTarget, 2, 0, 0); 00542 00549 virtual bool SetVertexOffsets (iRenderBuffer* renderBuffer) = 0; 00550 00555 virtual iRenderBuffer* GetVertexOffsets () = 0; 00556 00560 virtual void Invalidate () = 0; 00561 00563 virtual const char* GetName() const = 0; 00564 }; 00565 00566 00572 #endif // __CS_IMESH_ANIMESH_H__ 00573
Generated for Crystal Space 1.4.0 by doxygen 1.5.8