mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-19 13:15:00 -04:00
added a generic find for the cr, uses regex
This commit is contained in:
parent
bc62667675
commit
f481109861
@ -1,4 +1,5 @@
|
|||||||
from direct.distributed import DoHierarchy
|
from direct.distributed import DoHierarchy
|
||||||
|
import re
|
||||||
|
|
||||||
#hack:
|
#hack:
|
||||||
BAD_DO_ID = BAD_ZONE_ID = 0 # 0xFFFFFFFF
|
BAD_DO_ID = BAD_ZONE_ID = 0 # 0xFFFFFFFF
|
||||||
@ -66,6 +67,17 @@ class DoCollectionManager:
|
|||||||
matches.append(value)
|
matches.append(value)
|
||||||
return matches
|
return matches
|
||||||
|
|
||||||
|
def doFindAllMatching(self, str):
|
||||||
|
"""
|
||||||
|
Returns list of distributed objects with matching str in value.
|
||||||
|
"""
|
||||||
|
matches = []
|
||||||
|
for value in self.doId2do.values():
|
||||||
|
if re.search(str,`value`):
|
||||||
|
matches.append(value)
|
||||||
|
return matches
|
||||||
|
|
||||||
|
|
||||||
def _getDistanceFromLA(self, do):
|
def _getDistanceFromLA(self, do):
|
||||||
if hasattr(do, 'getPos'):
|
if hasattr(do, 'getPos'):
|
||||||
return do.getPos(localAvatar).length()
|
return do.getPos(localAvatar).length()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user