Panda3D
|
00001 // Filename: eggToFlt.h 00002 // Created by: drose (01Oct03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef EGGTOFLT_H 00016 #define EGGTOFLT_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "eggToSomething.h" 00021 #include "fltHeader.h" 00022 #include "fltGeometry.h" 00023 #include "pointerTo.h" 00024 #include "pmap.h" 00025 #include "vector_string.h" 00026 00027 class EggGroup; 00028 class EggVertex; 00029 class EggPrimitive; 00030 class EggTexture; 00031 class EggTransform; 00032 class FltVertex; 00033 class FltBead; 00034 class FltTexture; 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Class : EggToFlt 00038 // Description : A program to read an egg file and write a flt file. 00039 //////////////////////////////////////////////////////////////////// 00040 class EggToFlt : public EggToSomething { 00041 public: 00042 EggToFlt(); 00043 00044 void run(); 00045 00046 private: 00047 static bool dispatch_attr(const string &opt, const string &arg, void *var); 00048 00049 void traverse(EggNode *egg_node, FltBead *flt_node, 00050 FltGeometry::BillboardType billboard); 00051 void convert_primitive(EggPrimitive *egg_primitive, FltBead *flt_node, 00052 FltGeometry::BillboardType billboard); 00053 void convert_group(EggGroup *egg_group, FltBead *flt_node, 00054 FltGeometry::BillboardType billboard); 00055 void apply_transform(EggTransform *egg_transform, FltBead *flt_node); 00056 void apply_egg_syntax(const string &egg_syntax, FltRecord *flt_record); 00057 FltVertex *get_flt_vertex(EggVertex *egg_vertex, EggNode *context); 00058 FltTexture *get_flt_texture(EggTexture *egg_texture); 00059 00060 FltHeader::AttrUpdate _auto_attr_update; 00061 00062 PT(FltHeader) _flt_header; 00063 00064 typedef pmap<EggVertex *, FltVertex *> VertexMap; 00065 typedef pmap<const LMatrix4d *, VertexMap> VertexMapPerFrame; 00066 VertexMapPerFrame _vertex_map_per_frame; 00067 00068 typedef pmap<Filename, FltTexture *> TextureMap; 00069 TextureMap _texture_map; 00070 }; 00071 00072 #endif 00073