PDA

View Full Version : Gravity changes with angle of view in mid-drop?!


GregEnj
08-01-2013, 01:08 AM
Hi,

I believe I may have found a rather major bug in WorldViz involving gravity implementation on the view. I am obviously open to being corrected on this -- there may be something really obvious I have missed.

It appears as though if you look in a different direction when falling, it actually affects the angle of gravity!

Consider this example:


import viz, vizact
viz.go()

ground = viz.addChild('ground.osgb')
ground.setScale(10,1,10) # Make the ground a bit bigger

viz.MainView.setPosition(0,75,0) # Put me up in the air

viz.collision(viz.ON) # Turn on collision detection

def lookDown():
viz.MainView.setEuler(0,90,0, viz.HEAD_ORI)

vizact.ontimer2(2, 0, lookDown) # After 2 seconds of falling, look down


You end up falling backwards as soon as the view is changed. This does not make sense to me -- I surely shouldn't be able to change my angle of fall simply by moving my head, eyes or body. This also seems to impact Head Mounted Displays -- if you look around whilst falling it skews your drop!

If you stand on an object looking forwards, then walk straight off it, fall a bit, turn around and look down (perfectly possible to do), you actually end up getting thrown away from it as well as falling downwards!

I would appreciate any help in the matter as gravity not being 'downwards' really impacts what I am trying to do.

An additional possible bug: if you change the positional chunk of code above to viz.MainView.setPosition(0,1000,0) you never fall at all -- even though the ground is absolutely visible below you. I don't understand why this is? Presumably a check is made to see if the ground is below you, but the check seems to be very short (and possibly not configurable).

farshizzo
08-07-2013, 11:42 AM
Thanks for the bug report. This will be fixed in the next release.

The ground check distance is currently 100 units. This why the view doesn't fall when moved up 1000 units. The check distance will be increased in the next version as well.