mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
added removeNonCollisions, removed default numSolidsInLeaves
This commit is contained in:
parent
71235ae279
commit
375ea545a8
@ -1352,8 +1352,21 @@ def getNumDescendants(self):
|
|||||||
Dtool_funcToMethod(getNumDescendants, NodePath)
|
Dtool_funcToMethod(getNumDescendants, NodePath)
|
||||||
del getNumDescendants
|
del getNumDescendants
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
def removeNonCollisions(self):
|
||||||
|
# remove anything that is not collision-related
|
||||||
|
stack = [self]
|
||||||
|
while len(stack):
|
||||||
|
np = stack.pop()
|
||||||
|
# if there are no CollisionNodes under this node, remove it
|
||||||
|
if np.findAllMatches('**/+CollisionNode').getNumPaths() == 0:
|
||||||
|
np.detachNode()
|
||||||
|
else:
|
||||||
|
stack.extend(np.getChildrenAsList())
|
||||||
|
Dtool_funcToMethod(removeNonCollisions, NodePath)
|
||||||
|
del removeNonCollisions
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
def subdivideCollisions(self, numSolidsInLeaves = 2):
|
def subdivideCollisions(self, numSolidsInLeaves):
|
||||||
"""
|
"""
|
||||||
expand CollisionNodes out into balanced trees, with a particular number
|
expand CollisionNodes out into balanced trees, with a particular number
|
||||||
of solids in the leaves
|
of solids in the leaves
|
||||||
|
Loading…
x
Reference in New Issue
Block a user