CrystalSpace

Public API Reference

imesh/sprite3d.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2000-2001 by Jorrit Tyberghein
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_SPRITE3D_H__
00020 #define __CS_IMESH_SPRITE3D_H__
00021 
00026 #include "csutil/scf.h"
00027 
00031 struct iMaterialWrapper;
00032 struct iMeshObject;
00033 struct iMeshObjectFactory;
00034 struct iMeshWrapper;
00035 struct iRenderView;
00036 
00037 class csColor;
00038 class csVector2;
00039 class csVector3;
00040 struct csTriangle;
00041 
00045 enum
00046 {
00047   CS_SPR_LIGHTING_HQ = 0,
00048   CS_SPR_LIGHTING_LQ = 1,
00049   CS_SPR_LIGHTING_FAST = 2,
00050   CS_SPR_LIGHTING_RANDOM = 3
00051 };
00052 
00057 #define CS_SPR_LIGHT_GLOBAL 0
00058 
00063 #define CS_SPR_LIGHT_TEMPLATE 1
00064 
00069 #define CS_SPR_LIGHT_LOCAL 2
00070 
00075 #define CS_SPR_LOD_GLOBAL 0
00076 
00080 #define CS_SPR_LOD_TEMPLATE 1
00081 
00085 #define CS_SPR_LOD_LOCAL 2
00086 
00090 struct iSpriteFrame : public virtual iBase
00091 {
00092   SCF_INTERFACE (iSpriteFrame, 1, 0, 0);
00093 
00095   virtual void SetName (char const*) = 0;
00097   virtual char const* GetName () const = 0;
00099   virtual int GetAnmIndex () const = 0;
00101   virtual int GetTexIndex () const = 0;
00102 };
00103 
00107 struct iSpriteAction : public virtual iBase
00108 {
00109   SCF_INTERFACE (iSpriteAction, 1, 0, 0);
00110 
00112   virtual void SetName (char const*) = 0;
00114   virtual char const* GetName () const = 0;
00116   virtual int GetFrameCount () = 0;
00118   virtual iSpriteFrame* GetFrame (int f) = 0;
00120   virtual iSpriteFrame* GetNextFrame (int f) = 0;
00122   virtual int GetFrameDelay (int f) = 0;
00124   virtual float GetFrameDisplacement (int f) = 0;
00126   virtual void AddFrame (iSpriteFrame* frame, int delay,
00127         float displacement) = 0;
00128 };
00129 
00134 struct iSpriteSocket : public virtual iBase
00135 {
00136   SCF_INTERFACE (iSpriteSocket, 1, 0, 0);
00137 
00139   virtual void SetName (char const*) = 0;
00141   virtual char const* GetName () const = 0;
00142   
00144   virtual void SetMeshWrapper (iMeshWrapper* mesh) = 0;
00146   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00147   
00149   virtual void SetTriangleIndex (int tri_index) = 0;
00151   virtual int GetTriangleIndex () const = 0;
00152 };
00153 
00159 struct iSprite3DFactoryState : public virtual iBase
00160 {
00161   SCF_INTERFACE (iSprite3DFactoryState, 1, 0, 0);
00162 
00171   virtual void AddVertices (int num) = 0;
00173   virtual int GetVertexCount () const = 0;
00174 
00176   virtual const csVector3& GetVertex (int frame, int vertex) const = 0;
00178   virtual void SetVertex (int frame, int vertex, const csVector3 &Value) = 0;
00180   virtual csVector3* GetVertices (int frame) const = 0;
00185   virtual void SetVertices (csVector3 const* vert, int frame) = 0;
00186 
00188   virtual const csVector2& GetTexel (int frame, int vertex) const = 0;
00190   virtual void SetTexel (int frame, int vertex, const csVector2 &Value) = 0;
00192   virtual csVector2* GetTexels (int frame) const = 0;
00197   virtual void SetTexels (csVector2 const* tex, int frame) = 0;
00198 
00200   virtual const csVector3& GetNormal (int frame, int vertex) const = 0;
00202   virtual void SetNormal (int frame, int vertex, const csVector3 &Value) = 0;
00204   virtual csVector3* GetNormals (int frame) const = 0;
00209   virtual void SetNormals (csVector3 const* norms, int frame) = 0;
00210 
00215   virtual void AddTriangle (int a, int b, int c) = 0;
00217   virtual csTriangle GetTriangle (int x) const = 0;
00219   virtual csTriangle* GetTriangles () const = 0;
00221   virtual int GetTriangleCount () const = 0;
00223   virtual void SetTriangleCount (int count) = 0;
00225   virtual void SetTriangles( csTriangle const* trigs, int count) = 0;
00226 
00228   virtual iSpriteFrame* AddFrame () = 0;
00230   virtual iSpriteFrame* FindFrame (const char* name) const = 0;
00232   virtual int GetFrameCount () const = 0;
00234   virtual iSpriteFrame* GetFrame (int f) const = 0;
00235 
00237   virtual iSpriteAction* AddAction () = 0;
00239   virtual iSpriteAction* FindAction (const char* name) const = 0;
00241   virtual iSpriteAction* GetFirstAction () const = 0;
00243   virtual int GetActionCount () const = 0;
00245   virtual iSpriteAction* GetAction (int No) const = 0;
00246 
00248   virtual iSpriteSocket* AddSocket () = 0;
00250   virtual iSpriteSocket* FindSocket (const char * name) const = 0;
00252   virtual iSpriteSocket* FindSocket (iMeshWrapper *mesh) const = 0;  
00254   virtual int GetSocketCount () const = 0;
00256   virtual iSpriteSocket* GetSocket (int f) const = 0;
00257 
00259   virtual void EnableTweening (bool en) = 0;
00261   virtual bool IsTweeningEnabled () const = 0;
00263   virtual void SetLightingQuality (int qual) = 0;
00265   virtual int GetLightingQuality () const = 0;
00274   virtual void SetLightingQualityConfig (int qual) = 0;
00276   virtual int GetLightingQualityConfig () const = 0;
00277 
00286   virtual void SetLodLevelConfig (int config_flag) = 0;
00287 
00289   virtual int GetLodLevelConfig () const = 0;
00290 
00296   virtual void MergeNormals (int base, int frame) = 0;
00297 
00303   virtual void MergeNormals (int base) = 0;
00304 
00310   virtual void MergeNormals () = 0;
00311 };
00312 
00317 struct iSprite3DState : public virtual iBase
00318 {
00319   SCF_INTERFACE (iSprite3DState, 1, 0, 0);
00320 
00322   virtual void SetMixMode (uint mode) = 0;
00324   virtual uint GetMixMode () const = 0;
00326   virtual void SetLighting (bool l) = 0;
00328   virtual bool IsLighting () const = 0;
00329 
00331   virtual void SetFrame (int f) = 0;
00332 
00334   virtual int GetCurFrame () const = 0;
00335 
00337   virtual int GetFrameCount () const = 0;
00338 
00343   virtual bool SetAction (const char * name,
00344         bool loop = true, float speed = 1) = 0;
00345 
00350   virtual bool SetAction (int index,
00351         bool loop = true, float speed = 1) = 0;
00352 
00354   virtual void SetReverseAction(bool reverse) = 0;
00355 
00357   virtual void SetSingleStepAction(bool singlestep) = 0;
00358 
00363   virtual bool SetOverrideAction(const char *name,
00364         float speed = 1) = 0;
00365 
00370   virtual bool SetOverrideAction(int index,
00371         float speed = 1) = 0;
00372 
00374   virtual bool PropagateAction (const char *name) = 0;
00375 
00377   virtual iSpriteAction* GetCurAction () const = 0;
00378 
00380   virtual bool GetReverseAction () const = 0;
00381 
00383   virtual void EnableTweening (bool en) = 0;
00385   virtual bool IsTweeningEnabled () const = 0;
00386 
00388   virtual void UnsetTexture () = 0;
00389 
00395   virtual int GetLightingQuality () = 0;
00396 
00401   virtual void SetLocalLightingQuality (int lighting_quality) = 0;
00402 
00410   virtual void SetLightingQualityConfig (int config_flag) = 0;
00411 
00415   virtual int GetLightingQualityConfig () const = 0;
00416 
00424   virtual void SetLodLevelConfig (int config_flag) = 0;
00425 
00429   virtual int GetLodLevelConfig () const = 0;
00430 
00434   virtual bool IsLodEnabled () const = 0;
00435 
00437   virtual iSpriteSocket* FindSocket (iMeshWrapper *mesh) const = 0;  
00438 
00440   virtual iSpriteSocket* FindSocket (const char * name) const = 0;
00441 };
00442 
00445 #endif // __CS_IMESH_SPRITE3D_H__
00446 

Generated for Crystal Space 1.2.1 by doxygen 1.5.3