CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 
00398   virtual void SetDefaultIdleAnim(const char *name) = 0;
00399 
00404   virtual void SetLOD(float lod) = 0;
00405 
00410   virtual bool AttachCoreMesh(const char *meshname) = 0;
00411 
00419   virtual bool AttachCoreMesh(int mesh_id,int iMatWrap) = 0;
00420 
00425   virtual bool DetachCoreMesh(const char *meshname) = 0;
00426 
00433   virtual bool DetachCoreMesh(int mesh_id) = 0;
00434 
00444   virtual bool BlendMorphTarget(int morph_animation_id, float weight,
00445         float delay) = 0;
00446 
00455   virtual bool ClearMorphTarget(int morph_animation_id, float delay) = 0;
00456 
00458   virtual iSpriteCal3DSocket* FindSocket (iMeshWrapper *mesh) const = 0;
00459 
00461   virtual iSpriteCal3DSocket* FindSocket (const char* name) const = 0;
00462 
00464   virtual bool SetMaterial(const char *mesh_name,iMaterialWrapper *mat) = 0;
00465 
00467   virtual void SetTimeFactor(float timeFactor) = 0;
00468 
00470   virtual float GetTimeFactor() = 0;
00471 
00473   virtual float GetAnimationTime() = 0;
00474 
00476   virtual float GetAnimationDuration() = 0;
00477 
00479   virtual void SetAnimationTime(float animationTime) = 0;
00480 };
00481 
00482 #endif// __CS_IMESH_SPRITECAL3D_H__

Generated for Crystal Space by doxygen 1.2.18