mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 12:12:10 -04:00
Add ability to pass in xy coords to pick routine
This commit is contained in:
parent
2b297f094c
commit
3a9e70645a
@ -530,9 +530,12 @@ class SelectionRay(SelectionQueue):
|
|||||||
SelectionQueue.__init__(self, parentNP)
|
SelectionQueue.__init__(self, parentNP)
|
||||||
self.addCollider(CollisionRay())
|
self.addCollider(CollisionRay())
|
||||||
|
|
||||||
def pick(self, targetNodePath):
|
def pick(self, targetNodePath, xy = None):
|
||||||
# Determine ray direction based upon the mouse coordinates
|
# Determine ray direction based upon the mouse coordinates
|
||||||
if direct:
|
if xy:
|
||||||
|
mx = xy[0]
|
||||||
|
my = xy[1]
|
||||||
|
elif direct:
|
||||||
mx = direct.dr.mouseX
|
mx = direct.dr.mouseX
|
||||||
my = direct.dr.mouseY
|
my = direct.dr.mouseY
|
||||||
else:
|
else:
|
||||||
@ -554,9 +557,10 @@ class SelectionRay(SelectionQueue):
|
|||||||
# Determine collision entry
|
# Determine collision entry
|
||||||
return self.findCollisionEntry(skipFlags)
|
return self.findCollisionEntry(skipFlags)
|
||||||
|
|
||||||
def pickGeom(self, targetNodePath = render, skipFlags = SKIP_ALL ):
|
def pickGeom(self, targetNodePath = render, skipFlags = SKIP_ALL,
|
||||||
|
xy = None):
|
||||||
self.collideWithGeom()
|
self.collideWithGeom()
|
||||||
self.pick(targetNodePath)
|
self.pick(targetNodePath, xy = xy)
|
||||||
# Determine collision entry
|
# Determine collision entry
|
||||||
return self.findCollisionEntry(skipFlags)
|
return self.findCollisionEntry(skipFlags)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user