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 class CalModel;
00038 class CalCoreModel;
00039 
00040 SCF_VERSION (iSpriteCal3DSocket, 0, 0, 1);
00041 
00046 struct iSpriteCal3DSocket : public iBase
00047 {
00049   virtual void SetName (char const*) = 0;
00051   virtual char const* GetName () const = 0;
00052 
00054   virtual void SetMeshWrapper (iMeshWrapper* mesh) = 0;
00056   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00057 
00059   virtual void SetTriangleIndex (int tri_index) = 0;
00061   virtual int GetTriangleIndex () const = 0;
00062 
00064   virtual void SetSubmeshIndex (int subm_index) = 0;
00066   virtual int GetSubmeshIndex () const = 0;
00067 
00069   virtual void SetMeshIndex (int m_index) = 0;
00071   virtual int GetMeshIndex () const = 0;
00072 };
00073 
00074 
00075 
00076 SCF_VERSION (iSpriteCal3DFactoryState, 0, 0, 3);
00077 
00081 struct iSpriteCal3DFactoryState : public iBase
00082 {
00084   virtual bool Create(const char *name) = 0;
00085 
00091   virtual void ReportLastError () = 0;
00092 
00097   virtual void SetLoadFlags(int flags) = 0;
00098 
00103   virtual void SetBasePath(const char *path) = 0;
00104 
00108   virtual bool LoadCoreSkeleton(iVFS *vfs,const char *filename) = 0;
00109 
00114   virtual void RescaleFactory(float factor) = 0;
00115 
00146   virtual int  LoadCoreAnimation(iVFS *vfs,const char *filename,
00147                                  const char *name,
00148                                  int type,
00149                                  float base_velocity,
00150                                  float min_velocity,
00151                                  float max_velocity,
00152                  int min_interval,
00153                  int max_interval,
00154                  int idle_pct,
00155                  bool lock) = 0;
00156 
00168   virtual int LoadCoreMesh(iVFS *vfs,const char *filename,
00169         const char *name,bool attach,iMaterialWrapper *defmat) = 0;
00170 
00181   virtual int LoadCoreMorphTarget(iVFS *vfs,int mesh_index,
00182         const char *filename, const char *name) = 0;
00183 
00191   virtual int AddMorphAnimation(const char *name) = 0;
00192   
00202   virtual bool AddMorphTarget(int morphanimation_index,
00203                               const char *mesh_name,
00204                               const char *morphtarget_name) = 0;
00205   
00210   virtual bool AddCoreMaterial(iMaterialWrapper *mat) = 0;
00211 
00216   virtual void BindMaterials() = 0;
00217 
00222   virtual int  GetMeshCount() = 0;
00223 
00227   virtual int GetMorphAnimationCount() = 0;
00228   
00237   virtual int GetMorphTargetCount(int mesh_id) = 0;
00238 
00242   virtual const char *GetMeshName(int idx) = 0;
00243 
00247   virtual int  FindMeshName(const char *meshName) = 0;
00248 
00252   virtual const char* GetDefaultMaterial( const char* meshName ) = 0;
00253   
00254   
00259   virtual const char *GetMorphAnimationName(int idx) = 0;
00260 
00265   virtual int  FindMorphAnimationName(const char *meshName) = 0;
00266 
00270   virtual bool IsMeshDefault(int idx) = 0;
00271 
00273   virtual iSpriteCal3DSocket* AddSocket () = 0;
00275   virtual iSpriteCal3DSocket* FindSocket (const char * name) const = 0;
00277   virtual iSpriteCal3DSocket* FindSocket (iMeshWrapper *mesh) const = 0;
00279   virtual int GetSocketCount () const = 0;
00281   virtual iSpriteCal3DSocket* GetSocket (int f) const = 0;
00287   virtual CalCoreModel *GetCal3DCoreModel() = 0;
00288 };
00289 
00290 SCF_VERSION (iSpriteCal3DState, 0, 0, 2);
00291 
00296 struct iSpriteCal3DState : public iBase
00297 {
00299   enum
00300   {
00301     C3D_ANIM_TYPE_NONE,
00302     C3D_ANIM_TYPE_IDLE,
00303     C3D_ANIM_TYPE_TRAVEL,
00304     C3D_ANIM_TYPE_CYCLE,
00305     C3D_ANIM_TYPE_STYLE_CYCLE,
00306     C3D_ANIM_TYPE_ACTION
00307   };
00308 
00310   virtual int GetAnimCount() = 0;
00311 
00316   virtual const char *GetAnimName(int idx) = 0;
00317 
00319   virtual int  GetAnimType(int idx) = 0;
00320 
00322   virtual void ClearAllAnims() = 0;
00323 
00328   virtual bool SetAnimCycle(const char *name, float weight) = 0;
00329 
00334   virtual bool SetAnimCycle(int idx, float weight) = 0;
00335 
00344   virtual bool AddAnimCycle(const char *name, float weight, float delay) = 0;
00345 
00349   virtual bool AddAnimCycle(int idx, float weight, float delay) = 0;
00350 
00355   virtual bool ClearAnimCycle(const char *name, float delay) = 0;
00356 
00362   virtual int  GetActiveAnimCount() = 0;
00363 
00370   virtual int  GetActiveAnims(char *buffer,int max_length) = 0;
00371 
00376   virtual void SetActiveAnims(const char *buffer,int anim_count) = 0;
00377 
00384   virtual bool SetAnimAction(const char *name, float delayIn,
00385                              float delayOut) = 0;
00386 
00393   virtual bool SetAnimAction(int idx, float delayIn,
00394                              float delayOut) = 0;
00395 
00402   virtual bool SetVelocity(float vel,csRandomGen *rng=0) = 0;
00403 
00407   virtual void SetDefaultIdleAnim(const char *name) = 0;
00408 
00413   virtual void SetLOD(float lod) = 0;
00414 
00419   virtual bool AttachCoreMesh(const char *meshname) = 0;
00420 
00428   virtual bool AttachCoreMesh(int mesh_id,int iMatWrap) = 0;
00429 
00434   virtual bool DetachCoreMesh(const char *meshname) = 0;
00435 
00442   virtual bool DetachCoreMesh(int mesh_id) = 0;
00443 
00453   virtual bool BlendMorphTarget(int morph_animation_id, float weight,
00454         float delay) = 0;
00455 
00464   virtual bool ClearMorphTarget(int morph_animation_id, float delay) = 0;
00465 
00467   virtual iSpriteCal3DSocket* FindSocket (iMeshWrapper *mesh) const = 0;
00468 
00470   virtual iSpriteCal3DSocket* FindSocket (const char* name) const = 0;
00471 
00473   virtual bool SetMaterial(const char *mesh_name,iMaterialWrapper *mat) = 0;
00474 
00476   virtual void SetTimeFactor(float timeFactor) = 0;
00477 
00479   virtual float GetTimeFactor() = 0;
00480 
00482   virtual float GetAnimationTime() = 0;
00483 
00485   virtual float GetAnimationDuration() = 0;
00486 
00488   virtual void SetAnimationTime(float animationTime) = 0;
00489 
00495   virtual CalModel *GetCal3DModel() = 0;
00496 };
00497 
00498 #endif// __CS_IMESH_SPRITECAL3D_H__

Generated for Crystal Space by doxygen 1.2.18