16 #include "eggGroupNode.h" 17 #include "lightMutexHolder.h" 18 #include "config_egg.h" 19 #include "eggTextureCollection.h" 24 extern int eggyyparse();
25 #include "parserDefs.h" 26 #include "lexerDefs.h" 39 for (
unsigned int ni = 0; ni < strip_prefix.size(); ++ni) {
40 string axe_name = strip_prefix[ni];
41 if (this->get_name().substr(0, axe_name.size()) == axe_name) {
42 string new_name = this->get_name().substr(axe_name.size());
44 this->set_name(new_name);
62 r_apply_texmats(textures);
270 if (
is_of_type(EggGroupNode::get_class_type())) {
271 DCAST_INTO_R(group,
this,
false);
278 egg_init_parser(in,
"",
this, group);
280 if (!egg_start_parse_body()) {
281 egg_cleanup_parser();
286 egg_cleanup_parser();
288 return (egg_error_count() == 0);
301 test_under_integrity()
const {
302 if (_parent == NULL) {
304 nassertv(_depth == 0);
305 nassertv(_under_flags == 0);
310 nassertv(_depth == _parent->_depth + 1);
316 nassertv((_under_flags & _parent->_under_flags) == _parent->_under_flags);
319 EggGroupNode::iterator ci;
320 ci = find(_parent->begin(), _parent->end(),
this);
321 nassertv(ci != _parent->end());
324 _parent->test_under_integrity();
341 egg_start_parse_body() {
359 update_under(
int depth_offset) {
361 if (_parent == NULL) {
364 _vertex_frame = NULL;
366 _vertex_frame_inv = NULL;
367 _node_frame_inv = NULL;
368 _vertex_to_node = NULL;
369 _node_to_vertex = NULL;
372 depth = _parent->_depth + 1;
373 _under_flags = _parent->_under_flags;
374 _vertex_frame = _parent->_vertex_frame;
375 _node_frame = _parent->_node_frame;
376 _vertex_frame_inv = _parent->_vertex_frame_inv;
377 _node_frame_inv = _parent->_node_frame_inv;
378 _vertex_to_node = _parent->_vertex_to_node;
379 _node_to_vertex = _parent->_node_to_vertex;
382 if (depth - _depth != depth_offset) {
383 egg_cat.error() <<
"Cycle in egg graph or invalid egg pointer!\n";
413 has_primitives()
const {
425 joint_has_primitives()
const {
437 has_normals()
const {
469 r_transform_vertices(
const LMatrix4d &) {
482 r_mark_coordsys(CoordinateSystem) {
491 r_flatten_transforms() {
virtual bool determine_indexed()
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" sc...
bool parse_egg(const string &egg_syntax)
Parses the egg syntax given in the indicate string as if it had been read from the egg file within th...
This is a 4-by-4 transform matrix.
void apply_texmats()
Applies the texture matrices to the UV's of the vertices that reference them, and then removes the te...
A base class for nodes in the hierarchy that are not leaf nodes.
virtual EggRenderMode * determine_draw_order()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
virtual EggRenderMode * determine_depth_test_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
bool test_ref_count_integrity() const
Does some easy checks to make sure that the reference count isn't completely bogus.
This is a collection of textures by TRef name.
This class stores miscellaneous rendering properties that is associated with geometry, and which may be set on the geometry primitive level, on the group above it, or indirectly via a texture.
virtual bool determine_decal()
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag...
virtual EggRenderMode * determine_visibility_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
Similar to MutexHolder, but for a light mutex.
virtual bool is_anim_matrix() const
Returns true if this node represents a table of animation transformation data, false otherwise...
virtual EggRenderMode * determine_depth_write_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
virtual EggRenderMode * determine_alpha_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
virtual bool is_joint() const
Returns true if this particular node represents a <Joint> entry or not.
int find_used_textures(EggNode *node)
Walks the egg hierarchy beginning at the indicated node, looking for textures that are referenced by ...
virtual EggRenderMode * determine_bin()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
int rename_node(vector_string strip_prefix)
Rename by stripping out the prefix.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
TypeHandle is the identifier used to differentiate C++ class types.
virtual EggRenderMode * determine_depth_offset()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...