View Single Post
  #1  
Old 09-16-2010, 04:48 AM
kay kay is offline
Member
 
Join Date: Oct 2009
Posts: 10
Change position of MainView after COLLISION_EVENT

hi,

I would like to set the MainView to a new position after there was a COLLISION_EVENT. Calling viz.MainView.setPosition(...) leads to a "RuntimeError: maximum recursion depth exceeded".

Code:
viz.collision(viz.ON)

def onCollision(info):
	viz.MainView.setPosition([0,0,0])

viz.callback(viz.COLLISION_EVENT,onCollision)
Using viz.MainView.reset(viz.HEAD_POS) works. But how do I change the reset position? The default is (0,1.82,0).

Code:
viz.collision(viz.ON)

def onCollision(info):
	viz.MainView.reset(viz.HEAD_POS)

viz.callback(viz.COLLISION_EVENT,onCollision)
Thank you very much for suggestions.
Reply With Quote