00001 #ifndef __MATH_GEO_POLYHEDRON_H__ 00002 #define __MATH_GEO_POLYHEDRON_H__ 00003 00004 #include <math/vec3.hpp> 00005 00006 namespace math { 00007 namespace geo { 00008 class vertex { 00009 public: 00010 vec3<double> xyz; 00011 vec3<double> n; 00012 }; 00013 class polygon 00014 { 00015 00016 }; 00017 class tri 00018 { 00019 public: 00020 void reset_normals(); 00021 00022 vertex v_[3]; 00023 }; 00024 class quad 00025 { 00026 public: 00027 void reset_normals(); 00028 00029 vertex v_[4]; 00030 }; 00031 class polyhedron 00032 { 00033 public: 00034 enum 00035 { 00036 PER_FACE_NORMAL 00037 }; 00038 00039 vertex* vertices_; 00040 tri* tris_; 00041 quad* quads_; 00042 int nt_; 00043 int nq_; 00044 unsigned int flag_; 00045 }; 00046 class polyhedron_convex: public polyhedron 00047 { 00048 }; 00049 class sphere: public polyhedron_convex 00050 { 00051 public: 00052 sphere(float,int,int); 00053 }; 00054 class wedge: public polyhedron_convex 00055 { 00056 00057 }; 00058 class tetrahedron: public polyhedron_convex 00059 { 00060 00061 }; 00062 class cuboid: public polyhedron_convex 00063 { 00064 public: 00065 cuboid(float,float,float); 00066 }; 00067 } 00068 } 00069 00070 #endif 00071 00072
1.6.1