added getJointTransformState

This commit is contained in:
Zhao Huang 2011-12-30 01:29:53 +00:00
parent 1c9395b311
commit b4fcbfff0a
1 changed files with 19 additions and 0 deletions

View File

@ -1242,6 +1242,25 @@ class Actor(DirectObject, NodePath):
return None
return joint.getDefaultValue()
def getJointTransformState(self, partName, jointName, lodName='lodRoot'):
partBundleDict=self.__partBundleDict.get(lodName)
if not partBundleDict:
Actor.notify.warning("no lod named: %s" % (lodName))
return None
subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
partDef = partBundleDict.get(subpartDef.truePartName)
if partDef:
bundle = partDef.getBundle()
else:
Actor.notify.warning("no part named %s!" % (partName))
return None
joint = bundle.findChild(jointName)
if joint == None:
Actor.notify.warning("no joint named %s!" % (jointName))
return None
return joint.getTransformState()
def controlJoint(self, node, partName, jointName, lodName="lodRoot"):
"""The converse of exposeJoint: this associates the joint with