Commit fa292863 authored by sumpfralle's avatar sumpfralle

r645@erker: lars | 2010-02-11 04:44:54 +0100

 add physics generation


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@110 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent a588af75
import OpenGL.GL as GL
import OpenGL.GLUT as GLUT
import ode_objects
VIEW_ROTATIONS = {
......@@ -159,3 +160,11 @@ def scale_model(model, scale):
matrix = ((scale, 0, 0, 0), (0, scale, 0, 0), (0, 0, scale, 0))
model.transform(matrix)
def generate_physics(settings):
physics = ode_objects.PhysicalWorld()
physics.reset()
physics.add_mesh((0, 0, 0), settings.get("model").triangles())
height = settings.get("maxz") - settings.get("minz")
physics.set_drill(ode_objects.ShapeCylinder(0.1, height), (settings.get("minx"), settings.get("miny"), settings.get("maxz")))
return physics
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment