Panda3D
eggToFlt.h
1 // Filename: eggToFlt.h
2 // Created by: drose (01Oct03)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef EGGTOFLT_H
16 #define EGGTOFLT_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "eggToSomething.h"
21 #include "fltHeader.h"
22 #include "fltGeometry.h"
23 #include "pointerTo.h"
24 #include "pmap.h"
25 #include "vector_string.h"
26 
27 class EggGroup;
28 class EggVertex;
29 class EggPrimitive;
30 class EggTexture;
31 class EggTransform;
32 class FltVertex;
33 class FltBead;
34 class FltTexture;
35 
36 ////////////////////////////////////////////////////////////////////
37 // Class : EggToFlt
38 // Description : A program to read an egg file and write a flt file.
39 ////////////////////////////////////////////////////////////////////
40 class EggToFlt : public EggToSomething {
41 public:
42  EggToFlt();
43 
44  void run();
45 
46 private:
47  static bool dispatch_attr(const string &opt, const string &arg, void *var);
48 
49  void traverse(EggNode *egg_node, FltBead *flt_node,
50  FltGeometry::BillboardType billboard);
51  void convert_primitive(EggPrimitive *egg_primitive, FltBead *flt_node,
52  FltGeometry::BillboardType billboard);
53  void convert_group(EggGroup *egg_group, FltBead *flt_node,
54  FltGeometry::BillboardType billboard);
55  void apply_transform(EggTransform *egg_transform, FltBead *flt_node);
56  void apply_egg_syntax(const string &egg_syntax, FltRecord *flt_record);
57  FltVertex *get_flt_vertex(EggVertex *egg_vertex, EggNode *context);
58  FltTexture *get_flt_texture(EggTexture *egg_texture);
59 
60  FltHeader::AttrUpdate _auto_attr_update;
61 
62  PT(FltHeader) _flt_header;
63 
66  VertexMapPerFrame _vertex_map_per_frame;
67 
69  TextureMap _texture_map;
70 };
71 
72 #endif
73 
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
Definition: eggPrimitive.h:51
This is our own Panda specialization on the default STL map.
Definition: pmap.h:52
Defines a texture map that may be applied to geometry.
Definition: eggTexture.h:33
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
Definition: fltBead.h:33
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:48
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:36
Represents a single texture in the texture palette.
Definition: fltTexture.h:29
A program to read an egg file and write a flt file.
Definition: eggToFlt.h:40
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal...
Definition: eggVertex.h:41
The base class for all kinds of records in a MultiGen OpenFlight file.
Definition: fltRecord.h:40
Represents a single vertex in the vertex palette.
Definition: fltVertex.h:35
This is the general base class for a file-converter program that reads some model file format and gen...
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:38
This represents the <Transform> entry of a group or texture node: a list of component transform opera...
Definition: eggTransform.h:33