Made multiview camera/manipulation control using BitMask32.bit(21)

This commit is contained in:
Gyedo Jeon 2010-03-30 02:19:21 +00:00
parent 08a28d9ca7
commit 53a1e0bf62
4 changed files with 13 additions and 4 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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")