diff --git a/panda/src/char/characterJoint.cxx b/panda/src/char/characterJoint.cxx index 29bc3d17f1..c5e7e27bb0 100644 --- a/panda/src/char/characterJoint.cxx +++ b/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 diff --git a/panda/src/char/characterJoint.h b/panda/src/char/characterJoint.h index a646e6e44d..42a4363c70 100644 --- a/panda/src/char/characterJoint.h +++ b/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;