self._inner_object = ode.GeomTriMesh(tm_data, space.get_inner_object())

- def get_faces(num_x, num_~~y~~):

+ def get_faces(num_x, num_z):

Edward Dale - Snowballs: An experiment in Winter frivolity (2006).

http://scompt.com/files/cg2/final.pdf

method chooses 3 vertices out of each 4 to make a face and the other set to make

another triangular face. This is done randomly to eliminate artifacts.

- for y in range(num_y-1):

- for x in range(num_x-1):

- three = (num_x*(y+1))+x

- four = (num_x*(y+1))+x+1

- faces += choice( ( [( three,two,one ),( three,four,two )],

- [( four,two,one ), ( three,four,one )] ) )

+ #TODO: make it work OK when num_x != num_z

+ for z in range(num_z - 1):

+ for x in range(num_x - 1):

+ two = (num_x * z) + x + 1

+ three = (num_x * (z + 1)) + x

+ four = (num_x * (z + 1)) + x + 1

+ #===============================================================

+ # [(three,two,one), (three,four,two)],

+ # [(four,two,one), (three,four,one)]

+ #===============================================================

+ # randomness does not seem to help in any way

+ faces += [( three,two,one ),( three,four,two )] #( three,two,one )

+ def swap_faces_indices(faces):

+ Faces had to change their indices to work with ODE. With the initial get_faces,

+ the normal to the triangle defined by the 3 vertices pointed (following the

+ right-hand rule) downwards. Swapping the third with the first index, now the

+ triangle normal pointed upwards.

+ new_faces.append((face[2], face[1], face[0]))

#===========================================================================

# def attach_body(self, body):

# raise Exception('Trimesh shapes are not yet allowed to have a body attached')