CrystalSpace

Public API Reference

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

imesh/thing/polygon.h

00001 /*
00002     Copyright (C) 1998-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_THING_POLYGON_H__
00020 #define __CS_THING_POLYGON_H__
00021 
00022 #include "csutil/scf.h"
00023 #include "csgeom/plane3.h"
00024 #include "csgeom/vector3.h"
00025 #include "csgeom/matrix3.h"
00026 
00027 struct iMaterialHandle;
00028 struct csPolyTextureMapping;
00029 
00030 class csVector3;
00031 class csMatrix3;
00032 
00037 struct csPolyTextureMapping
00038 {
00039   csPolyTextureMapping() : fdu(0.0f), fdv(0.0f), Imin_u(0), Imin_v(0),
00040     Fmin_u(0.0f), Fmin_v(0.0f), Fmax_u(0.0f), Fmax_v(0.0f), shf_u(0),
00041     w(0), h(0), w_orig(0), 
00042     lmu1(0.0f), lmv1(0.0f), lmu2(0.0f), lmv2(0.0f)
00043   {
00044   }
00045 
00047   csMatrix3 m_obj2tex;
00049   csVector3 v_obj2tex;
00050 
00051   float fdu, fdv;
00052 
00058   int Imin_u, Imin_v;
00059 
00061   float Fmin_u, Fmin_v, Fmax_u, Fmax_v;
00062 
00064   uint16 shf_u;
00065 
00071   int GetShiftU () const { return shf_u; }
00072 
00074   int GetIMinU () const { return Imin_u; }
00076   int GetIMinV () const { return Imin_v; }
00078   void GetTextureBox (float& fMinU, float& fMinV,
00079     float& fMaxU, float& fMaxV) const
00080   {
00081     fMinU = Fmin_u;
00082     fMaxU = Fmax_u;
00083     fMinV = Fmin_v;
00084     fMaxV = Fmax_v;
00085   }
00086 
00088   float GetFDU () const { return fdu; }
00090   float GetFDV () const { return fdv; }
00091 
00093   int w; //@@@ renderer specific
00094 
00096   int h; //@@@ renderer specific 
00097 
00099   int w_orig;  //@@@ renderer specific
00100 
00102   int GetWidth () const { return w; }
00104   int GetHeight () const { return h; }
00105 
00107   int GetOriginalWidth () const { return w_orig; }
00108 
00112   float lmu1, lmv1, lmu2, lmv2;
00113 };
00114 
00115 #endif // __CS_THING_POLYGON_H__

Generated for Crystal Space by doxygen 1.2.18