Adding Physics

See the physics example in the exampleScripts folder. For more on physics see the Vizard Documentation

To see how to toss objects with more velocity, see the example "Tossing_Objects"

Add this line of code towards the top of your script (for multi-user on both the server and client): 

viz.phys.enable()

Access the gaze objects manually and apply physics using this code in your experiment function. For Multi-User you need to add this code to both the experiment function on the client and the "recordWithTimer" function for the server. 


environmentModel = objects[0]

    environmentModel.collideMesh()

    environmentModel.hint(viz.OPTIMIZE_INTERSECT_HINT)


    basketball = gazeObjectsDict['Basketball']

    basketball.collideSphere()


#You can also just add a collidePlane to the env to create a floor plane

env = vizfx.addChild("utils/resources/environment/dojo.osgb")

env.collidePlane()