14#ifndef OBJTOEGGCONVERTER_H
15#define OBJTOEGGCONVERTER_H
33class ObjToEggConverter :
public SomethingToEggConverter {
36 ObjToEggConverter(
const ObjToEggConverter ©);
39 virtual SomethingToEggConverter *
make_copy();
41 virtual std::string
get_name()
const;
50 bool process(
const Filename &filename);
51 bool process_line(
const std::string &line);
52 bool process_ref_plane_res(
const std::string &line);
54 bool process_v(vector_string &words);
55 bool process_vt(vector_string &words);
56 bool process_xvt(vector_string &words);
57 bool process_xvc(vector_string &words);
58 bool process_vn(vector_string &words);
59 bool process_f(vector_string &words);
60 bool process_g(vector_string &words);
62 EggVertex *get_face_vertex(
const std::string &face_reference);
63 void generate_egg_points();
65 bool process_node(
const Filename &filename);
66 bool process_line_node(
const std::string &line);
68 bool process_f_node(vector_string &words);
69 bool process_g_node(vector_string &words);
71 void generate_points();
72 int add_synth_normal(
const LVecBase3d &normal);
76 typedef epvector<LVecBase4d> Vec4Table;
77 typedef epvector<LVecBase3d> Vec3Table;
78 typedef epvector<LVecBase2d> Vec2Table;
79 typedef pmap<LVecBase3d, int> UniqueVec3Table;
82 Vec3Table _vn_table, _rgb_table;
85 Vec3Table _synth_vn_table;
86 UniqueVec3Table _unique_synth_vn_table;
87 LVecBase2d _ref_plane_res;
88 bool _v4_given, _vt3_given;
91 pset<std::string> _ignored_tags;
104 VertexEntry(
const ObjToEggConverter *converter,
const std::string &obj_vertex);
106 INLINE
bool operator < (
const VertexEntry &other)
const;
107 INLINE
bool operator == (
const VertexEntry &other)
const;
108 INLINE
bool matches_except_normal(
const VertexEntry &other)
const;
117 typedef pmap<VertexEntry, int> UniqueVertexEntries;
118 typedef pvector<VertexEntry> VertexEntries;
122 VertexData(
PandaNode *parent,
const std::string &name);
124 int add_vertex(
const ObjToEggConverter *converter,
const VertexEntry &entry);
125 void add_triangle(
const ObjToEggConverter *converter,
const VertexEntry &v0,
126 const VertexEntry &v1,
const VertexEntry &v2,
128 void close_geom(
const ObjToEggConverter *converter);
135 VertexEntries _entries;
136 UniqueVertexEntries _unique_entries;
138 bool _v4_given, _vt3_given;
139 bool _vt_given, _rgb_given, _vn_given;
142 VertexData *_current_vertex_data;
144 friend class VertexData;
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
A collection of vertices.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
The name of a file, such as a texture file or an Egg file.
A node that holds Geom objects, renderable pieces of geometry.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
Specifies parameters that may be passed to the loader.
virtual bool supports_convert_to_node(const LoaderOptions &options) const
Returns true if this converter can directly convert the model type to internal Panda memory structure...
virtual bool convert_file(const Filename &filename)
Handles the reading of the input file and converting it to egg.
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz extension),...
virtual std::string get_name() const
Returns the English name of the file type this converter supports.
virtual std::string get_extension() const
Returns the common extension of the file type this converter supports.
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.