00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BAMTOEGG_H
00020 #define BAMTOEGG_H
00021
00022 #include "pandatoolbase.h"
00023
00024 #include "somethingToEgg.h"
00025 #include "luse.h"
00026 #include "eggTextureCollection.h"
00027 #include "eggMaterialCollection.h"
00028
00029 class WorkingNodePath;
00030 class EggGroup;
00031 class EggGroupNode;
00032 class EggVertexPool;
00033 class EggTexture;
00034 class LODNode;
00035 class GeomNode;
00036 class GeomTri;
00037 class PandaNode;
00038 class RenderState;
00039 class Texture;
00040
00041
00042
00043
00044
00045
00046
00047 class BamToEgg : public SomethingToEgg {
00048 public:
00049 BamToEgg();
00050
00051 void run();
00052
00053 private:
00054 void convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent,
00055 bool has_decal);
00056 void convert_lod_node(LODNode *node, const WorkingNodePath &node_path,
00057 EggGroupNode *egg_parent, bool has_decal);
00058 void convert_geom_node(GeomNode *node, const WorkingNodePath &node_path,
00059 EggGroupNode *egg_parent, bool has_decal);
00060 void convert_geom_tri(GeomTri *geom, const RenderState *net_state,
00061 const LMatrix4f &net_mat, EggGroupNode *egg_parent);
00062 void recurse_nodes(const WorkingNodePath &node_path, EggGroupNode *egg_parent,
00063 bool has_decal);
00064 bool apply_node_properties(EggGroup *egg_group, PandaNode *node);
00065
00066 EggTexture *get_egg_texture(Texture *tex);
00067
00068 EggVertexPool *_vpool;
00069 EggTextureCollection _textures;
00070 EggMaterialCollection _materials;
00071 };
00072
00073 #endif