Here is a little script that keeps changing the collideMesh shape of the avatar. I think this is what you want to do. Run it with the latest Vizard Beta release.
Code:
import viz
CHANGE_STATE_TIMER = 0
SET_COLLIDE_SHAPE_TIMER = 1
viz.go()
viz.MainView.setPosition( 0, 2, -5 )
viz.phys.enable()
g = viz.add( 'tut_ground.wrl' )
g.collidePlane()
male = viz.add( 'male.cfg' )
male.currentState = 1
male.state( male.currentState )
def onTimer(num):
if num == CHANGE_STATE_TIMER:
male.currentState = (male.currentState+1) % 2
male.state( male.currentState )
viz.starttimer( SET_COLLIDE_SHAPE_TIMER, .2, viz.FOREVER )
elif num == SET_COLLIDE_SHAPE_TIMER:
male.collideNone()
male.collideMesh()
male.disable( viz.DYNAMICS )
viz.callback(viz.TIMER_EVENT,onTimer)
viz.starttimer( CHANGE_STATE_TIMER, 3, viz.FOREVER )
ball = viz.add('ball.wrl')
g=ball.collideSphere()
def shootAhead():
ball.reset()
view = viz.get(viz.MAIN_VIEWPOINT)
ball.translate(view.get(viz.HEAD_POS))
vec = viz.Vector(view.get(viz.VIEW_LOOK)[:3])
ball.setVelocity(vec*20)
vizact.onkeydown(' ',shootAhead)