#1
|
|||
|
|||
setPosition() and collision
Hello,
I have a question about the setPosition() function, specifically when using it to move the viewpoint: when I enable collision for the viewpoint (by viz.MainView.collision(viz.ON)), the setPosition() command will not move the viewpoint when there is an object in the path to the desired position. This is very counter intuitive and has caused me some frustration with a complex scene with complex movement command (I thought the error was in my coding!). Is there a better way to move the viewpoint around? Right now I have to disable collision and re-enable it whenever I move the viewpoint. Here is a small example: Code:
import viz import viztask import vizshape arena = viz.addChild('pit.osgb') view = viz.MainView view.collision(viz.ON) eyelvl = 2 def main(): view.setEuler(0,0,0) view.setPosition([0,eyelvl,0]) yield viztask.waitKeyDown('b') view.setPosition([0,eyelvl,8]) yield viztask.waitKeyDown('b') view.setPosition([0,eyelvl,0]) cube1 = vizshape.addBox(size = [1,1,1],splitFaces = True) cube1.setPosition([0,eyelvl,6]) cube1.color(viz.RED) cube2 = vizshape.addBox(size = [1,1,1],splitFaces = True) cube2.setPosition([-2,eyelvl,6]) cube2.color(viz.GREEN) yield viztask.waitKeyDown('b') view.setPosition([0,eyelvl,8]) yield viztask.waitKeyDown('b') cube2.setPosition([2,eyelvl,6]) viztask.schedule(main()) viz.go() Johannes |
#2
|
|||
|
|||
It sounds like you've found a good workaround. I'll let our developers know about this issue and if they have other suggestions I'll reply here.
|
#3
|
|||
|
|||
Thank you!
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
.bsp->.obj->.osgt map Collision Problem/Resources for free maps? | plogic | Vizard | 0 | 10-24-2014 07:59 AM |