00001
00002
00003 #ifndef __TEXTURE_H
00004 #define __TEXTURE_H
00005
00006 #include <vecmath/Color3f.h>
00007 #include <esg/Definitions.h>
00008 #include <esg/ESGObject.h>
00009
00010 namespace esg {
00011
00012 class OGSCENE_EXPORT Texture : public ESGObject {
00013 public:
00014 enum Mapping {
00015 UV_MAPPING = (1<<0),
00016 XYZ_MAPPING = (1<<1)
00017 };
00018
00019 protected:
00020 Mapping _mapping;
00021
00022 public:
00023 Texture(Mapping m) : _mapping(m) {}
00024 virtual ~Texture () {}
00025
00026 virtual bool mapUV (float u, float v, Color3f& c) const = 0;
00027 virtual bool mapXYZ (float x, float y, float z, Color3f& c) const = 0;
00028
00029 Mapping mapping (void) const { return _mapping; }
00030
00031 bool mapUV (const Vector2& uv, Color3f& c) const
00032 {
00033 return mapUV(uv.x, uv.y, c);
00034 }
00035
00036 bool mapXYZ (const Vector3& v, Color3f& c) const
00037 {
00038 return mapXYZ(v.x, v.y, v.z, c);
00039 }
00040 };
00041
00042 };
00043
00044 #endif // __TEXTURE_H