Esempio n. 1
0
def basketFailure(e):
    print 'failed'
    global goggles, scubatank, decomptank, belt
    global gogglesTarget, scubatankTarget, decomptankTarget, beltTarget
    global manager
    
    if e.target.name == 'goggles':
        print 'Replacing goggles'
        manager.removeTarget(gogglesTarget)
        goggles.remove()
        goggles = init.initGoggles(boat)
        gogglesTarget = vizproximity.Target(goggles)
        gogglesTarget.name = 'goggles'
        manager.addTarget(gogglesTarget)
        
    elif e.target.name == 'scubatank':
        print 'Replacing scubatank'
        manager.removeTarget(scubatankTarget)
        scubatank.remove()
        scubatank = init.initScubatank(boat)
        scubatankTarget = vizproximity.Target(scubatank)
        scubatankTarget.name = 'scubatank'
        manager.addTarget(scubatankTarget)
        
    elif e.target.name == 'decomptank':
        print 'Replacing decomptank'
        manager.removeTarget(decomptankTarget)
        decomptank.remove()
        decomptank = init.initDecomptank(boat)
        decomptankTarget = vizproximity.Target(decomptank)
        decomptankTarget.name = 'decomptank'
        manager.addTarget(decomptankTarget)
        
    elif e.target.name == 'belt':
        print 'Replacing belt'
        manager.removeTarget(beltTarget)
        belt.remove()
        belt = init.initBelt(boat)
        beltTarget = vizproximity.Target(belt)
        beltTarget.name = 'belt'
        manager.addTarget(beltTarget)
    
    #tools = setTools()
    #tool.setItems([tools])
    tool.setItems([goggles,scubatank,decomptank,belt])
Esempio n. 2
0
mvLink.postTrans([-4, -3, 0])
mvPos = viz.MainView.getPosition()
mvLink.remove()
viz.MainView.setPosition(mvPos)
"""
#globals_oa.user.setPosition(boat.getPosition()[0]-2,boat.getPosition()[1]-4,boat.getPosition()[2])   
#viz.MainView.setPosition([176.2937042236328, 1.8365875482559204, 149.93800354003906])
#viz.MainView.setEuler([-94.66553497314453, -4.785220146179199, -0.8960405588150024])

#ischia = init.initIschia()
boat = init.initBoat()

basket = init.initBasket(boat)
scubatank = init.initScubatank(boat)
decomptank = init.initDecomptank(boat)
belt = init.initBelt(boat)
flippers = init.initFlippers(boat)
goggles = init.initGoggles(boat)
radioOff = init.initRadioOff(boat)
radioOn = init.initRadioOn(boat)

#Initialize the Grabber and items that can be grabbed
#Change hightlight mode from default outline to box

#from tools import grabber
#from tools import highlighter
#tool = grabber.Grabber(usingPhysics=PHYSICS_ENABLED, usingSprings=PHYSICS_ENABLED, highlightMode=highlighter.MODE_BOX)
#
## update code for grabber
#def updateGrabberMouse(tool):
#    state = viz.mouse.getState()