imesh/spritecal3d.h
00001 /* 00002 Copyright (C) 2003 by Keith Fulton 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_SPRITECAL3D_H__ 00020 #define __CS_IMESH_SPRITECAL3D_H__ 00021 00022 #include "csutil/scf.h" 00023 #include "csutil/garray.h" 00024 #include "csutil/cscolor.h" 00025 #include "ivideo/graph3d.h" 00026 00027 class csColor; 00028 class csRandomGen; 00029 struct iMaterialWrapper; 00030 struct iMeshObject; 00031 struct iMeshWrapper; 00032 struct iMeshObjectFactory; 00033 struct iRenderView; 00034 struct iRenderView; 00035 struct iVFS; 00036 00037 SCF_VERSION (iSpriteCal3DSocket, 0, 0, 1); 00038 00043 struct iSpriteCal3DSocket : public iBase 00044 { 00046 virtual void SetName (char const*) = 0; 00048 virtual char const* GetName () const = 0; 00049 00051 virtual void SetMeshWrapper (iMeshWrapper* mesh) = 0; 00053 virtual iMeshWrapper* GetMeshWrapper () const = 0; 00054 00056 virtual void SetTriangleIndex (int tri_index) = 0; 00058 virtual int GetTriangleIndex () const = 0; 00059 00061 virtual void SetSubmeshIndex (int subm_index) = 0; 00063 virtual int GetSubmeshIndex () const = 0; 00064 00066 virtual void SetMeshIndex (int m_index) = 0; 00068 virtual int GetMeshIndex () const = 0; 00069 }; 00070 00071 00072 00073 SCF_VERSION (iSpriteCal3DFactoryState, 0, 0, 3); 00074 00078 struct iSpriteCal3DFactoryState : public iBase 00079 { 00081 virtual bool Create(const char *name) = 0; 00082 00088 virtual void ReportLastError () = 0; 00089 00094 virtual void SetLoadFlags(int flags) = 0; 00095 00100 virtual void SetBasePath(const char *path) = 0; 00101 00105 virtual bool LoadCoreSkeleton(iVFS *vfs,const char *filename) = 0; 00106 00111 virtual void RescaleFactory(float factor) = 0; 00112 00143 virtual int LoadCoreAnimation(iVFS *vfs,const char *filename, 00144 const char *name, 00145 int type, 00146 float base_velocity, 00147 float min_velocity, 00148 float max_velocity, 00149 int min_interval, 00150 int max_interval, 00151 int idle_pct, 00152 bool lock) = 0; 00153 00165 virtual int LoadCoreMesh(iVFS *vfs,const char *filename, 00166 const char *name,bool attach,iMaterialWrapper *defmat) = 0; 00167 00178 virtual int LoadCoreMorphTarget(iVFS *vfs,int mesh_index, 00179 const char *filename, const char *name) = 0; 00180 00188 virtual int AddMorphAnimation(const char *name) = 0; 00189 00199 virtual bool AddMorphTarget(int morphanimation_index, 00200 const char *mesh_name, 00201 const char *morphtarget_name) = 0; 00202 00207 virtual bool AddCoreMaterial(iMaterialWrapper *mat) = 0; 00208 00213 virtual void BindMaterials() = 0; 00214 00219 virtual int GetMeshCount() = 0; 00220 00224 virtual int GetMorphAnimationCount() = 0; 00225 00234 virtual int GetMorphTargetCount(int mesh_id) = 0; 00235 00239 virtual const char *GetMeshName(int idx) = 0; 00240 00244 virtual int FindMeshName(const char *meshName) = 0; 00245 00249 virtual const char* GetDefaultMaterial( const char* meshName ) = 0; 00250 00251 00256 virtual const char *GetMorphAnimationName(int idx) = 0; 00257 00262 virtual int FindMorphAnimationName(const char *meshName) = 0; 00263 00267 virtual bool IsMeshDefault(int idx) = 0; 00268 00270 virtual iSpriteCal3DSocket* AddSocket () = 0; 00272 virtual iSpriteCal3DSocket* FindSocket (const char * name) const = 0; 00274 virtual iSpriteCal3DSocket* FindSocket (iMeshWrapper *mesh) const = 0; 00276 virtual int GetSocketCount () const = 0; 00278 virtual iSpriteCal3DSocket* GetSocket (int f) const = 0; 00279 }; 00280 00281 SCF_VERSION (iSpriteCal3DState, 0, 0, 2); 00282 00287 struct iSpriteCal3DState : public iBase 00288 { 00290 enum 00291 { 00292 C3D_ANIM_TYPE_NONE, 00293 C3D_ANIM_TYPE_IDLE, 00294 C3D_ANIM_TYPE_TRAVEL, 00295 C3D_ANIM_TYPE_CYCLE, 00296 C3D_ANIM_TYPE_STYLE_CYCLE, 00297 C3D_ANIM_TYPE_ACTION 00298 }; 00299 00301 virtual int GetAnimCount() = 0; 00302 00307 virtual const char *GetAnimName(int idx) = 0; 00308 00310 virtual int GetAnimType(int idx) = 0; 00311 00313 virtual void ClearAllAnims() = 0; 00314 00319 virtual bool SetAnimCycle(const char *name, float weight) = 0; 00320 00325 virtual bool SetAnimCycle(int idx, float weight) = 0; 00326 00335 virtual bool AddAnimCycle(const char *name, float weight, float delay) = 0; 00336 00340 virtual bool AddAnimCycle(int idx, float weight, float delay) = 0; 00341 00346 virtual bool ClearAnimCycle(const char *name, float delay) = 0; 00347 00353 virtual int GetActiveAnimCount() = 0; 00354 00361 virtual int GetActiveAnims(char *buffer,int max_length) = 0; 00362 00367 virtual void SetActiveAnims(const char *buffer,int anim_count) = 0; 00368 00375 virtual bool SetAnimAction(const char *name, float delayIn, 00376 float delayOut) = 0; 00377 00384 virtual bool SetAnimAction(int idx, float delayIn, 00385 float delayOut) = 0; 00386 00393 virtual bool SetVelocity(float vel,csRandomGen *rng=0) = 0; 00394 00399 virtual void SetLOD(float lod) = 0; 00400 00405 virtual bool AttachCoreMesh(const char *meshname) = 0; 00406 00414 virtual bool AttachCoreMesh(int mesh_id,int iMatWrap) = 0; 00415 00420 virtual bool DetachCoreMesh(const char *meshname) = 0; 00421 00428 virtual bool DetachCoreMesh(int mesh_id) = 0; 00429 00439 virtual bool BlendMorphTarget(int morph_animation_id, float weight, 00440 float delay) = 0; 00441 00450 virtual bool ClearMorphTarget(int morph_animation_id, float delay) = 0; 00451 00453 virtual iSpriteCal3DSocket* FindSocket (iMeshWrapper *mesh) const = 0; 00454 00456 virtual iSpriteCal3DSocket* FindSocket (const char* name) const = 0; 00457 00459 virtual bool SetMaterial(const char *mesh_name,iMaterialWrapper *mat) = 0; 00460 00462 virtual void SetTimeFactor(float timeFactor) = 0; 00463 00465 virtual float GetTimeFactor() = 0; 00466 00468 virtual float GetAnimationTime() = 0; 00469 00471 virtual float GetAnimationDuration() = 0; 00472 00474 virtual void SetAnimationTime(float animationTime) = 0; 00475 }; 00476 00477 #endif// __CS_IMESH_SPRITECAL3D_H__
Generated for Crystal Space by doxygen 1.2.18