#!/usr/bin/env python
import soy
import blocks
import sys
from time import sleep

sce = soy.scenes.Scene()

lig = soy.bodies.Light(sce)
lig.position = (-10.0,10.0,2.0)

cam = soy.bodies.Camera(sce)
cam.position = (0.0, 0.0, 10.0)

scr = soy.Screen()
win = soy.Window(scr, 'Collision Blocks', background=soy.colors.teal)
pro = soy.widgets.Projector(win, camera=cam)

mat = soy.materials.Material()
mat.shininess = 5 

cube1_sh = soy.shapes.Box(1, 1, 1)
cube2_sh = soy.shapes.Box(0.8,0.8,0.8)
cube1 = soy.bodies.Body(scene=sce, model=soy.models.Shape(mat), shape=cube1_sh)
cube1.position = (1,1,1)
cube1.rotation = (1,0,0)

cube2 = soy.bodies.Body(scene=sce, model=soy.models.Shape(mat), shape=cube2_sh)
cube2.rotation = (0,1,0)

# uncommenting next line causes loop to freeze
#jnt = soy.joints.Fixed(sce, cube1, cube2)

if __name__ == '__main__' :
  while True:
    sleep(.1)
