00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __AELIB_AEGEOM_OBJECT_H__
00023 #define __AELIB_AEGEOM_OBJECT_H__
00024
00025 #define ONLY_INCLUDE_STD
00026 #include <aedefs.h>
00027 #undef ONLY_INCLUDE_STD
00028 #include <aeengine/eflags.h>
00029 #include <aegeom/vector3.h>
00030 #include <aegfx/color3.h>
00031 #include <aegfx/color4.h>
00032 #include <aegfx/material.h>
00033 #include <aegfx/texcoord2.h>
00034 #include <aereg/base.h>
00035
00044 enum aeObjRenderingMode {
00046
00052 TRIANGLES_NORMAL,
00054
00061 TRIANGLES_STRIP,
00063
00070 TRIANGLES_FAN,
00071
00073
00079 QUADS_NORMAL,
00081
00090 QUADS_STRIP,
00091
00093
00098 LINES_NORMAL,
00100
00105 LINES_STRIP,
00107
00113 LINES_LOOP,
00114
00116
00119 POLYGON_NORMAL
00120 };
00121
00127 class aeObject: public aeBase {
00128 protected:
00129 aeVector3_vector *vertexList;
00130 aeColor4_vector *vertexColorList;
00131 aeTexCoord2_vector *vertexTexcoordList;
00132 aeVector3 origin;
00133 aeColor4 currentVertexColor;
00134 aeTexCoord2 currentVertexTexcoord;
00135 bool hasMaterial;
00136 aeMaterial *material;
00137 char *objName;
00138 bool isObjTransparent;
00139 float objRadius;
00140 aeObjRenderingMode objRenderMode;
00141
00142 public:
00143 virtual ~aeObject();
00144
00151 virtual char *getName();
00152
00159 virtual aeMaterial *getMaterial();
00160
00166 virtual void draw(aeEngineflags *) = 0;
00167
00174 virtual aeVector3 getOrigin();
00175
00181 virtual void setOrigin(const aeVector3 &norigin);
00182
00191 virtual void setColor(float r, float g, float b);
00192
00202 virtual void setColor(float r, float g, float b, float a);
00203
00211 virtual void setColor(const aeColor3 &color);
00212
00220 virtual void setColor(const aeColor4 &color);
00221
00230 virtual void setTexCoord(const aeTexCoord2 &texcoord);
00231
00241 virtual void setTexCoord(float s, float t);
00242
00248 virtual void setMaterial(aeMaterial *mat);
00249
00256 virtual void addVertex(const aeVector3 &vertex);
00257
00263 virtual void setTransparent(bool);
00264
00271 virtual unsigned int getVertexCount();
00272
00280 virtual aeVector3 getVertex(int);
00281
00288 virtual float getBoundingSphereRadius();
00289
00296 virtual bool isTransparent();
00297
00319 virtual void setMode(aeObjRenderingMode mode);
00320 };
00321
00322 #endif // __AELIB_AEGEOM_OBJECT_H__