mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Added optional skip flags to be able to ignore certain types of geometry for select detection.
This commit is contained in:
parent
1d9df0ce98
commit
b1daa2b2ff
@ -35,6 +35,7 @@ class DirectManipulationControl(PandaObject):
|
|||||||
['shift-f', self.objectHandles.growToFit],
|
['shift-f', self.objectHandles.growToFit],
|
||||||
['i', self.plantSelectedNodePath],
|
['i', self.plantSelectedNodePath],
|
||||||
]
|
]
|
||||||
|
self.optionalSkipFlags = 0
|
||||||
|
|
||||||
def manipulationStart(self, modifiers):
|
def manipulationStart(self, modifiers):
|
||||||
# Start out in select mode
|
# Start out in select mode
|
||||||
@ -86,8 +87,9 @@ class DirectManipulationControl(PandaObject):
|
|||||||
# depending on flag.....
|
# depending on flag.....
|
||||||
if self.mode == 'select':
|
if self.mode == 'select':
|
||||||
# Check for object under mouse
|
# Check for object under mouse
|
||||||
# Don't intersect with hidden or backfacing objects
|
# Don't intersect with hidden or backfacing objects, as well as any
|
||||||
skipFlags = SKIP_HIDDEN | SKIP_BACKFACE
|
# optionally specified things
|
||||||
|
skipFlags = SKIP_HIDDEN | SKIP_BACKFACE | self.optionalSkipFlags
|
||||||
# Skip camera (and its children), unless control key is pressed
|
# Skip camera (and its children), unless control key is pressed
|
||||||
skipFlags |= SKIP_CAMERA * (1 - base.getControl())
|
skipFlags |= SKIP_CAMERA * (1 - base.getControl())
|
||||||
entry = direct.iRay.pickGeom(skipFlags = skipFlags)
|
entry = direct.iRay.pickGeom(skipFlags = skipFlags)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user