Panda3D
Loading...
Searching...
No Matches
maxNodeDesc.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file maxNodeDesc.h
10 * @author crevilla
11 * from mayaNodeDesc.h created by: drose (06Jun03)
12 */
13
14#ifndef MAXNODEDESC_H
15#define MAXNODEDESC_H
16
17/**
18 * Describes a single instance of a node in the Max scene graph, relating it
19 * to the corresponding egg structures (e.g. node, group, or table entry)
20 * that will be created.
21 */
22class MaxNodeDesc : public ReferenceCount, public Namable {
23 public:
24 MaxNodeDesc(MaxNodeDesc *parent = nullptr, INode *max_node = nullptr);
26
27 void from_INode(INode *max_node);
28 bool has_max_node() const;
29 INode *get_max_node() const;
30
31 void set_joint(bool onoff);
32 bool is_joint() const;
33 bool is_joint_parent() const;
34 bool is_node_joint() const;
35
36 MaxNodeDesc *_parent;
37 MaxNodeDesc *_joint_entry;
39 Children _children;
40
41 private:
42 void clear_egg();
43 void mark_joint_parent();
44 void check_pseudo_joints(bool joint_above);
45
46 INode *_max_node;
47
48 EggGroup *_egg_group;
49 EggTable *_egg_table;
50 EggXfmSAnim *_anim;
51
52 enum JointType {
53 JT_none, // Not a joint.
54 JT_node_joint, // Node that represents a joint in the geometry
55 // but not the actual joint itself
56 JT_joint, // An actual joint in Max.
57 JT_pseudo_joint, // Not a joint in Max, but treated just like a
58 // joint for the purposes of the converter.
59 JT_joint_parent, // A parent or ancestor of a joint or pseudo joint.
60 };
61 JointType _joint_type;
62
63
64 public:
65 static TypeHandle get_class_type() {
66 return _type_handle;
67 }
68 static void init_type() {
69 ReferenceCount::init_type();
70 Namable::init_type();
71 register_type(_type_handle, "MaxNodeDesc",
72 ReferenceCount::get_class_type(),
73 Namable::get_class_type());
74 }
75
76 private:
77 static TypeHandle _type_handle;
78
79 friend class MaxNodeTree;
80};
81
82#endif
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition eggGroup.h:34
This corresponds to a.
Definition eggTable.h:27
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine entries that specify...
Definition eggXfmSAnim.h:28
Describes a single instance of a node in the Max scene graph, relating it to the corresponding egg st...
Definition maxNodeDesc.h:22
bool is_joint() const
Returns true if the node should be treated as a joint by the converter.
MaxNodeDesc(MaxNodeDesc *parent=nullptr, INode *max_node=nullptr)
Creates a MaxNodeDesc.
bool is_node_joint() const
Returns true if the node is the parent or ancestor of a joint.
bool is_joint_parent() const
Returns true if the node is the parent or ancestor of a joint.
INode * get_max_node() const
Returns the INode associated with this node.
void from_INode(INode *max_node)
Indicates an associated between the MaxNodeDesc and some Max Node instance.
bool has_max_node() const
Returns true if a Max INode has been associated with this node, false otherwise.
Describes a complete tree of max nodes for conversion.
Definition maxNodeTree.h:23
A base class for all things which can have a name.
Definition namable.h:26
A base class for all things that want to be reference-counted.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
This is our own Panda specialization on the default STL vector.
Definition pvector.h:42
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...