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;
00266   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00267   virtual void SetLightingQuality (int qual) = 0;
00272   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00273   virtual int GetLightingQuality () const = 0;
00283   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00284   virtual void SetLightingQualityConfig (int qual) = 0;
00289   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00290   virtual int GetLightingQualityConfig () const = 0;
00291 
00300   virtual void SetLodLevelConfig (int config_flag) = 0;
00301 
00303   virtual int GetLodLevelConfig () const = 0;
00304 
00310   virtual void MergeNormals (int base, int frame) = 0;
00311 
00317   virtual void MergeNormals (int base) = 0;
00318 
00324   virtual void MergeNormals () = 0;
00325 };
00326 
00331 struct iSprite3DState : public virtual iBase
00332 {
00333   SCF_INTERFACE (iSprite3DState, 1, 0, 0);
00334 
00336   virtual void SetMixMode (uint mode) = 0;
00338   virtual uint GetMixMode () const = 0;
00340   virtual void SetLighting (bool l) = 0;
00342   virtual bool IsLighting () const = 0;
00343 
00345   virtual void SetFrame (int f) = 0;
00346 
00348   virtual int GetCurFrame () const = 0;
00349 
00351   virtual int GetFrameCount () const = 0;
00352 
00357   virtual bool SetAction (const char * name,
00358         bool loop = true, float speed = 1) = 0;
00359 
00364   virtual bool SetAction (int index,
00365         bool loop = true, float speed = 1) = 0;
00366 
00368   virtual void SetReverseAction(bool reverse) = 0;
00369 
00371   virtual void SetSingleStepAction(bool singlestep) = 0;
00372 
00377   virtual bool SetOverrideAction(const char *name,
00378         float speed = 1) = 0;
00379 
00384   virtual bool SetOverrideAction(int index,
00385         float speed = 1) = 0;
00386 
00388   virtual bool PropagateAction (const char *name) = 0;
00389 
00391   virtual iSpriteAction* GetCurAction () const = 0;
00392 
00394   virtual bool GetReverseAction () const = 0;
00395 
00397   virtual void EnableTweening (bool en) = 0;
00399   virtual bool IsTweeningEnabled () const = 0;
00400 
00402   virtual void UnsetTexture () = 0;
00403 
00409   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00410   virtual int GetLightingQuality () = 0;
00411 
00416   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00417   virtual void SetLocalLightingQuality (int lighting_quality) = 0;
00418 
00426   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00427   virtual void SetLightingQualityConfig (int config_flag) = 0;
00428 
00432   CS_DEPRECATED_METHOD_MSG("Deprecated by change to shader-based lighting.")
00433   virtual int GetLightingQualityConfig () const = 0;
00434 
00442   virtual void SetLodLevelConfig (int config_flag) = 0;
00443 
00447   virtual int GetLodLevelConfig () const = 0;
00448 
00452   virtual bool IsLodEnabled () const = 0;
00453 
00455   virtual iSpriteSocket* FindSocket (iMeshWrapper *mesh) const = 0;  
00456 
00458   virtual iSpriteSocket* FindSocket (const char * name) const = 0;
00459 };
00460 
00463 #endif // __CS_IMESH_SPRITE3D_H__
00464 

Generated for Crystal Space 2.0 by doxygen 1.7.6.1