Panda3D
|
00001 // Filename: maxNodeDesc.h 00002 // Created by: crevilla 00003 // from mayaNodeDesc.h created by: drose (06Jun03) 00004 // 00005 //////////////////////////////////////////////////////////////////// 00006 // 00007 // PANDA 3D SOFTWARE 00008 // Copyright (c) Carnegie Mellon University. All rights reserved. 00009 // 00010 // All use of this software is subject to the terms of the revised BSD 00011 // license. You should have received a copy of this license along 00012 // with this source code in a file named "LICENSE." 00013 // 00014 //////////////////////////////////////////////////////////////////// 00015 00016 #ifndef MAXNODEDESC_H 00017 #define MAXNODEDESC_H 00018 00019 //////////////////////////////////////////////////////////////////// 00020 // Class : MaxNodeDesc 00021 // Description : Describes a single instance of a node in the Max 00022 // scene graph, relating it to the corresponding egg 00023 // structures (e.g. node, group, or table entry) that 00024 // will be created. 00025 //////////////////////////////////////////////////////////////////// 00026 class MaxNodeDesc : public ReferenceCount, public Namable { 00027 public: 00028 MaxNodeDesc(MaxNodeDesc *parent = NULL, const string &name = string()); 00029 ~MaxNodeDesc(); 00030 00031 void from_INode(INode *max_node); 00032 bool has_max_node() const; 00033 INode *get_max_node() const; 00034 00035 void set_joint(bool onoff); 00036 bool is_joint() const; 00037 bool is_joint_parent() const; 00038 bool is_node_joint() const; 00039 00040 MaxNodeDesc *_parent; 00041 MaxNodeDesc *_joint_entry; 00042 typedef pvector< MaxNodeDesc* > Children; 00043 Children _children; 00044 00045 private: 00046 void clear_egg(); 00047 void mark_joint_parent(); 00048 void check_pseudo_joints(bool joint_above); 00049 00050 INode *_max_node; 00051 00052 EggGroup *_egg_group; 00053 EggTable *_egg_table; 00054 EggXfmSAnim *_anim; 00055 00056 enum JointType { 00057 JT_none, // Not a joint. 00058 JT_node_joint, // Node that represents a joint in the geometry 00059 // but not the actual joint itself 00060 JT_joint, // An actual joint in Max. 00061 JT_pseudo_joint, // Not a joint in Max, but treated just like a 00062 // joint for the purposes of the converter. 00063 JT_joint_parent, // A parent or ancestor of a joint or pseudo joint. 00064 }; 00065 JointType _joint_type; 00066 00067 00068 public: 00069 static TypeHandle get_class_type() { 00070 return _type_handle; 00071 } 00072 static void init_type() { 00073 ReferenceCount::init_type(); 00074 Namable::init_type(); 00075 register_type(_type_handle, "MaxNodeDesc", 00076 ReferenceCount::get_class_type(), 00077 Namable::get_class_type()); 00078 } 00079 00080 private: 00081 static TypeHandle _type_handle; 00082 00083 friend class MaxNodeTree; 00084 }; 00085 00086 #endif