Made multiview camera/manipulation control using BitMask32.bit(21)
This commit is contained in:
parent
08a28d9ca7
commit
53a1e0bf62
|
|
@ -296,7 +296,8 @@ class DirectCameraControl(DirectObject):
|
|||
# create ray from the camera to detect 3d position
|
||||
iRay = SelectionRay(base.direct.camera)
|
||||
iRay.collider.setFromLens(base.direct.camNode, base.direct.dr.mouseX, base.direct.dr.mouseY)
|
||||
iRay.collideWithBitMask(1)
|
||||
#iRay.collideWithBitMask(1)
|
||||
iRay.collideWithBitMask(BitMask32.bit(21))
|
||||
iRay.ct.traverse(base.direct.grid)
|
||||
|
||||
entry = iRay.getEntry(0)
|
||||
|
|
|
|||
|
|
@ -1466,7 +1466,8 @@ class ObjectHandles(NodePath, DirectObject):
|
|||
# create ray from the camera to detect 3d position
|
||||
iRay = SelectionRay(base.direct.camera)
|
||||
iRay.collider.setFromLens(base.direct.camNode, base.direct.dr.mouseX, base.direct.dr.mouseY)
|
||||
iRay.collideWithBitMask(1)
|
||||
#iRay.collideWithBitMask(1)
|
||||
iRay.collideWithBitMask(BitMask32.bit(21))
|
||||
iRay.ct.traverse(base.direct.grid)
|
||||
|
||||
entry = iRay.getEntry(0)
|
||||
|
|
@ -1538,7 +1539,8 @@ class ObjectHandles(NodePath, DirectObject):
|
|||
# create ray from the camera to detect 3d position
|
||||
iRay = SelectionRay(base.direct.camera)
|
||||
iRay.collider.setFromLens(base.direct.camNode, base.direct.dr.mouseX, base.direct.dr.mouseY)
|
||||
iRay.collideWithBitMask(1)
|
||||
#iRay.collideWithBitMask(1)
|
||||
iRay.collideWithBitMask(BitMask32.bit(21))
|
||||
iRay.ct.traverse(base.direct.grid)
|
||||
|
||||
entry = iRay.getEntry(0)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,10 @@ class PandaTextDropTarget(wx.TextDropTarget):
|
|||
break
|
||||
|
||||
if hitPt is None:
|
||||
iRay.collideWithBitMask(1)
|
||||
if self.view.name == 'persp':
|
||||
iRay.collideWithBitMask(1)
|
||||
else:
|
||||
iRay.collideWithBitMask(BitMask32.bit(21))
|
||||
iRay.ct.traverse(self.view.collPlane)
|
||||
if iRay.getNumEntries() > 0:
|
||||
entry = iRay.getEntry(0)
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ class Viewport(wx.Panel, DirectObject):
|
|||
v.grid.setHpr(0, 0, 90)
|
||||
collPlane = CollisionNode('LeftGridCol')
|
||||
collPlane.addSolid(CollisionPlane(Plane(1, 0, 0, 0)))
|
||||
collPlane.setIntoCollideMask(BitMask32.bit(21))
|
||||
v.collPlane = NodePath(collPlane)
|
||||
v.collPlane.wrtReparentTo(v.grid)
|
||||
#v.grid.gridBack.findAllMatches("**/+GeomNode")[0].setName("_leftViewGridBack")
|
||||
|
|
@ -201,6 +202,7 @@ class Viewport(wx.Panel, DirectObject):
|
|||
v.grid.setHpr(90, 0, 90)
|
||||
collPlane = CollisionNode('FrontGridCol')
|
||||
collPlane.addSolid(CollisionPlane(Plane(0, -1, 0, 0)))
|
||||
collPlane.setIntoCollideMask(BitMask32.bit(21))
|
||||
v.collPlane = NodePath(collPlane)
|
||||
v.collPlane.wrtReparentTo(v.grid)
|
||||
#v.grid.gridBack.findAllMatches("**/+GeomNode")[0].setName("_frontViewGridBack")
|
||||
|
|
@ -208,6 +210,7 @@ class Viewport(wx.Panel, DirectObject):
|
|||
else:
|
||||
collPlane = CollisionNode('TopGridCol')
|
||||
collPlane.addSolid(CollisionPlane(Plane(0, 0, 1, 0)))
|
||||
collPlane.setIntoCollideMask(BitMask32.bit(21))
|
||||
v.collPlane = NodePath(collPlane)
|
||||
v.collPlane.reparentTo(v.grid)
|
||||
#v.grid.gridBack.findAllMatches("**/+GeomNode")[0].setName("_topViewGridBack")
|
||||
|
|
|
|||
Loading…
Reference in New Issue