67class EXPCL_PANDA_EGG2PG EggLoader {
77 const LMatrix4d *transform,
bool is_dynamic,
91 typedef pvector<const TextureDef *> TexMatTextures;
92 typedef pmap<LMatrix3d, TexMatTextures> TexMatTransforms;
93 typedef pmap<CPT(
InternalName), TexMatTransforms> TexMats;
99 class PrimitiveUnifier {
102 INLINE
bool operator < (
const PrimitiveUnifier &other)
const;
105 GeomPrimitive::ShadeModel _shade_model;
107 typedef pmap<PrimitiveUnifier, PT(
GeomPrimitive) > UniquePrimitives;
112 void make_nurbs_curve(
EggNurbsCurve *egg_curve, PandaNode *parent,
113 const LMatrix4d &mat);
114 void make_old_nurbs_curve(
EggNurbsCurve *egg_curve, PandaNode *parent,
115 const LMatrix4d &mat);
116 void make_nurbs_surface(
EggNurbsSurface *egg_surface, PandaNode *parent,
117 const LMatrix4d &mat);
119 void load_textures();
120 bool load_texture(TextureDef &def,
EggTexture *egg_tex);
122 Texture::CompressionMode convert_compression_mode(EggTexture::CompressionMode compression_mode)
const;
123 SamplerState::WrapMode convert_wrap_mode(EggTexture::WrapMode wrap_mode)
const;
126 void separate_switches(
EggNode *egg_node);
127 void emulate_bface(
EggNode *egg_node);
129 PandaNode *make_node(
EggNode *egg_node, PandaNode *parent);
130 PandaNode *make_node(
EggBin *egg_bin, PandaNode *parent);
132 PandaNode *make_lod(
EggBin *egg_bin, PandaNode *parent);
133 PandaNode *make_node(
EggGroup *egg_group, PandaNode *parent);
134 PandaNode *create_group_arc(
EggGroup *egg_group, PandaNode *parent,
136 PandaNode *make_node(
EggTable *egg_table, PandaNode *parent);
137 PandaNode *make_node(
EggGroupNode *egg_group, PandaNode *parent);
139 void check_for_polysets(
EggGroup *egg_group,
bool &all_polysets,
142 (
const EggRenderState *render_state,
EggVertexPool *vertex_pool,
144 bool is_dynamic,
CharacterMaker *character_maker,
bool ignore_color);
153 void make_primitive(
const EggRenderState *render_state,
155 UniquePrimitives &unique_primitives,
156 Primitives &primitives,
157 bool has_overall_color,
const LColor &overall_color);
163 bool make_sphere(
EggGroup *start_group, EggGroup::CollideFlags flags,
164 LPoint3 ¢er, PN_stdfloat &radius, LColor &color);
166 bool make_box(
EggGroup *start_group, EggGroup::CollideFlags flags,
167 const LMatrix4 &xform, LPoint3 &min_p, LPoint3 &max_p);
168 bool make_box(
EggGroup *start_group, EggGroup::CollideFlags flags,
169 LPoint3 &min_p, LPoint3 &max_p, LColor &color);
174 EggGroup::CollideFlags flags);
176 EggGroup::CollideFlags flags);
178 EggGroup::CollideFlags flags);
180 EggGroup::CollideFlags flags);
182 EggGroup::CollideFlags flags);
184 EggGroup::CollideFlags flags);
186 EggGroup::CollideFlags flags);
188 EggGroup::CollideFlags flags);
190 EggGroup::CollideFlags flags);
192 EggGroup::CollideFlags flags);
197 EggGroup::CollideFlags flags);
201 EggGroup::CollideFlags flags);
204 bool expand_all_object_types(
EggNode *egg_node);
205 bool expand_object_types(
EggGroup *egg_group,
const pset<std::string> &expanded,
206 const pvector<std::string> &expanded_history);
207 bool do_expand_object_type(
EggGroup *egg_group,
const pset<std::string> &expanded,
208 const pvector<std::string> &expanded_history,
209 const std::string &object_type);
211 static TextureStage::CombineMode
213 EggTexture::CombineChannel channel);
215 static TextureStage::CombineSource
217 EggTexture::CombineChannel channel,
int n);
219 static TextureStage::CombineOperand
220 get_combine_operand(
const EggTexture *egg_tex,
221 EggTexture::CombineChannel channel,
int n);
223 static ColorBlendAttrib::Mode
224 get_color_blend_mode(EggGroup::BlendMode mode);
226 static ColorBlendAttrib::Operand
227 get_color_blend_operand(EggGroup::BlendOperand operand);
229 typedef pmap<PT_EggTexture, TextureDef> Textures;
232 typedef pmap<CPT_EggMaterial, CPT(
RenderAttrib) > Materials;
233 Materials _materials;
234 Materials _materials_bface;
236 typedef pmap<PT(
EggGroup), PT(PandaNode) > Groups;
239 typedef pset<PandaNode *> ExtraNodes;
241 ExtraNodes _sequences;
243 class VertexPoolTransform {
245 bool operator < (
const VertexPoolTransform &other)
const;
247 BakeInUVs _bake_in_uvs;
248 LMatrix4d _transform;
250 typedef pmap<VertexPoolTransform, PT(
GeomVertexData) > VertexPoolData;
251 VertexPoolData _vertex_pool_data;
254 TransformStates _transform_states;
256 DeferredNodes _deferred_nodes;
265 bool _dynamic_override;
268 friend class EggRenderState;
269 friend class PandaNode;
Defines a texture map that may be applied to geometry.
Defines the properties of a named stage of the multitexture pipeline.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
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.