00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _Q3ENTITIES_H
00024 #define _Q3ENTITIES_H
00025
00026 #ifdef WIN32
00027 #include <windows.h>
00028 #endif
00029
00030 #include <vector>
00031 #include <string>
00032 #include "vector3d.h"
00033 #include "color.h"
00034
00035 namespace ngn {
00036 namespace core {
00037 namespace bsp {
00038
00039
00040
00041 struct entry_point
00042 {
00043 Vector3df pos;
00044 double angle;
00045 };
00046
00047 struct q3_light
00048 {
00049 Vector3df pos;
00050 Colorf color;
00051 float intensity;
00052 };
00053
00054 struct ent_pair
00055 {
00056 std::string type ;
00057 std::string value ;
00058 };
00059 struct ent_block
00060 {
00061 std::vector<ent_pair> epairs;
00062 };
00063
00064
00065
00066 class Q3EntityParser
00067 {
00068 public:
00069
00070 Q3EntityParser();
00071
00072 virtual ~Q3EntityParser();
00073
00074 virtual void loadEntities( const char *entities );
00075
00076 std::vector<entry_point> getSpawnPoints();
00077
00078 protected:
00079
00080
00081 void loadSpawnPoints();
00082
00083 ent_pair extractDataFromLine( std::string line );
00084
00085 std::string m_entities;
00086 int m_nEntities;
00087 std::vector<ent_block> m_blocks;
00088 std::vector<entry_point> m_spawn_points;
00089
00090
00091
00092 };
00093
00094
00095
00096
00097 }
00098 }
00099 }
00100 #endif
00101