36class EXPCL_PANDA_EGG EggNode :
public EggNamedObject {
38 INLINE
explicit EggNode(
const std::string &name =
"");
39 INLINE EggNode(
const EggNode ©);
40 INLINE EggNode &operator = (
const EggNode ©);
42 INLINE EggGroupNode *get_parent()
const;
48 MAKE_PROPERTY(parent, get_parent);
65 INLINE
void transform(
const LMatrix4d &mat);
85 virtual void write(std::ostream &out,
int indent_level)
const=0;
86 bool parse_egg(
const std::string &egg_syntax);
89 void test_under_integrity()
const;
91 void test_under_integrity()
const { }
94 EXTENSION(PyObject *__reduce__()
const);
98 UF_under_instance = 0x001,
99 UF_under_transform = 0x002,
100 UF_local_coord = 0x004,
103 virtual bool egg_start_parse_body();
105 virtual void update_under(
int depth_offset);
106 virtual void adjust_under();
107 virtual bool has_primitives()
const;
108 virtual bool joint_has_primitives()
const;
109 virtual bool has_normals()
const;
111 virtual void r_transform(
const LMatrix4d &mat,
const LMatrix4d &inv,
112 CoordinateSystem to_cs);
113 virtual void r_transform_vertices(
const LMatrix4d &mat);
114 virtual void r_mark_coordsys(CoordinateSystem cs);
115 virtual void r_flatten_transforms();
116 virtual void r_apply_texmats(EggTextureCollection &textures);
122 EggGroupNode *_parent;
126 typedef RefCountObj<LMatrix4d> MatrixFrame;
128 PT(MatrixFrame) _vertex_frame;
129 PT(MatrixFrame) _node_frame;
130 PT(MatrixFrame) _vertex_frame_inv;
131 PT(MatrixFrame) _node_frame_inv;
132 PT(MatrixFrame) _vertex_to_node;
133 PT(MatrixFrame) _node_to_vertex;
138 static TypeHandle get_class_type() {
141 static void init_type() {
142 EggNamedObject::init_type();
144 EggNamedObject::get_class_type());
145 MatrixFrame::init_type();
147 virtual TypeHandle get_type()
const {
148 return get_class_type();
150 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
153 static TypeHandle _type_handle;
155 friend class EggGroupNode;
156 friend class EggTable;
A base class for nodes in the hierarchy that are not leaf nodes.
virtual EggRenderMode * determine_bin()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
const LMatrix4d & get_vertex_frame_inv() const
Returns the inverse of the matrix returned by get_vertex_frame().
virtual bool is_joint() const
Returns true if this particular node represents a <Joint> entry or not.
const LMatrix4d & get_vertex_to_node() const
Returns the transformation matrix suitable for converting the vertices as read from the egg file into...
virtual EggRenderMode * determine_alpha_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
void transform_vertices_only(const LMatrix4d &mat)
Applies the indicated transformation only to vertices that appear in global space within vertex pools...
const LMatrix4d * get_vertex_frame_inv_ptr() const
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv(...
bool is_under_instance() const
Returns true if there is an <Instance> node somewhere in the egg tree at or above this node,...
int rename_node(vector_string strip_prefix)
Rename by stripping out the prefix.
virtual EggRenderMode * determine_depth_test_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
const LMatrix4d * get_vertex_to_node_ptr() const
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() ...
void apply_texmats()
Applies the texture matrices to the UV's of the vertices that reference them, and then removes the te...
virtual EggRenderMode * determine_depth_offset()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
void transform(const LMatrix4d &mat)
Applies the indicated transformation to the node and all of its descendants.
const LMatrix4d * get_node_frame_ptr() const
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matr...
const LMatrix4d & get_node_frame() const
Returns the coordinate frame of the node itself.
virtual bool is_anim_matrix() const
Returns true if this node represents a table of animation transformation data, false otherwise.
const LMatrix4d & get_node_to_vertex() const
Returns the transformation matrix suitable for converting vertices in the coordinate space of the nod...
virtual bool determine_indexed()
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" sc...
const LMatrix4d & get_vertex_frame() const
Returns the coordinate frame of the vertices referenced by primitives at or under this node.
const LMatrix4d * get_node_to_vertex_ptr() const
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() ...
const LMatrix4d * get_node_frame_inv_ptr() const
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() ...
const LMatrix4d * get_vertex_frame_ptr() const
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() ma...
bool is_under_transform() const
Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node,...
void flatten_transforms()
Removes any transform and instance records from this node in the scene graph and below.
get_depth
Returns the number of nodes above this node in the egg hierarchy.
bool parse_egg(const std::string &egg_syntax)
Parses the egg syntax given in the indicate string as if it had been read from the egg file within th...
virtual EggRenderMode * determine_depth_write_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
bool is_local_coord() const
Returns true if this node's vertices are not in the global coordinate space.
virtual EggRenderMode * determine_visibility_mode()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
const LMatrix4d & get_node_frame_inv() const
Returns the inverse of the matrix returned by get_node_frame().
virtual EggRenderMode * determine_draw_order()
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this leve...
virtual bool determine_decal()
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag...
This class stores miscellaneous rendering properties that is associated with geometry,...
This is a collection of textures by TRef name.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.