mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-18 12:43:44 -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
|
||||
import re
|
||||
|
||||
#hack:
|
||||
BAD_DO_ID = BAD_ZONE_ID = 0 # 0xFFFFFFFF
|
||||
@ -66,6 +67,17 @@ class DoCollectionManager:
|
||||
matches.append(value)
|
||||
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):
|
||||
if hasattr(do, 'getPos'):
|
||||
return do.getPos(localAvatar).length()
|
||||
|
Loading…
x
Reference in New Issue
Block a user