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 iSkeleton;
00031 struct iSkeletonState;
00032 struct iMeshObject;
00033 struct iMeshWrapper;
00034 struct iMeshObjectFactory;
00035 struct iRenderView;
00036 struct iRenderView;
00037 struct iVFS;
00038 
00039 SCF_VERSION (iSpriteCal3DSocket, 0, 0, 1);
00040 
00045 struct iSpriteCal3DSocket : public iBase
00046 {
00048   virtual void SetName (char const*) = 0;
00050   virtual char const* GetName () const = 0;
00051 
00053   virtual void SetMeshWrapper (iMeshWrapper* mesh) = 0;
00055   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00056 
00058   virtual void SetTriangleIndex (int tri_index) = 0;
00060   virtual int GetTriangleIndex () const = 0;
00061 
00063   virtual void SetSubmeshIndex (int subm_index) = 0;
00065   virtual int GetSubmeshIndex () const = 0;
00066 
00068   virtual void SetMeshIndex (int m_index) = 0;
00070   virtual int GetMeshIndex () const = 0;
00071 };
00072 
00073 
00074 
00075 SCF_VERSION (iSpriteCal3DFactoryState, 0, 0, 3);
00076 
00080 struct iSpriteCal3DFactoryState : public iBase
00081 {
00083   virtual bool Create(const char *name) = 0;
00084 
00089   virtual void ReportLastError () = 0;
00090 
00095   virtual void SetLoadFlags(int flags) = 0;
00096 
00101   virtual void SetBasePath(const char *path) = 0;
00102 
00106   virtual bool LoadCoreSkeleton(iVFS *vfs,const char *filename) = 0;
00107 
00112   virtual void RescaleFactory(float factor) = 0;
00113 
00134   virtual int  LoadCoreAnimation(iVFS *vfs,const char *filename,
00135                                  const char *name,
00136                                  int type,
00137                                  float base_velocity,
00138                                  float min_velocity,
00139                                  float max_velocity,
00140                  int min_interval,
00141                  int max_interval,
00142                  int idle_pct,
00143                  bool lock) = 0;
00144 
00155   virtual int LoadCoreMesh(iVFS *vfs,const char *filename,const char *name,bool attach,iMaterialWrapper *defmat) = 0;
00156 
00166   virtual int LoadCoreMorphTarget(iVFS *vfs,int mesh_index,const char *filename,const char *name) = 0;
00167   
00175   virtual int AddMorphAnimation(const char *name) = 0;
00176   
00186   virtual bool AddMorphTarget(int morphanimation_index,
00187                               const char *mesh_name, const char *morphtarget_name) = 0;
00188   
00193   virtual bool AddCoreMaterial(iMaterialWrapper *mat) = 0;
00194 
00199   virtual void BindMaterials() = 0;
00200 
00205   virtual int  GetMeshCount() = 0;
00206 
00210   virtual int GetMorphAnimationCount() = 0;
00211   
00220   virtual int GetMorphTargetCount(int mesh_id) = 0;
00221 
00225   virtual const char *GetMeshName(int idx) = 0;
00226 
00230   virtual int  FindMeshName(const char *meshName) = 0;
00231 
00235   virtual const char *GetMorphAnimationName(int idx) = 0;
00236 
00240   virtual int  FindMorphAnimationName(const char *meshName) = 0;
00241 
00245   virtual bool IsMeshDefault(int idx) = 0;
00246 
00248   virtual iSpriteCal3DSocket* AddSocket () = 0;
00250   virtual iSpriteCal3DSocket* FindSocket (const char * name) const = 0;
00252   virtual iSpriteCal3DSocket* FindSocket (iMeshWrapper *mesh) const = 0;
00254   virtual int GetSocketCount () const = 0;
00256   virtual iSpriteCal3DSocket* GetSocket (int f) const = 0;
00257 };
00258 
00259 SCF_VERSION (iSpriteCal3DState, 0, 0, 1);
00260 
00261 
00266 struct iSpriteCal3DState : public iBase
00267 {
00269   enum
00270   {
00271     C3D_ANIM_TYPE_NONE,
00272     C3D_ANIM_TYPE_IDLE,
00273     C3D_ANIM_TYPE_TRAVEL,
00274     C3D_ANIM_TYPE_CYCLE,
00275     C3D_ANIM_TYPE_STYLE_CYCLE,
00276     C3D_ANIM_TYPE_ACTION
00277   };
00278 
00280   virtual int GetAnimCount() = 0;
00281 
00283   virtual const char *GetAnimName(int idx) = 0;
00284 
00286   virtual int  GetAnimType(int idx) = 0;
00287 
00289   virtual void ClearAllAnims() = 0;
00290 
00292   virtual bool SetAnimCycle(const char *name, float weight) = 0;
00293 
00301   virtual bool AddAnimCycle(const char *name, float weight, float delay) = 0;
00302 
00306   virtual bool AddAnimCycle(int idx, float weight, float delay) = 0;
00307 
00312   virtual bool ClearAnimCycle(const char *name, float delay) = 0;
00313 
00319   virtual int  GetActiveAnimCount() = 0;
00320 
00327   virtual int  GetActiveAnims(char *buffer,int max_length) = 0;
00328 
00333   virtual void SetActiveAnims(const char *buffer,int anim_count) = 0;
00334 
00341   virtual bool SetAnimAction(const char *name, float delayIn, float delayOut) = 0;
00342 
00349   virtual bool SetVelocity(float vel,csRandomGen *rng=0) = 0;
00350 
00355   virtual void SetLOD(float lod) = 0;
00356 
00361   virtual bool AttachCoreMesh(const char *meshname) = 0;
00362 
00370   virtual bool AttachCoreMesh(int mesh_id,int iMatWrap) = 0;
00371 
00376   virtual bool DetachCoreMesh(const char *meshname) = 0;
00377 
00384   virtual bool DetachCoreMesh(int mesh_id) = 0;
00385 
00395   virtual bool BlendMorphTarget(int morph_animation_id, float weight, float delay) = 0;
00396 
00405   virtual bool ClearMorphTarget(int morph_animation_id, float delay) = 0;
00406 
00408   virtual iSpriteCal3DSocket* FindSocket (iMeshWrapper *mesh) const = 0;
00409 
00411   virtual iSpriteCal3DSocket* FindSocket (const char * name) const = 0;
00412 
00414   virtual bool SetMaterial(const char *mesh_name,iMaterialWrapper *mat) = 0;
00415 
00417   virtual void SetTimeFactor(float timeFactor) = 0;
00418 
00420   virtual float GetTimeFactor() = 0;
00421 };
00422 
00423 #endif// __CS_IMESH_SPRITECAL3D_H__

Generated for Crystal Space by doxygen 1.2.18