From 237000f7d80072374b7ee8465a0a2bd7be0a1407 Mon Sep 17 00:00:00 2001 From: Zachary Pavlov Date: Wed, 22 Aug 2007 23:27:03 +0000 Subject: [PATCH] new fix bounds function --- direct/src/actor/Actor.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index d5c2f075e6..21f69482ce 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -1260,6 +1260,39 @@ class Actor(DirectObject, NodePath): frontParts.reparentTo(backPart) + def fixBoundsNew(self, partName = None): + if(partName == None): + #iterate through everything + for lodData in self.__partBundleDict.values(): + for partData in lodData.values(): + char = partData.partBundleNP + char.node().update() + geomNodes = char.findAllMatches("**/+GeomNode") + numGeomNodes = geomNodes.getNumPaths() + for nodeNum in xrange(numGeomNodes): + thisGeomNode = geomNodes.getPath(nodeNum) + numGeoms = thisGeomNode.node().getNumGeoms() + for geomNum in xrange(numGeoms): + thisGeom = thisGeomNode.node().getGeom(geomNum) + thisGeom.markBoundsStale() + thisGeomNode.node().markInternalBoundsStale() + else: + #iterate through for a specific part + for lodData in self.__partBundleDict.values(): + partData = lodData.get(partName): + if(partData): + char = partData.partBundleNP + char.node().update() + geomNodes = char.findAllMatches("**/+GeomNode") + numGeomNodes = geomNodes.getNumPaths() + for nodeNum in xrange(numGeomNodes): + thisGeomNode = geomNodes.getPath(nodeNum) + numGeoms = thisGeomNode.node().getNumGeoms() + for geomNum in xrange(numGeoms): + thisGeom = thisGeomNode.node().getGeom(geomNum) + thisGeom.markBoundsStale() + thisGeomNode.node().markInternalBoundsStale() + def fixBounds(self, part=None): """fixBounds(self, nodePath=None) Force recomputation of bounding spheres for all geoms