Beispiel #1
0
 def update_shapes(self, physics):
     for obj in self.objects:
         if hasattr(obj, 'physics') and obj in physics:
             trans, rot = physics[obj]
             obj.shape.translationMatrix = trans
             obj.shape.rotationMatrix = rot
             if hasattr(obj, 'extra_shapes'):
                 for s, x, y, z in obj.extra_shapes:
                     p = SimpleVector(x, y, z)
                     p.matMul(rot)
                     m4 = Matrix(trans)
                     m4.translate(p)
                     s.translationMatrix = m4
                     s.rotationMatrix = rot