WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   strike the boxes (https://forum.worldviz.com/showthread.php?t=1921)

Moh200jo 03-19-2009 10:05 AM

strike the boxes
 
Is there any help to strike the boxes by avatar?
Thanks
Code:

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.


All times are GMT -7. The time now is 04:55 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC