From 3a9e70645aafc4671c314cc2e6dff4c488bca805 Mon Sep 17 00:00:00 2001 From: Mark Mine Date: Wed, 1 Oct 2003 01:32:18 +0000 Subject: [PATCH] Add ability to pass in xy coords to pick routine --- direct/src/directtools/DirectSelection.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/direct/src/directtools/DirectSelection.py b/direct/src/directtools/DirectSelection.py index 94dcb2471d..7a9631f7df 100644 --- a/direct/src/directtools/DirectSelection.py +++ b/direct/src/directtools/DirectSelection.py @@ -530,9 +530,12 @@ class SelectionRay(SelectionQueue): SelectionQueue.__init__(self, parentNP) self.addCollider(CollisionRay()) - def pick(self, targetNodePath): + def pick(self, targetNodePath, xy = None): # Determine ray direction based upon the mouse coordinates - if direct: + if xy: + mx = xy[0] + my = xy[1] + elif direct: mx = direct.dr.mouseX my = direct.dr.mouseY else: @@ -554,9 +557,10 @@ class SelectionRay(SelectionQueue): # Determine collision entry 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.pick(targetNodePath) + self.pick(targetNodePath, xy = xy) # Determine collision entry return self.findCollisionEntry(skipFlags)