Panda3D
 All Classes Functions Variables Enumerations
maxNodeTree.h
1 // Filename: maxNodeTree.h
2 // Created by: crevilla
3 // from mayaNodeTree.h created by: drose (06Jun03)
4 //
5 ////////////////////////////////////////////////////////////////////
6 //
7 // PANDA 3D SOFTWARE
8 // Copyright (c) Carnegie Mellon University. All rights reserved.
9 //
10 // All use of this software is subject to the terms of the revised BSD
11 // license. You should have received a copy of this license along
12 // with this source code in a file named "LICENSE."
13 //
14 ////////////////////////////////////////////////////////////////////
15 
16 #ifndef MAXNODETREE_H
17 #define MAXNODETREE_H
18 
19 class EggData;
20 class EggGroupNode;
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : MaxNodeTree
24 // Description : Describes a complete tree of max nodes for
25 // conversion.
26 ////////////////////////////////////////////////////////////////////
27 class MaxNodeTree {
28 public:
29  MaxNodeTree();
30  MaxNodeDesc *build_node(INode *max_node);
31  MaxNodeDesc *build_joint(INode *max_node, MaxNodeDesc *node_joint);
32  bool build_complete_hierarchy(INode *root, ULONG *selection_list, int len);
33  MaxNodeDesc *find_node(INode *max_node);
34  MaxNodeDesc *find_joint(INode *max_node);
35 
36  int get_num_nodes() const;
37  MaxNodeDesc *get_node(int n) const;
38 
39  void clear_egg(EggData *egg_data, EggGroupNode *egg_root,
40  EggGroupNode *skeleton_node);
41  EggGroup *get_egg_group(MaxNodeDesc *node_desc);
42  EggTable *get_egg_table(MaxNodeDesc *node_desc);
44 
45  MaxNodeDesc* _root;
46  PN_stdfloat _fps;
47  // the flag for the setting up collision
48  //bool _has_collision;
49  //EggGroup::CollideFlags _cf_type;
50  //EggGroup::CollisionSolidType _cs_type;
51  bool _export_mesh;
52 
53 private:
54  EggData *_egg_data;
55  EggGroupNode *_egg_root;
56  EggGroupNode *_skeleton_node;
57 
58  MaxNodeDesc *r_build_node(INode *max_node);
59  MaxNodeDesc *r_build_joint(MaxNodeDesc *node_desc, INode *max_node);
60  bool node_in_list(ULONG handle, ULONG *list, int len);
61  bool r_build_hierarchy(INode *root, ULONG *selection_list, int len);
62  bool is_joint(INode *node);
63  void set_collision_tags(MaxNodeDesc *node_desc, EggGroup *egg_group);
64 
66  NodesByPath _nodes_by_path;
67 
69  Nodes _nodes;
70 };
71 
72 #endif
EggGroup * get_egg_group(MaxNodeDesc *node_desc)
Returns the EggGroupNode corresponding to the group or joint for the indicated node.
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:51
EggXfmSAnim * get_egg_anim(MaxNodeDesc *node_desc)
Returns the anim table corresponding to the joint for the indicated node.
MaxNodeDesc * build_node(INode *max_node)
Returns a pointer to the node corresponding to the indicated INode object, creating it first if neces...
Definition: maxNodeTree.cxx:41
MaxNodeDesc * get_node(int n) const
Returns the nth node in the hierarchy, in an arbitrary ordering.
bool build_complete_hierarchy(INode *root, ULONG *selection_list, int len)
Walks through the complete Max hierarchy and builds up the corresponding tree.
MaxNodeDesc * find_joint(INode *max_node)
The recursive implementation of build_node().
This is the primary interface into all the egg data, and the root of the egg file structure...
Definition: eggData.h:41
MaxNodeDesc * build_joint(INode *max_node, MaxNodeDesc *node_joint)
Returns a pointer to the node corresponding to the indicated INode object, creating it first if neces...
Definition: maxNodeTree.cxx:59
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:36
void clear_egg(EggData *egg_data, EggGroupNode *egg_root, EggGroupNode *skeleton_node)
Removes all of the references to generated egg structures from the tree, and prepares the tree for ge...
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine <S$Anim> entries that...
Definition: eggXfmSAnim.h:33
Describes a single instance of a node in the Max scene graph, relating it to the corresponding egg st...
Definition: maxNodeDesc.h:26
int get_num_nodes() const
Returns the total number of nodes in the hierarchy, not counting the root node.
MaxNodeDesc * find_node(INode *max_node)
The recursive implementation of build_node().
This corresponds to a.
Definition: eggTable.h:31
EggTable * get_egg_table(MaxNodeDesc *node_desc)
Returns the EggTable corresponding to the joint for the indicated node.
Describes a complete tree of max nodes for conversion.
Definition: maxNodeTree.h:27