PDA

View Full Version : strike the boxes


Moh200jo
03-19-2009, 10:05 AM
Is there any help to strike the boxes by avatar?
Thanks
import viz
viz.go()

room=viz.add('court.ive')
room.setPosition(0,0,25)
avatar=viz.add('vcc_male.cfg')
avatar.setPosition(0,0,3)
view = viz.MainView
link = viz.link(avatar, view)
link.preTrans([0,-.5,-6])
boxes=[]
for i in [9,15,30]:
box = viz.add('box.wrl')
box.setPosition(0,1,i)
box.setScale(.5,.5,.5)
coll=box.collideBox()
#box.enable(viz.COLLIDE_NOTIFY)
boxes.append( box )

walk = vizact.walkTo([0,0,15])
vizact.onkeydown(' ', avatar.addAction, walk)

Jeff
03-19-2009, 02:16 PM
You'll need to turn on the physics engine and add a collision shape to your avatar like a collideBox and a collidePlane to the room so the avatar does not go through the floor. You can also experiment with the density of the avatars collideBox so the avatar does not get pushed around from the collision.