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) Code:
viz.collision(viz.ON) |
You're getting that error in the first piece of code because the viewpoint is being placed in a location that causes a collision when the collision event occurs.
In the second piece of code the viewpoint is set to [0,1.82,0] unless the eyeheight has been changed. That command will always move the view above the origin. If you want to move the viewpoint somewhere else use Code:
viz.MainView.setPosition() |
hi jeff,
I tried viz.MainView.setPosition() with other positions (non-colliding!), e.g., simply Code:
viz.collision(viz.ON) Code:
viz.collision(viz.ON) Any other ideas? Isn't possible to change the default of viz.HEAD_POS? |
What do you have loaded in your scene? Can you post an example script that reproduces the error?
|
hi,
i tried to find a reproducible example. The maximum recursion depth error doesn't appear allways. Often everything work smoothly now. However ... use either the intialPos inside the tunnel and go to the outside and collide with it or use the outside initialPos and collide with the inside of the tunnel in the example below. The error should appear then. Code:
import viz By the way, here is the full error, maybe this helps to understand what's happening: Traceback (most recent call last): File " File "C:\Program Files (x86)\WorldViz\Vizard30/python\viz.py", line 367, in __init__ self.object = _GetNode(data[7]) RuntimeError: maximum recursion depth exceeded |
Hi,
Try turning collision off before changing the view position, then turn it back on. Code:
def onCollision(info): Masaki |
All times are GMT -7. The time now is 11:11 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC