00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_GFX_PRIM_HH
00020 #define OST_GFX_PRIM_HH
00021
00022
00023
00024
00025
00026 #include <vector>
00027
00028 #include <ost/geom/geom.hh>
00029
00030 #include "color.hh"
00031
00032 namespace ost { namespace gfx {
00033
00034 struct SpherePrim {
00035 SpherePrim():
00036 position(),radius(1.0),color()
00037 {}
00038 SpherePrim(const geom::Vec3& pos, float rad, const Color& col):
00039 position(pos), radius(rad), color(col)
00040 {}
00041
00042 geom::Vec3 position;
00043 float radius;
00044 Color color;
00045 };
00046
00047 typedef std::vector<SpherePrim> SpherePrimList;
00048
00049 struct CylinderPrim {
00050 CylinderPrim():
00051 start(),end(),radius(1.0),color(),length(1.0),rotmat(),rotmat_t()
00052 {
00053 calc_rotmat();
00054 }
00055
00056 CylinderPrim(const geom::Vec3& st, const geom::Vec3& en, float rad, const Color& col):
00057 start(st),end(en),radius(rad),color(col),length(geom::Length(end-start)),rotmat(),rotmat_t()
00058 {
00059 calc_rotmat();
00060 }
00061
00062 void calc_rotmat();
00063
00064 geom::Vec3 start,end;
00065 float radius;
00066 Color color;
00067 float length;
00068 geom::Mat3 rotmat;
00069 geom::Mat3 rotmat_t;
00070 };
00071
00072 typedef std::vector<CylinderPrim> CylinderPrimList;
00073
00074
00075 struct TextPrim {
00076 TextPrim(): str(""), position(),color(),points(1.0) {}
00077 TextPrim(const String& s, const geom::Vec3& p, const Color& c, float ps):
00078 str(s), position(p), color(c), points(ps) {}
00079 String str;
00080 geom::Vec3 position;
00081 Color color;
00082 float points;
00083 };
00084
00085 typedef std::vector<TextPrim> TextPrimList;
00086
00087
00088 }}
00089
00090 #endif