瀏覽代碼

add useful inspection funcs

David Rose 19 年之前
父節點
當前提交
d7ec81bcea
共有 2 個文件被更改,包括 49 次插入0 次删除
  1. 46 0
      panda/src/char/characterJoint.cxx
  2. 3 0
      panda/src/char/characterJoint.h

+ 46 - 0
panda/src/char/characterJoint.cxx

@@ -272,6 +272,29 @@ clear_net_transforms() {
   _net_transform_nodes.clear();
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: CharacterJoint::get_net_transforms
+//       Access: Published
+//  Description: Returns a list of the net transforms set for this
+//               node.  Note that this returns a list of NodePaths,
+//               even though the net transforms are actually a list of
+//               PandaNodes.
+////////////////////////////////////////////////////////////////////
+NodePathCollection CharacterJoint::
+get_net_transforms() {
+  NodePathCollection npc;
+
+  NodeList::iterator ai;
+  for (ai = _net_transform_nodes.begin();
+       ai != _net_transform_nodes.end();
+       ++ai) {
+    PandaNode *node = *ai;
+    npc.add_path(NodePath::any_path(node));
+  }
+
+  return npc;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: CharacterJoint::add_local_transform
 //       Access: Published
@@ -357,6 +380,29 @@ clear_local_transforms() {
   _local_transform_nodes.clear();
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: CharacterJoint::get_local_transforms
+//       Access: Published
+//  Description: Returns a list of the local transforms set for this
+//               node.  Note that this returns a list of NodePaths,
+//               even though the local transforms are actually a list of
+//               PandaNodes.
+////////////////////////////////////////////////////////////////////
+NodePathCollection CharacterJoint::
+get_local_transforms() {
+  NodePathCollection npc;
+
+  NodeList::iterator ai;
+  for (ai = _local_transform_nodes.begin();
+       ai != _local_transform_nodes.end();
+       ++ai) {
+    PandaNode *node = *ai;
+    npc.add_path(NodePath::any_path(node));
+  }
+
+  return npc;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: CharacterJoint::get_transform
 //       Access: Published

+ 3 - 0
panda/src/char/characterJoint.h

@@ -23,6 +23,7 @@
 
 #include "movingPartMatrix.h"
 #include "pandaNode.h"
+#include "nodePathCollection.h"
 
 class JointVertexTransform;
 class Character;
@@ -55,11 +56,13 @@ PUBLISHED:
   bool remove_net_transform(PandaNode *node);
   bool has_net_transform(PandaNode *node) const;
   void clear_net_transforms();
+  NodePathCollection get_net_transforms();
 
   bool add_local_transform(PandaNode *node);
   bool remove_local_transform(PandaNode *node);
   bool has_local_transform(PandaNode *node) const;
   void clear_local_transforms();
+  NodePathCollection get_local_transforms();
 
   void get_transform(LMatrix4f &transform) const;
   void get_net_transform(LMatrix4f &transform) const;