Sfoglia il codice sorgente

merged mx2cc.monkey2

Mark Sibly 7 anni fa
parent
commit
b1d9660bfa
33 ha cambiato i file con 1530 aggiunte e 5579 eliminazioni
  1. 1 1
      ABOUT.HTML
  2. 5 1
      VERSIONS.TXT
  3. 0 5006
      meshtest-scene.mojo3d
  4. 1 1
      modules/bullet/bullet.monkey2
  5. 52 6
      modules/mojo/graphics/canvas.monkey2
  6. 13 9
      modules/mojo/graphics/graphicsdevice.monkey2
  7. 23 0
      modules/mojo/graphics/image.monkey2
  8. 6 0
      modules/mojo/graphics/texture.monkey2
  9. 89 8
      modules/mojo3d/scene/components/collider.monkey2
  10. 6 8
      modules/mojo3d/scene/entities/model.monkey2
  11. 19 10
      modules/mojo3d/scene/entities/sprite.monkey2
  12. 140 80
      modules/mojo3d/scene/jsonifier/jsonifier.monkey2
  13. 26 0
      modules/mojo3d/scene/jsonifier/jsonifierexts.monkey2
  14. 25 0
      modules/mojo3d/scene/material.monkey2
  15. 37 28
      modules/mojo3d/scene/materials/pbrmaterial.monkey2
  16. 18 3
      modules/mojo3d/scene/materials/spritematerial.monkey2
  17. 65 69
      modules/mojo3d/scene/scene.monkey2
  18. 131 0
      modules/mojo3d/tests/ducks-scene.monkey2
  19. 6 5
      modules/mojo3d/tests/ducks.monkey2
  20. 30 30
      modules/mojo3d/tests/shapes-scene.monkey2
  21. 110 0
      modules/mojo3d/tests/sprites-scene.monkey2
  22. 4 9
      modules/mojo3d/tests/sprites.monkey2
  23. 25 3
      modules/mojo3d/tests/terrainmesh.monkey2
  24. 455 0
      modules/mojo3d/tests/test-scene.monkey2
  25. 89 0
      modules/mojo3d/tests/test.monkey2
  26. 95 261
      shapes-scene.mojo3d
  27. 9 2
      src/createrelease/createrelease.monkey2
  28. 3 3
      src/mx2cc/builder.monkey2
  29. 2 0
      src/mx2cc/buildproduct.monkey2
  30. 1 1
      src/mx2cc/mx2cc.monkey2
  31. 1 1
      src/mx2cc/newdocs/docsbuffer.monkey2
  32. 23 1
      src/mx2cc/newdocs/docsmaker.monkey2
  33. 20 33
      test-scene.mojo3d

+ 1 - 1
ABOUT.HTML

@@ -48,7 +48,7 @@ a:hover{
 <h1>Monkey2 v2018.04</h1>
 <h1>Monkey2 v2018.04</h1>
 
 
 <h2>Mx2cc v1.1.12</h2>
 <h2>Mx2cc v1.1.12</h2>
-<h2>Ted2go v2.9</h2>
+<h2>Ted2go v2.10</h2>
 
 
 <p>Welcome to monkey2, an open source, user friendly, cross platform programming language by Mark Sibly.
 <p>Welcome to monkey2, an open source, user friendly, cross platform programming language by Mark Sibly.
 
 

+ 5 - 1
VERSIONS.TXT

@@ -1,5 +1,9 @@
 
 
-***** Monkey2 v2018.03 Mx2cc v1.1.12 *****
+***** Monkey-v2018.04 Mx2cc-v1.1.12 Ted2go-2.10 *****
+
+Added GetPixel and GetPixelARGB to both Image and Canvas classes - canvas version will be slow as hell, eg: 3 secs for 16x16! Image versions still relies on the 'managed pixmap hack', but I should be able to improve on the speed of this for desktop targets.
+
+Fixed makedocs links to enums.
 
 
 Tweaked mx2cc's gcc dependancy checking so it happens while compiling (just like msvc's) so there should now only be 1 'slow build' under mingw instead of 2. Sometimes it's just a matter of knowing that a certain command line option even exists!
 Tweaked mx2cc's gcc dependancy checking so it happens while compiling (just like msvc's) so there should now only be 1 'slow build' under mingw instead of 2. Sometimes it's just a matter of knowing that a certain command line option even exists!
 
 

+ 0 - 5006
meshtest-scene.mojo3d

@@ -1,5006 +0,0 @@
-{
-	"assetsDir":"C:/Users/The Razorback/Desktop/meshtest.products/Windows/assets/",
-	"instances":[{
-		"ctor":{
-			"args":[],
-			"decl":"mojo3d.Scene.New",
-			"type":"Void()"
-		},
-		"id":"@0",
-		"state":{
-
-		},
-		"type":"mojo3d.Scene"
-	},{
-		"ctor":{
-			"args":[null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@1",
-		"state":{
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":[null],
-			"decl":"mojo3d.Camera.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@2",
-		"state":{
-			"Far":500,
-			"LocalMatrix":[1,0,0,0,0.89442718029022217,0.44721359014511108,0,-0.44721359014511108,0.89442718029022217,0,5,-10],
-			"Visible":true
-		},
-		"type":"mojo3d.Camera"
-	},{
-		"ctor":{
-			"args":["@2"],
-			"decl":"mojo3d.FlyBehaviour.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@3",
-		"state":{
-
-		},
-		"type":"mojo3d.FlyBehaviour"
-	},{
-		"ctor":{
-			"args":[null],
-			"decl":"mojo3d.Light.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@4",
-		"state":{
-			"CastsShadow":true,
-			"LocalMatrix":[0.70710676908493042,0,-0.70710676908493042,0.40824827551841736,0.81649655103683472,0.40824827551841736,0.57735025882720947,-0.57735025882720947,0.57735025882720947,-100,100,-100],
-			"Visible":true
-		},
-		"type":"mojo3d.Light"
-	},{
-		"ctor":{
-			"args":[[0,0.5,0,0.5],1,1,false],
-			"decl":"mojo3d.PbrMaterial.New",
-			"type":"Void(std.graphics.Color,Float,Float,Bool)"
-		},
-		"id":"@5",
-		"state":{
-
-		},
-		"type":"mojo3d.PbrMaterial"
-	},{
-		"ctor":{
-			"args":[[-250,-5,-250,250,5,250],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@6",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@6","@5",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@7",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0,-5,0],
-			"Materials":["@5"],
-			"Mesh":"@6",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@7"],
-			"decl":"mojo3d.ConvexHullCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@8",
-		"state":{
-			"Mesh":"@6"
-		},
-		"type":"mojo3d.ConvexHullCollider"
-	},{
-		"ctor":{
-			"args":["@7"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@9",
-		"state":{
-			"Mass":0
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[1,1,1,1],1,1,false],
-			"decl":"mojo3d.PbrMaterial.New",
-			"type":"Void(std.graphics.Color,Float,Float,Bool)"
-		},
-		"id":"@10",
-		"state":{
-
-		},
-		"type":"mojo3d.PbrMaterial"
-	},{
-		"ctor":{
-			"args":[[-0.10123708844184875,-0.10123708844184875,-0.10123708844184875,0.10123708844184875,0.10123708844184875,0.10123708844184875],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@11",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@11","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@12",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-5.7663865089416504,8.9288721084594727,0],
-			"Materials":["@10"],
-			"Mesh":"@11",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@12"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@13",
-		"state":{
-			"Box":[-0.10123708844184875,-0.10123708844184875,-0.10123708844184875,0.10123708844184875,0.10123708844184875,0.10123708844184875]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@12"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@14",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.11763124912977219,-0.11763124912977219,-0.11763124912977219,0.11763124912977219,0.11763124912977219,0.11763124912977219],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@15",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@15","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@16",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-9.9242353439331055,8.6834287643432617,0],
-			"Materials":["@10"],
-			"Mesh":"@15",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@16"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@17",
-		"state":{
-			"Box":[-0.11763124912977219,-0.11763124912977219,-0.11763124912977219,0.11763124912977219,0.11763124912977219,0.11763124912977219]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@16"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@18",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.37912017107009888,-0.37912017107009888,-0.37912017107009888,0.37912017107009888,0.37912017107009888,0.37912017107009888],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@19",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@19","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@20",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,6.244476318359375,7.1492910385131836,0],
-			"Materials":["@10"],
-			"Mesh":"@19",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@20"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@21",
-		"state":{
-			"Box":[-0.37912017107009888,-0.37912017107009888,-0.37912017107009888,0.37912017107009888,0.37912017107009888,0.37912017107009888]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@20"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@22",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.49445715546607971,-0.49445715546607971,-0.49445715546607971,0.49445715546607971,0.49445715546607971,0.49445715546607971],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@23",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@23","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@24",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.92970210313796997,9.3121261596679688,0],
-			"Materials":["@10"],
-			"Mesh":"@23",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@24"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@25",
-		"state":{
-			"Box":[-0.49445715546607971,-0.49445715546607971,-0.49445715546607971,0.49445715546607971,0.49445715546607971,0.49445715546607971]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@24"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@26",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.066028766334056854,-0.066028766334056854,-0.066028766334056854,0.066028766334056854,0.066028766334056854,0.066028766334056854],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@27",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@27","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@28",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,1.9295977354049683,9.3195104598999023,0],
-			"Materials":["@10"],
-			"Mesh":"@27",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@28"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@29",
-		"state":{
-			"Box":[-0.066028766334056854,-0.066028766334056854,-0.066028766334056854,0.066028766334056854,0.066028766334056854,0.066028766334056854]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@28"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@30",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.19113853573799133,-0.19113853573799133,-0.19113853573799133,0.19113853573799133,0.19113853573799133,0.19113853573799133],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@31",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@31","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@32",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,6.0553545951843262,8.8104209899902344,0],
-			"Materials":["@10"],
-			"Mesh":"@31",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@32"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@33",
-		"state":{
-			"Box":[-0.19113853573799133,-0.19113853573799133,-0.19113853573799133,0.19113853573799133,0.19113853573799133,0.19113853573799133]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@32"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@34",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.35931548476219177,-0.35931548476219177,-0.35931548476219177,0.35931548476219177,0.35931548476219177,0.35931548476219177],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@35",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@35","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@36",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-6.9060764312744141,7.7745451927185059,0],
-			"Materials":["@10"],
-			"Mesh":"@35",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@36"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@37",
-		"state":{
-			"Box":[-0.35931548476219177,-0.35931548476219177,-0.35931548476219177,0.35931548476219177,0.35931548476219177,0.35931548476219177]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@36"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@38",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.23446957767009735,-0.23446957767009735,-0.23446957767009735,0.23446957767009735,0.23446957767009735,0.23446957767009735],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@39",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@39","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@40",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.6229681968688965,7.9365072250366211,0],
-			"Materials":["@10"],
-			"Mesh":"@39",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@40"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@41",
-		"state":{
-			"Box":[-0.23446957767009735,-0.23446957767009735,-0.23446957767009735,0.23446957767009735,0.23446957767009735,0.23446957767009735]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@40"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@42",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.19023895263671875,-0.19023895263671875,-0.19023895263671875,0.19023895263671875,0.19023895263671875,0.19023895263671875],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@43",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@43","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@44",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-8.8220834732055664,8.1032629013061523,0],
-			"Materials":["@10"],
-			"Mesh":"@43",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@44"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@45",
-		"state":{
-			"Box":[-0.19023895263671875,-0.19023895263671875,-0.19023895263671875,0.19023895263671875,0.19023895263671875,0.19023895263671875]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@44"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@46",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.080863796174526215,-0.080863796174526215,-0.080863796174526215,0.080863796174526215,0.080863796174526215,0.080863796174526215],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@47",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@47","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@48",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-3.9965169429779053,7.7954201698303223,0],
-			"Materials":["@10"],
-			"Mesh":"@47",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@48"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@49",
-		"state":{
-			"Box":[-0.080863796174526215,-0.080863796174526215,-0.080863796174526215,0.080863796174526215,0.080863796174526215,0.080863796174526215]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@48"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@50",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.19138315320014954,-0.19138315320014954,-0.19138315320014954,0.19138315320014954,0.19138315320014954,0.19138315320014954],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@51",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@51","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@52",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0.61090689897537231,7.7405414581298828,0],
-			"Materials":["@10"],
-			"Mesh":"@51",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@52"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@53",
-		"state":{
-			"Box":[-0.19138315320014954,-0.19138315320014954,-0.19138315320014954,0.19138315320014954,0.19138315320014954,0.19138315320014954]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@52"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@54",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.12070898711681366,-0.12070898711681366,-0.12070898711681366,0.12070898711681366,0.12070898711681366,0.12070898711681366],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@55",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@55","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@56",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,9.1446561813354492,7.9606990814208984,0],
-			"Materials":["@10"],
-			"Mesh":"@55",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@56"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@57",
-		"state":{
-			"Box":[-0.12070898711681366,-0.12070898711681366,-0.12070898711681366,0.12070898711681366,0.12070898711681366,0.12070898711681366]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@56"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@58",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.35809174180030823,-0.35809174180030823,-0.35809174180030823,0.35809174180030823,0.35809174180030823,0.35809174180030823],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@59",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@59","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@60",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.62283378839492798,9.5438709259033203,0],
-			"Materials":["@10"],
-			"Mesh":"@59",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@60"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@61",
-		"state":{
-			"Box":[-0.35809174180030823,-0.35809174180030823,-0.35809174180030823,0.35809174180030823,0.35809174180030823,0.35809174180030823]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@60"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@62",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.1077292189002037,-0.1077292189002037,-0.1077292189002037,0.1077292189002037,0.1077292189002037,0.1077292189002037],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@63",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@63","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@64",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-8.2064876556396484,8.2415065765380859,0],
-			"Materials":["@10"],
-			"Mesh":"@63",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@64"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@65",
-		"state":{
-			"Box":[-0.1077292189002037,-0.1077292189002037,-0.1077292189002037,0.1077292189002037,0.1077292189002037,0.1077292189002037]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@64"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@66",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.34030288457870483,-0.34030288457870483,-0.34030288457870483,0.34030288457870483,0.34030288457870483,0.34030288457870483],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@67",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@67","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@68",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-9.4171142578125,7.5177803039550781,0],
-			"Materials":["@10"],
-			"Mesh":"@67",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@68"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@69",
-		"state":{
-			"Box":[-0.34030288457870483,-0.34030288457870483,-0.34030288457870483,0.34030288457870483,0.34030288457870483,0.34030288457870483]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@68"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@70",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.11058248579502106,-0.11058248579502106,-0.11058248579502106,0.11058248579502106,0.11058248579502106,0.11058248579502106],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@71",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@71","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@72",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,7.5711421966552734,7.9306163787841797,0],
-			"Materials":["@10"],
-			"Mesh":"@71",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@72"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@73",
-		"state":{
-			"Box":[-0.11058248579502106,-0.11058248579502106,-0.11058248579502106,0.11058248579502106,0.11058248579502106,0.11058248579502106]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@72"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@74",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.071889296174049377,-0.071889296174049377,-0.071889296174049377,0.071889296174049377,0.071889296174049377,0.071889296174049377],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@75",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@75","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@76",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,6.398531436920166,8.6780214309692383,0],
-			"Materials":["@10"],
-			"Mesh":"@75",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@76"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@77",
-		"state":{
-			"Box":[-0.071889296174049377,-0.071889296174049377,-0.071889296174049377,0.071889296174049377,0.071889296174049377,0.071889296174049377]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@76"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@78",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.17503198981285095,-0.17503198981285095,-0.17503198981285095,0.17503198981285095,0.17503198981285095,0.17503198981285095],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@79",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@79","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@80",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,3.9277708530426025,8.993016242980957,0],
-			"Materials":["@10"],
-			"Mesh":"@79",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@80"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@81",
-		"state":{
-			"Box":[-0.17503198981285095,-0.17503198981285095,-0.17503198981285095,0.17503198981285095,0.17503198981285095,0.17503198981285095]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@80"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@82",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.073368541896343231,-0.073368541896343231,-0.073368541896343231,0.073368541896343231,0.073368541896343231,0.073368541896343231],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@83",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@83","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@84",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-9.2696075439453125,8.9290647506713867,0],
-			"Materials":["@10"],
-			"Mesh":"@83",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@84"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@85",
-		"state":{
-			"Box":[-0.073368541896343231,-0.073368541896343231,-0.073368541896343231,0.073368541896343231,0.073368541896343231,0.073368541896343231]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@84"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@86",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.25728541612625122,-0.25728541612625122,-0.25728541612625122,0.25728541612625122,0.25728541612625122,0.25728541612625122],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@87",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@87","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@88",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-3.0173375606536865,9.8135099411010742,0],
-			"Materials":["@10"],
-			"Mesh":"@87",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@88"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@89",
-		"state":{
-			"Box":[-0.25728541612625122,-0.25728541612625122,-0.25728541612625122,0.25728541612625122,0.25728541612625122,0.25728541612625122]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@88"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@90",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.30658254027366638,-0.30658254027366638,-0.30658254027366638,0.30658254027366638,0.30658254027366638,0.30658254027366638],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@91",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@91","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@92",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,1.4581243991851807,8.3349514007568359,0],
-			"Materials":["@10"],
-			"Mesh":"@91",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@92"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@93",
-		"state":{
-			"Box":[-0.30658254027366638,-0.30658254027366638,-0.30658254027366638,0.30658254027366638,0.30658254027366638,0.30658254027366638]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@92"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@94",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.45195707678794861,-0.45195707678794861,-0.45195707678794861,0.45195707678794861,0.45195707678794861,0.45195707678794861],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@95",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@95","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@96",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-8.4858884811401367,8.4551315307617188,0],
-			"Materials":["@10"],
-			"Mesh":"@95",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@96"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@97",
-		"state":{
-			"Box":[-0.45195707678794861,-0.45195707678794861,-0.45195707678794861,0.45195707678794861,0.45195707678794861,0.45195707678794861]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@96"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@98",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.42978909611701965,-0.42978909611701965,-0.42978909611701965,0.42978909611701965,0.42978909611701965,0.42978909611701965],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@99",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@99","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@100",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-3.6447844505310059,9.6650915145874023,0],
-			"Materials":["@10"],
-			"Mesh":"@99",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@100"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@101",
-		"state":{
-			"Box":[-0.42978909611701965,-0.42978909611701965,-0.42978909611701965,0.42978909611701965,0.42978909611701965,0.42978909611701965]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@100"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@102",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.47372284531593323,-0.47372284531593323,-0.47372284531593323,0.47372284531593323,0.47372284531593323,0.47372284531593323],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@103",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@103","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@104",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,7.503878116607666,9.6697454452514648,0],
-			"Materials":["@10"],
-			"Mesh":"@103",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@104"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@105",
-		"state":{
-			"Box":[-0.47372284531593323,-0.47372284531593323,-0.47372284531593323,0.47372284531593323,0.47372284531593323,0.47372284531593323]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@104"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@106",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.44944554567337036,-0.44944554567337036,-0.44944554567337036,0.44944554567337036,0.44944554567337036,0.44944554567337036],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@107",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@107","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@108",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,7.7481522560119629,7.3893580436706543,0],
-			"Materials":["@10"],
-			"Mesh":"@107",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@108"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@109",
-		"state":{
-			"Box":[-0.44944554567337036,-0.44944554567337036,-0.44944554567337036,0.44944554567337036,0.44944554567337036,0.44944554567337036]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@108"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@110",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.13679288327693939,-0.13679288327693939,-0.13679288327693939,0.13679288327693939,0.13679288327693939,0.13679288327693939],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@111",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@111","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@112",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,6.9572134017944336,8.2448539733886719,0],
-			"Materials":["@10"],
-			"Mesh":"@111",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@112"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@113",
-		"state":{
-			"Box":[-0.13679288327693939,-0.13679288327693939,-0.13679288327693939,0.13679288327693939,0.13679288327693939,0.13679288327693939]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@112"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@114",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.1654382050037384,-0.1654382050037384,-0.1654382050037384,0.1654382050037384,0.1654382050037384,0.1654382050037384],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@115",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@115","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@116",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-5.108482837677002,8.0272493362426758,0],
-			"Materials":["@10"],
-			"Mesh":"@115",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@116"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@117",
-		"state":{
-			"Box":[-0.1654382050037384,-0.1654382050037384,-0.1654382050037384,0.1654382050037384,0.1654382050037384,0.1654382050037384]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@116"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@118",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.15537865459918976,-0.15537865459918976,-0.15537865459918976,0.15537865459918976,0.15537865459918976,0.15537865459918976],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@119",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@119","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@120",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-3.2334058284759521,7.4074382781982422,0],
-			"Materials":["@10"],
-			"Mesh":"@119",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@120"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@121",
-		"state":{
-			"Box":[-0.15537865459918976,-0.15537865459918976,-0.15537865459918976,0.15537865459918976,0.15537865459918976,0.15537865459918976]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@120"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@122",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.11131514608860016,-0.11131514608860016,-0.11131514608860016,0.11131514608860016,0.11131514608860016,0.11131514608860016],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@123",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@123","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@124",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-6.826591968536377,8.7700366973876953,0],
-			"Materials":["@10"],
-			"Mesh":"@123",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@124"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@125",
-		"state":{
-			"Box":[-0.11131514608860016,-0.11131514608860016,-0.11131514608860016,0.11131514608860016,0.11131514608860016,0.11131514608860016]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@124"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@126",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.26351448893547058,-0.26351448893547058,-0.26351448893547058,0.26351448893547058,0.26351448893547058,0.26351448893547058],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@127",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@127","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@128",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.6297659873962402,8.2714223861694336,0],
-			"Materials":["@10"],
-			"Mesh":"@127",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@128"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@129",
-		"state":{
-			"Box":[-0.26351448893547058,-0.26351448893547058,-0.26351448893547058,0.26351448893547058,0.26351448893547058,0.26351448893547058]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@128"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@130",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.35264131426811218,-0.35264131426811218,-0.35264131426811218,0.35264131426811218,0.35264131426811218,0.35264131426811218],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@131",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@131","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@132",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-6.2598085403442383,9.8782949447631836,0],
-			"Materials":["@10"],
-			"Mesh":"@131",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@132"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@133",
-		"state":{
-			"Box":[-0.35264131426811218,-0.35264131426811218,-0.35264131426811218,0.35264131426811218,0.35264131426811218,0.35264131426811218]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@132"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@134",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.14077439904212952,-0.14077439904212952,-0.14077439904212952,0.14077439904212952,0.14077439904212952,0.14077439904212952],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@135",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@135","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@136",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.67124778032302856,9.7282752990722656,0],
-			"Materials":["@10"],
-			"Mesh":"@135",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@136"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@137",
-		"state":{
-			"Box":[-0.14077439904212952,-0.14077439904212952,-0.14077439904212952,0.14077439904212952,0.14077439904212952,0.14077439904212952]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@136"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@138",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.49492135643959045,-0.49492135643959045,-0.49492135643959045,0.49492135643959045,0.49492135643959045,0.49492135643959045],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@139",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@139","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@140",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-4.160794734954834,9.6706752777099609,0],
-			"Materials":["@10"],
-			"Mesh":"@139",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@140"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@141",
-		"state":{
-			"Box":[-0.49492135643959045,-0.49492135643959045,-0.49492135643959045,0.49492135643959045,0.49492135643959045,0.49492135643959045]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@140"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@142",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.37912869453430176,-0.37912869453430176,-0.37912869453430176,0.37912869453430176,0.37912869453430176,0.37912869453430176],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@143",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@143","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@144",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-8.8581686019897461,9.2626008987426758,0],
-			"Materials":["@10"],
-			"Mesh":"@143",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@144"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@145",
-		"state":{
-			"Box":[-0.37912869453430176,-0.37912869453430176,-0.37912869453430176,0.37912869453430176,0.37912869453430176,0.37912869453430176]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@144"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@146",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.38968348503112793,-0.38968348503112793,-0.38968348503112793,0.38968348503112793,0.38968348503112793,0.38968348503112793],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@147",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@147","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@148",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,8.9723052978515625,9.4543685913085938,0],
-			"Materials":["@10"],
-			"Mesh":"@147",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@148"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@149",
-		"state":{
-			"Box":[-0.38968348503112793,-0.38968348503112793,-0.38968348503112793,0.38968348503112793,0.38968348503112793,0.38968348503112793]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@148"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@150",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.36982831358909607,-0.36982831358909607,-0.36982831358909607,0.36982831358909607,0.36982831358909607,0.36982831358909607],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@151",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@151","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@152",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,4.5693778991699219,7.9541716575622559,0],
-			"Materials":["@10"],
-			"Mesh":"@151",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@152"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@153",
-		"state":{
-			"Box":[-0.36982831358909607,-0.36982831358909607,-0.36982831358909607,0.36982831358909607,0.36982831358909607,0.36982831358909607]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@152"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@154",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.26844605803489685,-0.26844605803489685,-0.26844605803489685,0.26844605803489685,0.26844605803489685,0.26844605803489685],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@155",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@155","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@156",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.43174991011619568,9.1660375595092773,0],
-			"Materials":["@10"],
-			"Mesh":"@155",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@156"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@157",
-		"state":{
-			"Box":[-0.26844605803489685,-0.26844605803489685,-0.26844605803489685,0.26844605803489685,0.26844605803489685,0.26844605803489685]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@156"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@158",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.19905631244182587,-0.19905631244182587,-0.19905631244182587,0.19905631244182587,0.19905631244182587,0.19905631244182587],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@159",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@159","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@160",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,7.8193068504333496,8.4008893966674805,0],
-			"Materials":["@10"],
-			"Mesh":"@159",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@160"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@161",
-		"state":{
-			"Box":[-0.19905631244182587,-0.19905631244182587,-0.19905631244182587,0.19905631244182587,0.19905631244182587,0.19905631244182587]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@160"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@162",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.37049010396003723,-0.37049010396003723,-0.37049010396003723,0.37049010396003723,0.37049010396003723,0.37049010396003723],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@163",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@163","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@164",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-1.7148081064224243,7.6557788848876953,0],
-			"Materials":["@10"],
-			"Mesh":"@163",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@164"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@165",
-		"state":{
-			"Box":[-0.37049010396003723,-0.37049010396003723,-0.37049010396003723,0.37049010396003723,0.37049010396003723,0.37049010396003723]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@164"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@166",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.28759172558784485,-0.28759172558784485,-0.28759172558784485,0.28759172558784485,0.28759172558784485,0.28759172558784485],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@167",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@167","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@168",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.98850512504577637,8.458104133605957,0],
-			"Materials":["@10"],
-			"Mesh":"@167",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@168"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@169",
-		"state":{
-			"Box":[-0.28759172558784485,-0.28759172558784485,-0.28759172558784485,0.28759172558784485,0.28759172558784485,0.28759172558784485]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@168"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@170",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.49591982364654541,-0.49591982364654541,-0.49591982364654541,0.49591982364654541,0.49591982364654541,0.49591982364654541],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@171",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@171","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@172",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-6.9334292411804199,8.2350091934204102,0],
-			"Materials":["@10"],
-			"Mesh":"@171",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@172"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@173",
-		"state":{
-			"Box":[-0.49591982364654541,-0.49591982364654541,-0.49591982364654541,0.49591982364654541,0.49591982364654541,0.49591982364654541]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@172"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@174",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.13710331916809082,-0.13710331916809082,-0.13710331916809082,0.13710331916809082,0.13710331916809082,0.13710331916809082],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@175",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@175","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@176",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,8.7126893997192383,9.3007678985595703,0],
-			"Materials":["@10"],
-			"Mesh":"@175",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@176"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@177",
-		"state":{
-			"Box":[-0.13710331916809082,-0.13710331916809082,-0.13710331916809082,0.13710331916809082,0.13710331916809082,0.13710331916809082]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@176"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@178",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.21740087866783142,-0.21740087866783142,-0.21740087866783142,0.21740087866783142,0.21740087866783142,0.21740087866783142],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@179",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@179","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@180",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,7.4087839126586914,8.7477922439575195,0],
-			"Materials":["@10"],
-			"Mesh":"@179",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@180"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@181",
-		"state":{
-			"Box":[-0.21740087866783142,-0.21740087866783142,-0.21740087866783142,0.21740087866783142,0.21740087866783142,0.21740087866783142]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@180"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@182",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.13742856681346893,-0.13742856681346893,-0.13742856681346893,0.13742856681346893,0.13742856681346893,0.13742856681346893],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@183",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@183","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@184",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-6.5994791984558105,7.0702786445617676,0],
-			"Materials":["@10"],
-			"Mesh":"@183",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@184"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@185",
-		"state":{
-			"Box":[-0.13742856681346893,-0.13742856681346893,-0.13742856681346893,0.13742856681346893,0.13742856681346893,0.13742856681346893]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@184"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@186",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.37941542267799377,-0.37941542267799377,-0.37941542267799377,0.37941542267799377,0.37941542267799377,0.37941542267799377],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@187",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@187","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@188",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-1.2898731231689453,7.8651313781738281,0],
-			"Materials":["@10"],
-			"Mesh":"@187",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@188"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@189",
-		"state":{
-			"Box":[-0.37941542267799377,-0.37941542267799377,-0.37941542267799377,0.37941542267799377,0.37941542267799377,0.37941542267799377]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@188"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@190",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.061145059764385223,-0.061145059764385223,-0.061145059764385223,0.061145059764385223,0.061145059764385223,0.061145059764385223],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@191",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@191","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@192",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-5.1469836235046387,9.1442346572875977,0],
-			"Materials":["@10"],
-			"Mesh":"@191",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@192"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@193",
-		"state":{
-			"Box":[-0.061145059764385223,-0.061145059764385223,-0.061145059764385223,0.061145059764385223,0.061145059764385223,0.061145059764385223]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@192"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@194",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.064293414354324341,-0.064293414354324341,-0.064293414354324341,0.064293414354324341,0.064293414354324341,0.064293414354324341],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@195",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@195","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@196",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,4.5693845748901367,9.164036750793457,0],
-			"Materials":["@10"],
-			"Mesh":"@195",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@196"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@197",
-		"state":{
-			"Box":[-0.064293414354324341,-0.064293414354324341,-0.064293414354324341,0.064293414354324341,0.064293414354324341,0.064293414354324341]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@196"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@198",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.28778445720672607,-0.28778445720672607,-0.28778445720672607,0.28778445720672607,0.28778445720672607,0.28778445720672607],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@199",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@199","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@200",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.71709984540939331,8.7895021438598633,0],
-			"Materials":["@10"],
-			"Mesh":"@199",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@200"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@201",
-		"state":{
-			"Box":[-0.28778445720672607,-0.28778445720672607,-0.28778445720672607,0.28778445720672607,0.28778445720672607,0.28778445720672607]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@200"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@202",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.3834279477596283,-0.3834279477596283,-0.3834279477596283,0.3834279477596283,0.3834279477596283,0.3834279477596283],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@203",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@203","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@204",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.4815506935119629,9.8466310501098633,0],
-			"Materials":["@10"],
-			"Mesh":"@203",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@204"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@205",
-		"state":{
-			"Box":[-0.3834279477596283,-0.3834279477596283,-0.3834279477596283,0.3834279477596283,0.3834279477596283,0.3834279477596283]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@204"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@206",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.16397200524806976,-0.16397200524806976,-0.16397200524806976,0.16397200524806976,0.16397200524806976,0.16397200524806976],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@207",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@207","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@208",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.6771931648254395,8.1971492767333984,0],
-			"Materials":["@10"],
-			"Mesh":"@207",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@208"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@209",
-		"state":{
-			"Box":[-0.16397200524806976,-0.16397200524806976,-0.16397200524806976,0.16397200524806976,0.16397200524806976,0.16397200524806976]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@208"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@210",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.24119454622268677,-0.24119454622268677,-0.24119454622268677,0.24119454622268677,0.24119454622268677,0.24119454622268677],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@211",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@211","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@212",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,2.9633522033691406,7.335174560546875,0],
-			"Materials":["@10"],
-			"Mesh":"@211",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@212"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@213",
-		"state":{
-			"Box":[-0.24119454622268677,-0.24119454622268677,-0.24119454622268677,0.24119454622268677,0.24119454622268677,0.24119454622268677]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@212"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@214",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.4872574508190155,-0.4872574508190155,-0.4872574508190155,0.4872574508190155,0.4872574508190155,0.4872574508190155],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@215",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@215","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@216",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-2.6661980152130127,7.4525341987609863,0],
-			"Materials":["@10"],
-			"Mesh":"@215",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@216"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@217",
-		"state":{
-			"Box":[-0.4872574508190155,-0.4872574508190155,-0.4872574508190155,0.4872574508190155,0.4872574508190155,0.4872574508190155]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@216"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@218",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.14198693633079529,-0.14198693633079529,-0.14198693633079529,0.14198693633079529,0.14198693633079529,0.14198693633079529],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@219",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@219","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@220",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-2.8060574531555176,7.622344970703125,0],
-			"Materials":["@10"],
-			"Mesh":"@219",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@220"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@221",
-		"state":{
-			"Box":[-0.14198693633079529,-0.14198693633079529,-0.14198693633079529,0.14198693633079529,0.14198693633079529,0.14198693633079529]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@220"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@222",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.43886598944664001,-0.43886598944664001,-0.43886598944664001,0.43886598944664001,0.43886598944664001,0.43886598944664001],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@223",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@223","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@224",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.90354138612747192,8.4876089096069336,0],
-			"Materials":["@10"],
-			"Mesh":"@223",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@224"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@225",
-		"state":{
-			"Box":[-0.43886598944664001,-0.43886598944664001,-0.43886598944664001,0.43886598944664001,0.43886598944664001,0.43886598944664001]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@224"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@226",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.3027503490447998,-0.3027503490447998,-0.3027503490447998,0.3027503490447998,0.3027503490447998,0.3027503490447998],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@227",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@227","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@228",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-6.4566092491149902,9.0542335510253906,0],
-			"Materials":["@10"],
-			"Mesh":"@227",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@228"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@229",
-		"state":{
-			"Box":[-0.3027503490447998,-0.3027503490447998,-0.3027503490447998,0.3027503490447998,0.3027503490447998,0.3027503490447998]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@228"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@230",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.37286773324012756,-0.37286773324012756,-0.37286773324012756,0.37286773324012756,0.37286773324012756,0.37286773324012756],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@231",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@231","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@232",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.73043185472488403,9.5090246200561523,0],
-			"Materials":["@10"],
-			"Mesh":"@231",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@232"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@233",
-		"state":{
-			"Box":[-0.37286773324012756,-0.37286773324012756,-0.37286773324012756,0.37286773324012756,0.37286773324012756,0.37286773324012756]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@232"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@234",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.38171863555908203,-0.38171863555908203,-0.38171863555908203,0.38171863555908203,0.38171863555908203,0.38171863555908203],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@235",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@235","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@236",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,7.8809118270874023,9.7671918869018555,0],
-			"Materials":["@10"],
-			"Mesh":"@235",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@236"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@237",
-		"state":{
-			"Box":[-0.38171863555908203,-0.38171863555908203,-0.38171863555908203,0.38171863555908203,0.38171863555908203,0.38171863555908203]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@236"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@238",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.21483975648880005,-0.21483975648880005,-0.21483975648880005,0.21483975648880005,0.21483975648880005,0.21483975648880005],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@239",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@239","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@240",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,2.657686710357666,8.3823490142822266,0],
-			"Materials":["@10"],
-			"Mesh":"@239",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@240"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@241",
-		"state":{
-			"Box":[-0.21483975648880005,-0.21483975648880005,-0.21483975648880005,0.21483975648880005,0.21483975648880005,0.21483975648880005]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@240"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@242",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.29493138194084167,-0.29493138194084167,-0.29493138194084167,0.29493138194084167,0.29493138194084167,0.29493138194084167],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@243",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@243","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@244",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-5.8902292251586914,7.5492420196533203,0],
-			"Materials":["@10"],
-			"Mesh":"@243",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@244"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@245",
-		"state":{
-			"Box":[-0.29493138194084167,-0.29493138194084167,-0.29493138194084167,0.29493138194084167,0.29493138194084167,0.29493138194084167]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@244"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@246",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.34235289692878723,-0.34235289692878723,-0.34235289692878723,0.34235289692878723,0.34235289692878723,0.34235289692878723],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@247",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@247","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@248",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,1.5958640575408936,8.8493413925170898,0],
-			"Materials":["@10"],
-			"Mesh":"@247",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@248"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@249",
-		"state":{
-			"Box":[-0.34235289692878723,-0.34235289692878723,-0.34235289692878723,0.34235289692878723,0.34235289692878723,0.34235289692878723]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@248"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@250",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.31237491965293884,-0.31237491965293884,-0.31237491965293884,0.31237491965293884,0.31237491965293884,0.31237491965293884],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@251",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@251","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@252",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0.69393229484558105,8.6140832901000977,0],
-			"Materials":["@10"],
-			"Mesh":"@251",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@252"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@253",
-		"state":{
-			"Box":[-0.31237491965293884,-0.31237491965293884,-0.31237491965293884,0.31237491965293884,0.31237491965293884,0.31237491965293884]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@252"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@254",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.28239643573760986,-0.28239643573760986,-0.28239643573760986,0.28239643573760986,0.28239643573760986,0.28239643573760986],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@255",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@255","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@256",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.6494903564453125,8.4158868789672852,0],
-			"Materials":["@10"],
-			"Mesh":"@255",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@256"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@257",
-		"state":{
-			"Box":[-0.28239643573760986,-0.28239643573760986,-0.28239643573760986,0.28239643573760986,0.28239643573760986,0.28239643573760986]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@256"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@258",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.22328980267047882,-0.22328980267047882,-0.22328980267047882,0.22328980267047882,0.22328980267047882,0.22328980267047882],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@259",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@259","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@260",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,6.6367030143737793,9.9421215057373047,0],
-			"Materials":["@10"],
-			"Mesh":"@259",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@260"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@261",
-		"state":{
-			"Box":[-0.22328980267047882,-0.22328980267047882,-0.22328980267047882,0.22328980267047882,0.22328980267047882,0.22328980267047882]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@260"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@262",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.28528779745101929,-0.28528779745101929,-0.28528779745101929,0.28528779745101929,0.28528779745101929,0.28528779745101929],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@263",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@263","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@264",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-3.7589318752288818,9.2590084075927734,0],
-			"Materials":["@10"],
-			"Mesh":"@263",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@264"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@265",
-		"state":{
-			"Box":[-0.28528779745101929,-0.28528779745101929,-0.28528779745101929,0.28528779745101929,0.28528779745101929,0.28528779745101929]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@264"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@266",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.13637691736221313,-0.13637691736221313,-0.13637691736221313,0.13637691736221313,0.13637691736221313,0.13637691736221313],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@267",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@267","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@268",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,6.1899595260620117,9.4818401336669922,0],
-			"Materials":["@10"],
-			"Mesh":"@267",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@268"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@269",
-		"state":{
-			"Box":[-0.13637691736221313,-0.13637691736221313,-0.13637691736221313,0.13637691736221313,0.13637691736221313,0.13637691736221313]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@268"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@270",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.45910102128982544,-0.45910102128982544,-0.45910102128982544,0.45910102128982544,0.45910102128982544,0.45910102128982544],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@271",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@271","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@272",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-5.3941488265991211,9.6857919692993164,0],
-			"Materials":["@10"],
-			"Mesh":"@271",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@272"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@273",
-		"state":{
-			"Box":[-0.45910102128982544,-0.45910102128982544,-0.45910102128982544,0.45910102128982544,0.45910102128982544,0.45910102128982544]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@272"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@274",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.47865888476371765,-0.47865888476371765,-0.47865888476371765,0.47865888476371765,0.47865888476371765,0.47865888476371765],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@275",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@275","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@276",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,3.3009119033813477,7.7455434799194336,0],
-			"Materials":["@10"],
-			"Mesh":"@275",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@276"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@277",
-		"state":{
-			"Box":[-0.47865888476371765,-0.47865888476371765,-0.47865888476371765,0.47865888476371765,0.47865888476371765,0.47865888476371765]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@276"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@278",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.43912604451179504,-0.43912604451179504,-0.43912604451179504,0.43912604451179504,0.43912604451179504,0.43912604451179504],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@279",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@279","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@280",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,5.1794500350952148,8.1129598617553711,0],
-			"Materials":["@10"],
-			"Mesh":"@279",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@280"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@281",
-		"state":{
-			"Box":[-0.43912604451179504,-0.43912604451179504,-0.43912604451179504,0.43912604451179504,0.43912604451179504,0.43912604451179504]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@280"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@282",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.18505147099494934,-0.18505147099494934,-0.18505147099494934,0.18505147099494934,0.18505147099494934,0.18505147099494934],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@283",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@283","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@284",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,8.3105688095092773,9.1062412261962891,0],
-			"Materials":["@10"],
-			"Mesh":"@283",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@284"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@285",
-		"state":{
-			"Box":[-0.18505147099494934,-0.18505147099494934,-0.18505147099494934,0.18505147099494934,0.18505147099494934,0.18505147099494934]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@284"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@286",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.47251990437507629,-0.47251990437507629,-0.47251990437507629,0.47251990437507629,0.47251990437507629,0.47251990437507629],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@287",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@287","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@288",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,2.5042598247528076,9.1220712661743164,0],
-			"Materials":["@10"],
-			"Mesh":"@287",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@288"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@289",
-		"state":{
-			"Box":[-0.47251990437507629,-0.47251990437507629,-0.47251990437507629,0.47251990437507629,0.47251990437507629,0.47251990437507629]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@288"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@290",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.15496933460235596,-0.15496933460235596,-0.15496933460235596,0.15496933460235596,0.15496933460235596,0.15496933460235596],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@291",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@291","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@292",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,2.3983871936798096,9.5968122482299805,0],
-			"Materials":["@10"],
-			"Mesh":"@291",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@292"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@293",
-		"state":{
-			"Box":[-0.15496933460235596,-0.15496933460235596,-0.15496933460235596,0.15496933460235596,0.15496933460235596,0.15496933460235596]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@292"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@294",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.43132516741752625,-0.43132516741752625,-0.43132516741752625,0.43132516741752625,0.43132516741752625,0.43132516741752625],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@295",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@295","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@296",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,8.0284624099731445,8.7402467727661133,0],
-			"Materials":["@10"],
-			"Mesh":"@295",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@296"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@297",
-		"state":{
-			"Box":[-0.43132516741752625,-0.43132516741752625,-0.43132516741752625,0.43132516741752625,0.43132516741752625,0.43132516741752625]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@296"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@298",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.19607415795326233,-0.19607415795326233,-0.19607415795326233,0.19607415795326233,0.19607415795326233,0.19607415795326233],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@299",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@299","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@300",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0.20521233975887299,8.6328601837158203,0],
-			"Materials":["@10"],
-			"Mesh":"@299",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@300"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@301",
-		"state":{
-			"Box":[-0.19607415795326233,-0.19607415795326233,-0.19607415795326233,0.19607415795326233,0.19607415795326233,0.19607415795326233]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@300"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@302",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.093941539525985718,-0.093941539525985718,-0.093941539525985718,0.093941539525985718,0.093941539525985718,0.093941539525985718],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@303",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@303","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@304",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.0717306137084961,8.432612419128418,0],
-			"Materials":["@10"],
-			"Mesh":"@303",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@304"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@305",
-		"state":{
-			"Box":[-0.093941539525985718,-0.093941539525985718,-0.093941539525985718,0.093941539525985718,0.093941539525985718,0.093941539525985718]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@304"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@306",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.1630740761756897,-0.1630740761756897,-0.1630740761756897,0.1630740761756897,0.1630740761756897,0.1630740761756897],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@307",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@307","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@308",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,5.1992826461791992,9.121098518371582,0],
-			"Materials":["@10"],
-			"Mesh":"@307",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@308"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@309",
-		"state":{
-			"Box":[-0.1630740761756897,-0.1630740761756897,-0.1630740761756897,0.1630740761756897,0.1630740761756897,0.1630740761756897]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@308"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@310",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.38378995656967163,-0.38378995656967163,-0.38378995656967163,0.38378995656967163,0.38378995656967163,0.38378995656967163],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@311",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@311","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@312",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.6132917404174805,8.3167762756347656,0],
-			"Materials":["@10"],
-			"Mesh":"@311",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@312"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@313",
-		"state":{
-			"Box":[-0.38378995656967163,-0.38378995656967163,-0.38378995656967163,0.38378995656967163,0.38378995656967163,0.38378995656967163]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@312"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@314",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.12912282347679138,-0.12912282347679138,-0.12912282347679138,0.12912282347679138,0.12912282347679138,0.12912282347679138],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@315",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@315","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@316",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,4.5891308784484863,8.4394035339355469,0],
-			"Materials":["@10"],
-			"Mesh":"@315",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@316"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@317",
-		"state":{
-			"Box":[-0.12912282347679138,-0.12912282347679138,-0.12912282347679138,0.12912282347679138,0.12912282347679138,0.12912282347679138]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@316"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@318",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.11677151918411255,-0.11677151918411255,-0.11677151918411255,0.11677151918411255,0.11677151918411255,0.11677151918411255],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@319",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@319","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@320",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-1.4356694221496582,8.1839408874511719,0],
-			"Materials":["@10"],
-			"Mesh":"@319",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@320"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@321",
-		"state":{
-			"Box":[-0.11677151918411255,-0.11677151918411255,-0.11677151918411255,0.11677151918411255,0.11677151918411255,0.11677151918411255]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@320"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@322",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.36030858755111694,-0.36030858755111694,-0.36030858755111694,0.36030858755111694,0.36030858755111694,0.36030858755111694],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@323",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@323","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@324",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,4.4912629127502441,8.4401454925537109,0],
-			"Materials":["@10"],
-			"Mesh":"@323",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@324"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@325",
-		"state":{
-			"Box":[-0.36030858755111694,-0.36030858755111694,-0.36030858755111694,0.36030858755111694,0.36030858755111694,0.36030858755111694]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@324"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@326",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.065757937729358673,-0.065757937729358673,-0.065757937729358673,0.065757937729358673,0.065757937729358673,0.065757937729358673],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@327",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@327","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@328",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.79060596227645874,7.1734323501586914,0],
-			"Materials":["@10"],
-			"Mesh":"@327",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@328"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@329",
-		"state":{
-			"Box":[-0.065757937729358673,-0.065757937729358673,-0.065757937729358673,0.065757937729358673,0.065757937729358673,0.065757937729358673]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@328"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@330",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.26168039441108704,-0.26168039441108704,-0.26168039441108704,0.26168039441108704,0.26168039441108704,0.26168039441108704],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@331",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@331","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@332",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,5.0893325805664063,9.6375465393066406,0],
-			"Materials":["@10"],
-			"Mesh":"@331",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@332"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@333",
-		"state":{
-			"Box":[-0.26168039441108704,-0.26168039441108704,-0.26168039441108704,0.26168039441108704,0.26168039441108704,0.26168039441108704]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@332"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@334",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.2265356034040451,-0.2265356034040451,-0.2265356034040451,0.2265356034040451,0.2265356034040451,0.2265356034040451],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@335",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@335","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@336",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,7.3407096862792969,9.4439859390258789,0],
-			"Materials":["@10"],
-			"Mesh":"@335",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@336"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@337",
-		"state":{
-			"Box":[-0.2265356034040451,-0.2265356034040451,-0.2265356034040451,0.2265356034040451,0.2265356034040451,0.2265356034040451]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@336"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@338",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.13354988396167755,-0.13354988396167755,-0.13354988396167755,0.13354988396167755,0.13354988396167755,0.13354988396167755],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@339",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@339","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@340",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,6.6727972030639648,8.3127346038818359,0],
-			"Materials":["@10"],
-			"Mesh":"@339",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@340"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@341",
-		"state":{
-			"Box":[-0.13354988396167755,-0.13354988396167755,-0.13354988396167755,0.13354988396167755,0.13354988396167755,0.13354988396167755]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@340"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@342",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.07653382420539856,-0.07653382420539856,-0.07653382420539856,0.07653382420539856,0.07653382420539856,0.07653382420539856],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@343",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@343","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@344",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-3.6110544204711914,8.3585414886474609,0],
-			"Materials":["@10"],
-			"Mesh":"@343",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@344"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@345",
-		"state":{
-			"Box":[-0.07653382420539856,-0.07653382420539856,-0.07653382420539856,0.07653382420539856,0.07653382420539856,0.07653382420539856]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@344"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@346",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.31505244970321655,-0.31505244970321655,-0.31505244970321655,0.31505244970321655,0.31505244970321655,0.31505244970321655],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@347",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@347","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@348",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.18150025606155396,9.5987377166748047,0],
-			"Materials":["@10"],
-			"Mesh":"@347",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@348"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@349",
-		"state":{
-			"Box":[-0.31505244970321655,-0.31505244970321655,-0.31505244970321655,0.31505244970321655,0.31505244970321655,0.31505244970321655]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@348"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@350",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.21007496118545532,-0.21007496118545532,-0.21007496118545532,0.21007496118545532,0.21007496118545532,0.21007496118545532],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@351",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@351","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@352",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0.23240843415260315,7.884124755859375,0],
-			"Materials":["@10"],
-			"Mesh":"@351",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@352"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@353",
-		"state":{
-			"Box":[-0.21007496118545532,-0.21007496118545532,-0.21007496118545532,0.21007496118545532,0.21007496118545532,0.21007496118545532]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@352"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@354",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.20236437022686005,-0.20236437022686005,-0.20236437022686005,0.20236437022686005,0.20236437022686005,0.20236437022686005],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@355",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@355","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@356",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,3.1728255748748779,9.597966194152832,0],
-			"Materials":["@10"],
-			"Mesh":"@355",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@356"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@357",
-		"state":{
-			"Box":[-0.20236437022686005,-0.20236437022686005,-0.20236437022686005,0.20236437022686005,0.20236437022686005,0.20236437022686005]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@356"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@358",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.24209196865558624,-0.24209196865558624,-0.24209196865558624,0.24209196865558624,0.24209196865558624,0.24209196865558624],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@359",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@359","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@360",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-8.3090534210205078,8.9617700576782227,0],
-			"Materials":["@10"],
-			"Mesh":"@359",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@360"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@361",
-		"state":{
-			"Box":[-0.24209196865558624,-0.24209196865558624,-0.24209196865558624,0.24209196865558624,0.24209196865558624,0.24209196865558624]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@360"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@362",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.46977490186691284,-0.46977490186691284,-0.46977490186691284,0.46977490186691284,0.46977490186691284,0.46977490186691284],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@363",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@363","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@364",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-0.46249479055404663,8.1743278503417969,0],
-			"Materials":["@10"],
-			"Mesh":"@363",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@364"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@365",
-		"state":{
-			"Box":[-0.46977490186691284,-0.46977490186691284,-0.46977490186691284,0.46977490186691284,0.46977490186691284,0.46977490186691284]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@364"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@366",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.20904302597045898,-0.20904302597045898,-0.20904302597045898,0.20904302597045898,0.20904302597045898,0.20904302597045898],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@367",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@367","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@368",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,8.0808038711547852,9.7283840179443359,0],
-			"Materials":["@10"],
-			"Mesh":"@367",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@368"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@369",
-		"state":{
-			"Box":[-0.20904302597045898,-0.20904302597045898,-0.20904302597045898,0.20904302597045898,0.20904302597045898,0.20904302597045898]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@368"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@370",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.17086820304393768,-0.17086820304393768,-0.17086820304393768,0.17086820304393768,0.17086820304393768,0.17086820304393768],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@371",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@371","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@372",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,9.8186283111572266,9.1687183380126953,0],
-			"Materials":["@10"],
-			"Mesh":"@371",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@372"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@373",
-		"state":{
-			"Box":[-0.17086820304393768,-0.17086820304393768,-0.17086820304393768,0.17086820304393768,0.17086820304393768,0.17086820304393768]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@372"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@374",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.14717906713485718,-0.14717906713485718,-0.14717906713485718,0.14717906713485718,0.14717906713485718,0.14717906713485718],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@375",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@375","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@376",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,5.469947338104248,9.9470634460449219,0],
-			"Materials":["@10"],
-			"Mesh":"@375",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@376"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@377",
-		"state":{
-			"Box":[-0.14717906713485718,-0.14717906713485718,-0.14717906713485718,0.14717906713485718,0.14717906713485718,0.14717906713485718]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@376"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@378",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.32369214296340942,-0.32369214296340942,-0.32369214296340942,0.32369214296340942,0.32369214296340942,0.32369214296340942],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@379",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@379","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@380",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-1.4877570867538452,9.922541618347168,0],
-			"Materials":["@10"],
-			"Mesh":"@379",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@380"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@381",
-		"state":{
-			"Box":[-0.32369214296340942,-0.32369214296340942,-0.32369214296340942,0.32369214296340942,0.32369214296340942,0.32369214296340942]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@380"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@382",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.11364439129829407,-0.11364439129829407,-0.11364439129829407,0.11364439129829407,0.11364439129829407,0.11364439129829407],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@383",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@383","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@384",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,8.9073028564453125,8.1290397644042969,0],
-			"Materials":["@10"],
-			"Mesh":"@383",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@384"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@385",
-		"state":{
-			"Box":[-0.11364439129829407,-0.11364439129829407,-0.11364439129829407,0.11364439129829407,0.11364439129829407,0.11364439129829407]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@384"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@386",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.22997665405273438,-0.22997665405273438,-0.22997665405273438,0.22997665405273438,0.22997665405273438,0.22997665405273438],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@387",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@387","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@388",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-1.5642279386520386,8.7618074417114258,0],
-			"Materials":["@10"],
-			"Mesh":"@387",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@388"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@389",
-		"state":{
-			"Box":[-0.22997665405273438,-0.22997665405273438,-0.22997665405273438,0.22997665405273438,0.22997665405273438,0.22997665405273438]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@388"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@390",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.26856592297554016,-0.26856592297554016,-0.26856592297554016,0.26856592297554016,0.26856592297554016,0.26856592297554016],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@391",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@391","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@392",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-4.3553171157836914,9.1539344787597656,0],
-			"Materials":["@10"],
-			"Mesh":"@391",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@392"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@393",
-		"state":{
-			"Box":[-0.26856592297554016,-0.26856592297554016,-0.26856592297554016,0.26856592297554016,0.26856592297554016,0.26856592297554016]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@392"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@394",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.29070094227790833,-0.29070094227790833,-0.29070094227790833,0.29070094227790833,0.29070094227790833,0.29070094227790833],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@395",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@395","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@396",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,4.6913819313049316,7.5591130256652832,0],
-			"Materials":["@10"],
-			"Mesh":"@395",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@396"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@397",
-		"state":{
-			"Box":[-0.29070094227790833,-0.29070094227790833,-0.29070094227790833,0.29070094227790833,0.29070094227790833,0.29070094227790833]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@396"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@398",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.24453689157962799,-0.24453689157962799,-0.24453689157962799,0.24453689157962799,0.24453689157962799,0.24453689157962799],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@399",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@399","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@400",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-7.1798892021179199,8.8550558090209961,0],
-			"Materials":["@10"],
-			"Mesh":"@399",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@400"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@401",
-		"state":{
-			"Box":[-0.24453689157962799,-0.24453689157962799,-0.24453689157962799,0.24453689157962799,0.24453689157962799,0.24453689157962799]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@400"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@402",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.29759183526039124,-0.29759183526039124,-0.29759183526039124,0.29759183526039124,0.29759183526039124,0.29759183526039124],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@403",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@403","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@404",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-2.0833926200866699,7.8226127624511719,0],
-			"Materials":["@10"],
-			"Mesh":"@403",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@404"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@405",
-		"state":{
-			"Box":[-0.29759183526039124,-0.29759183526039124,-0.29759183526039124,0.29759183526039124,0.29759183526039124,0.29759183526039124]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@404"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@406",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[-0.065127462148666382,-0.065127462148666382,-0.065127462148666382,0.065127462148666382,0.065127462148666382,0.065127462148666382],1,1,1],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@407",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@407","@10",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@408",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-3.1725006103515625,9.1825695037841797,0],
-			"Materials":["@10"],
-			"Mesh":"@407",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@408"],
-			"decl":"mojo3d.BoxCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@409",
-		"state":{
-			"Box":[-0.065127462148666382,-0.065127462148666382,-0.065127462148666382,0.065127462148666382,0.065127462148666382,0.065127462148666382]
-		},
-		"type":"mojo3d.BoxCollider"
-	},{
-		"ctor":{
-			"args":["@408"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@410",
-		"state":{
-			"Restitution":0.10000000149011612
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":[[1,0,0,1],1,1,false],
-			"decl":"mojo3d.PbrMaterial.New",
-			"type":"Void(std.graphics.Color,Float,Float,Bool)"
-		},
-		"id":"@411",
-		"state":{
-
-		},
-		"type":"mojo3d.PbrMaterial"
-	},{
-		"ctor":{
-			"args":[[-1,-1,-1,1,1,1],8,8,8],
-			"decl":"mojo3d.Mesh.CreateBox",
-			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
-		},
-		"id":"@412",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@412","@411",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@413",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,-4,1,0],
-			"Materials":["@411"],
-			"Mesh":"@412",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":[[1,0,0,1],1,1,false],
-			"decl":"mojo3d.PbrMaterial.New",
-			"type":"Void(std.graphics.Color,Float,Float,Bool)"
-		},
-		"id":"@414",
-		"state":{
-
-		},
-		"type":"mojo3d.PbrMaterial"
-	},{
-		"ctor":{
-			"args":[1,32,32],
-			"decl":"mojo3d.Mesh.CreateSphere",
-			"type":"mojo3d.Mesh(Float,Int,Int)"
-		},
-		"id":"@415",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@415","@414",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@416",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0,1,0],
-			"Materials":["@414"],
-			"Mesh":"@415",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":[[1,0,0,1],1,1,false],
-			"decl":"mojo3d.PbrMaterial.New",
-			"type":"Void(std.graphics.Color,Float,Float,Bool)"
-		},
-		"id":"@417",
-		"state":{
-
-		},
-		"type":"mojo3d.PbrMaterial"
-	},{
-		"ctor":{
-			"args":[1,2,1,32],
-			"decl":"mojo3d.Mesh.CreateCone",
-			"type":"mojo3d.Mesh(Float,Float,std.geom.Axis,Int)"
-		},
-		"id":"@418",
-		"state":{
-
-		},
-		"type":"mojo3d.Mesh"
-	},{
-		"ctor":{
-			"args":["@418","@417",null],
-			"decl":"mojo3d.Model.New",
-			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
-		},
-		"id":"@419",
-		"state":{
-			"LocalMatrix":[1,0,0,0,1,0,0,0,1,4,1,0],
-			"Materials":["@417"],
-			"Mesh":"@418",
-			"Visible":true
-		},
-		"type":"mojo3d.Model"
-	},{
-		"ctor":{
-			"args":["@413"],
-			"decl":"mojo3d.MeshCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@420",
-		"state":{
-			"Mesh":"@412"
-		},
-		"type":"mojo3d.MeshCollider"
-	},{
-		"ctor":{
-			"args":["@413"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@421",
-		"state":{
-			"Mass":0
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":["@416"],
-			"decl":"mojo3d.MeshCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@422",
-		"state":{
-			"Mesh":"@415"
-		},
-		"type":"mojo3d.MeshCollider"
-	},{
-		"ctor":{
-			"args":["@416"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@423",
-		"state":{
-			"Mass":0
-		},
-		"type":"mojo3d.RigidBody"
-	},{
-		"ctor":{
-			"args":["@419"],
-			"decl":"mojo3d.MeshCollider.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@424",
-		"state":{
-			"Mesh":"@418"
-		},
-		"type":"mojo3d.MeshCollider"
-	},{
-		"ctor":{
-			"args":["@419"],
-			"decl":"mojo3d.RigidBody.New",
-			"type":"Void(mojo3d.Entity)"
-		},
-		"id":"@425",
-		"state":{
-			"Mass":0
-		},
-		"type":"mojo3d.RigidBody"
-	}]
-}

+ 1 - 1
modules/bullet/bullet.monkey2

@@ -371,7 +371,7 @@ Class btHeightfieldTerrainShape Extends btConcaveShape
 
 
 	Method setUseDiamondSubdivision( useDiamondSubdivision:Bool=True )	
 	Method setUseDiamondSubdivision( useDiamondSubdivision:Bool=True )	
 
 
-	Method setUseZigZagSubdivision( useZigZagSubdivision:Bool=True )	
+	Method setUseZigzagSubdivision( useZigZagSubdivision:Bool=True )	
 End
 End
 
 
 Class btTriangleMeshShape Extends btConcaveShape
 Class btTriangleMeshShape Extends btConcaveShape

+ 52 - 6
modules/mojo/graphics/canvas.monkey2

@@ -1258,14 +1258,53 @@ Class Canvas
 	Method CopyPixmap:Pixmap( rect:Recti )
 	Method CopyPixmap:Pixmap( rect:Recti )
 		DebugAssert( Not _lighting,"Canvas.CopyPixmap() cannot be used while lighting" )
 		DebugAssert( Not _lighting,"Canvas.CopyPixmap() cannot be used while lighting" )
 		If _lighting Return Null
 		If _lighting Return Null
+		
+		Local pixmap:=New Pixmap( rect.Width,rect.Height,PixelFormat.RGBA32 )
+		
+		CopyPixels( rect,pixmap )
+		
+		Return pixmap
+	End
 	
 	
+	#rem monkeydoc Copies a rectangular region of pixels to a pixmap.
+	#end
+	Method CopyPixels( rect:Recti,pixmap:Pixmap,dstx:Int=0,dsty:Int=0 )
+		DebugAssert( Not _lighting,"Canvas.CopyPixels() cannot be used while lighting" )
+		If _lighting Return
+
 		Flush()
 		Flush()
 		
 		
 		rect=TransformRecti( rect,_rmatrix ) & _rbounds
 		rect=TransformRecti( rect,_rmatrix ) & _rbounds
 		
 		
-		Local pixmap:=_device.CopyPixmap( rect )
+		_device.CopyPixels( rect,pixmap,dstx,dsty )
+	End
+	
+	#rem monkeydoc Gets a pixel color.
+	
+	Returns the color of the pixel at the given coordinates.
+	
+	#end
+	Method GetPixel:Color( x:Int,y:Int )
+		
+		Flush()
 		
 		
-		Return pixmap
+		CopyPixels( New Recti( x,y,x+1,y+1 ),_tmpPixmap1x1 )
+		
+		Return _tmpPixmap1x1.GetPixel( 0,0 )
+	End
+	
+	#rem monkeydoc Gets a pixel color.
+	
+	Returns the ARGB color of the pixel at the given coordinates.
+	
+	#end
+	Method GetPixelARGB:UInt( x:Int,y:Int )
+
+		Flush()
+		
+		CopyPixels( New Recti( x,y,x+1,y+1 ),_tmpPixmap1x1 )
+		
+		Return _tmpPixmap1x1.GetPixelARGB( 0,0 )
 	End
 	End
 	
 	
 	#rem monkeydoc Clears the viewport.
 	#rem monkeydoc Clears the viewport.
@@ -1284,7 +1323,7 @@ Class Canvas
 		Validate()
 		Validate()
 			
 			
 		_device.Clear( color )
 		_device.Clear( color )
-
+		
 		_drawNV=0
 		_drawNV=0
 		_drawOps.Clear()
 		_drawOps.Clear()
 		_drawOp=New DrawOp
 		_drawOp=New DrawOp
@@ -1299,9 +1338,10 @@ Class Canvas
 	#end
 	#end
 	Method Flush()
 	Method Flush()
 		
 		
-		_device.FlushTarget()
-	
-		If _drawOps.Empty Return
+		If _drawOps.Empty 
+			_device.FlushTarget()
+			Return
+		Endif
 		
 		
 		Validate()
 		Validate()
 		
 		
@@ -1333,6 +1373,8 @@ Class Canvas
 			
 			
 		Endif
 		Endif
 		
 		
+		_device.FlushTarget()
+		
 		_drawVP0=Cast<Vertex2f Ptr>( _drawVB.Lock() )
 		_drawVP0=Cast<Vertex2f Ptr>( _drawVB.Lock() )
 		_drawNV=0
 		_drawNV=0
 		_drawOps.Clear()
 		_drawOps.Clear()
@@ -1489,6 +1531,8 @@ Class Canvas
 		Field firstVert:Int
 		Field firstVert:Int
 	End
 	End
 	
 	
+	Global _tmpPixmap1x1:Pixmap
+	
 	Global _quadIndices:IndexBuffer
 	Global _quadIndices:IndexBuffer
 	Global _shadowVB:VertexBuffer
 	Global _shadowVB:VertexBuffer
 	Global _defaultFont:Font
 	Global _defaultFont:Font
@@ -1562,6 +1606,8 @@ Class Canvas
 		Global inited:=False
 		Global inited:=False
 		If inited Return
 		If inited Return
 		inited=True
 		inited=True
+		
+		_tmpPixmap1x1=New Pixmap( 1,1,PixelFormat.RGBA8 )
 
 
 		Local nquads:=MaxVertices/4
 		Local nquads:=MaxVertices/4
 		
 		

+ 13 - 9
modules/mojo/graphics/graphicsdevice.monkey2

@@ -263,19 +263,21 @@ Class GraphicsDevice
 		Return _ublocks[block]
 		Return _ublocks[block]
 	End
 	End
 	
 	
-	Method CopyPixmap:Pixmap( rect:Recti )
-	
-		Validate()
-
-		Local pixmap:=New Pixmap( rect.Width,rect.Height,PixelFormat.RGBA32 )
+	Method CopyPixels( rect:Recti,pixmap:Pixmap,dstx:Int,dsty:Int )
 		
 		
-		glReadPixels( rect.X,rect.Y,rect.Width,rect.Height,GL_RGBA,GL_UNSIGNED_BYTE,pixmap.Data )
+		Validate()
 		
 		
-		If Not _rtarget pixmap.FlipY()
+		glReadPixels( rect.X,rect.Y,rect.Width,rect.Height,GL_RGBA,GL_UNSIGNED_BYTE,pixmap.PixelPtr( dstx,dsty ) )
 		
 		
-		Return pixmap
+		If Not _rtarget And rect.Height>1
+			If rect.min.x<>0 Or rect.min.y<>0 Or rect.Size<>_rtargetSize
+				pixmap.Window( rect.X,rect.Y,rect.Width,rect.Height ).FlipY()
+			Else
+				pixmap.FlipY()
+			End
+		Endif
 	End
 	End
-
+	
 	Method Clear( color:Color,depth:Float=1 )
 	Method Clear( color:Color,depth:Float=1 )
 		
 		
 		Validate()
 		Validate()
@@ -366,6 +368,8 @@ Class GraphicsDevice
 
 
 	Method FlushTarget()
 	Method FlushTarget()
 		
 		
+		'Print "GraphicsDevice.FlushTarget _modified="+_modified
+		
 		If Not _modified Return
 		If Not _modified Return
 		
 		
 		_modified=False
 		_modified=False

+ 23 - 0
modules/mojo/graphics/image.monkey2

@@ -284,6 +284,8 @@ Class Image Extends Resource
 	
 	
 		_textures[index]=texture
 		_textures[index]=texture
 		
 		
+		If Not index _managed=texture?.ManagedPixmap
+		
 		_uniforms.SetTexture( "ImageTexture"+index,texture )
 		_uniforms.SetTexture( "ImageTexture"+index,texture )
 	End
 	End
 	
 	
@@ -293,6 +295,26 @@ Class Image Extends Resource
 	
 	
 		Return _textures[index]
 		Return _textures[index]
 	End
 	End
+
+	#rem monkeydoc Gets a pixel color.
+	
+	Returns the color of the pixel at the given coordinates.
+	
+	#end
+	Method GetPixel:Color( x:Int,y:Int )
+		
+		Return _managed.GetPixel( x,y )
+	End
+	
+	#rem monkeydoc Gets a pixel color.
+	
+	Returns the ARGB color of the pixel at the given coordinates.
+	
+	#end
+	Method GetPixelARGB:UInt( x:Int,y:Int )
+		
+		Return _managed.GetPixelARGB( x,y )
+	End
 	
 	
 	#rem monkeydoc Loads an image from file.
 	#rem monkeydoc Loads an image from file.
 	#end
 	#end
@@ -411,6 +433,7 @@ Class Image Extends Resource
 	Field _shader:Shader
 	Field _shader:Shader
 	Field _uniforms:UniformBlock
 	Field _uniforms:UniformBlock
 	Field _textures:=New Texture[4]
 	Field _textures:=New Texture[4]
+	Field _managed:Pixmap
 	Field _blendMode:BlendMode
 	Field _blendMode:BlendMode
 	Field _shadowCaster:ShadowCaster
 	Field _shadowCaster:ShadowCaster
 	
 	

+ 6 - 0
modules/mojo/graphics/texture.monkey2

@@ -281,6 +281,11 @@ Class Texture Extends Resource
 		_dirty|=Dirty.TexParams
 		_dirty|=Dirty.TexParams
 	End
 	End
 	
 	
+	Property ManagedPixmap:Pixmap()
+		
+		Return _managed
+	End
+	
 	Method PastePixmap( pixmap:Pixmap,x:Int,y:Int )
 	Method PastePixmap( pixmap:Pixmap,x:Int,y:Int )
 		
 		
 		If _managed
 		If _managed
@@ -401,6 +406,7 @@ Class Texture Extends Resource
 	Method Modified( r:Recti )
 	Method Modified( r:Recti )
 		
 		
 		If _managed 
 		If _managed 
+			Print "Texture Modified - Update managed"
 			glReadPixels( r.X,r.Y,r.Width,r.Height,GL_RGBA,GL_UNSIGNED_BYTE,_managed.PixelPtr( r.X,r.Y ) )
 			glReadPixels( r.X,r.Y,r.Width,r.Height,GL_RGBA,GL_UNSIGNED_BYTE,_managed.PixelPtr( r.X,r.Y ) )
 		Endif
 		Endif
 
 

+ 89 - 8
modules/mojo3d/scene/components/collider.monkey2

@@ -700,21 +700,102 @@ Class MeshCollider Extends ConcaveCollider
 	
 	
 End
 End
 
 
-#rem
 Class TerrainCollider Extends ConcaveCollider
 Class TerrainCollider Extends ConcaveCollider
 
 
-	Method New( box:Boxf,data:Pixmap )
+	Method New( entity:Entity )
+		
+		Super.New( entity )
+		
+		Bounds=New Boxf( -1,1 )
+		
+		AddInstance()
+	End
 	
 	
-		Local shape:=New btHeightfieldTerrainShape( data.Width,data.Height,data.Data,1.0/255.0,0.0,1.0,1,PHY_UCHAR,False )
+	Method New( entity:Entity,collider:TerrainCollider )
 		
 		
-		shape.setUseDiamondSubdivision( True )
+		Super.New( entity,collider )
+		
+		Heightmap=collider.Heightmap
+		Bounds=collider.Bounds
+		UseDiamondSubdivision=collider.UseDiamondSubdivision
+		UseZigzagSubdivision=collider.UseZigzagSubdivision
+		
+		AddInstance( collider )
+	End
+	
+	Property Heightmap:Pixmap()
 		
 		
-		_btshape=shape
+		Return _heightmap
 		
 		
-		_btshape.setLocalScaling( New Vec3f( box.Width/data.Width,box.Height,box.Depth/data.Height ) )
+	Setter( heightmap:Pixmap )
 		
 		
-		SetOrigin( box.Center )
+		If heightmap=_heightmap Return
+		
+		Assert( heightmap.Format=PixelFormat.I8,"Heightmap must be in I8 format" )
+		
+		_heightmap=heightmap
+		
+		Invalidate()
+		
+		_shape=Null
+	End
+	
+	Property Bounds:Boxf()
+		
+		Return _bounds
+	
+	Setter( bounds:Boxf )
+		
+		_bounds=bounds
+		
+		Invalidate()
 	End
 	End
+	
+	Property UseDiamondSubdivision:Bool()
+		
+		Return _diamondSubdiv
+		
+	Setter( diamondSubdiv:Bool )
+			
+		_diamondSubdiv=diamondSubdiv
+		
+		If _shape _shape.setUseDiamondSubdivision( _diamondSubdiv )
+	End
+	
+	Property UseZigzagSubdivision:Bool()
+		
+		Return _zigzagSubdiv
+	
+	Setter( zigzagSubdiv:Bool )
+		
+		_zigzagSubdiv=zigzagSubdiv
+
+		If _shape _shape.setUseZigzagSubdivision( _zigzagSubdiv )
+	End
+	
+	Protected
+	
+	Method OnCreate:btCollisionShape() Override
+		
+		If Not _shape
+			_shape=New btHeightfieldTerrainShape( _heightmap.Width,_heightmap.Height,_heightmap.Data,1.0/255.0,0.0,1.0,1,PHY_UCHAR,False )
+			_shape.setUseDiamondSubdivision( _diamondSubdiv )
+			_shape.setUseZigzagSubdivision( _zigzagSubdiv )
+		Endif
+		
+		_shape.setLocalScaling( New Vec3f( _bounds.Width/_heightmap.Width,_bounds.Height,_bounds.Depth/_heightmap.Height ) )
+		
+		Return SetOrigin( _shape,_bounds.Center )
+	End
+	
+	Private
+	
+	Field _heightmap:Pixmap
+	Field _bounds:Boxf
+	
+	Field _diamondSubdiv:Bool
+	Field _zigzagSubdiv:Bool
+	
+	Field _shape:btHeightfieldTerrainShape
 
 
 End
 End
-#end

+ 6 - 8
modules/mojo3d/scene/entities/model.monkey2

@@ -126,7 +126,7 @@ Class Model Extends Renderable
 		
 		
 		Local editing:=scene.Editing
 		Local editing:=scene.Editing
 		
 		
-		scene.Editing=False
+		If editing scene.Jsonifier.BeginLoading()
 		
 		
 		Local model:Model
 		Local model:Model
 		
 		
@@ -134,14 +134,12 @@ Class Model Extends Renderable
 			
 			
 			model=loader.LoadModel( path )
 			model=loader.LoadModel( path )
 			
 			
-			If Not model Continue
-			
-			If editing scene.Jsonifier.AddInstance( model,"mojo3d.Model.Load",New Variant[]( path )  )
-				
-			Exit
+			If model Exit
 		Next
 		Next
-
-		scene.Editing=editing
+		
+		If editing scene.Jsonifier.EndLoading()
+		
+		If editing scene.Jsonifier.AddInstance( model,"mojo3d.Model.Load",New Variant[]( path )  )
 		
 		
 		Return model
 		Return model
 	End
 	End

+ 19 - 10
modules/mojo3d/scene/entities/sprite.monkey2

@@ -27,12 +27,13 @@ Class Sprite Extends Renderable
 		Name="Sprite"
 		Name="Sprite"
 		
 		
 		AddInstance()
 		AddInstance()
+		
+		Visible=True
 	End
 	End
 
 
 	Method New( material:Material,parent:Entity=Null )
 	Method New( material:Material,parent:Entity=Null )
-		Self.New( parent )
 		
 		
-		_material=material
+		Super.New( parent )
 		
 		
 		Name="Sprite"
 		Name="Sprite"
 		Material=material
 		Material=material
@@ -42,6 +43,17 @@ Class Sprite Extends Renderable
 		Visible=True
 		Visible=True
 	End
 	End
 
 
+	Method New( sprite:Sprite,parent:Entity )
+		
+		Super.New( sprite,parent )
+		
+		_material=sprite._material
+		_handle=sprite._handle
+		_mode=sprite._mode
+		
+		AddInstance( sprite )
+	End
+	
 	#rem monkeydoc Copies the sprite.
 	#rem monkeydoc Copies the sprite.
 	#end	
 	#end	
 	Method Copy:Sprite( parent:Entity=Null ) Override
 	Method Copy:Sprite( parent:Entity=Null ) Override
@@ -58,6 +70,7 @@ Class Sprite Extends Renderable
 	This must currently be an instance of a SpriteMaterial.
 	This must currently be an instance of a SpriteMaterial.
 	
 	
 	#end	
 	#end	
+	[jsonify=1]
 	Property Material:Material()
 	Property Material:Material()
 		
 		
 		Return _material
 		Return _material
@@ -70,6 +83,7 @@ Class Sprite Extends Renderable
 	#rem monkeydoc Rect within texture to draw.
 	#rem monkeydoc Rect within texture to draw.
 	
 	
 	#end	
 	#end	
+	[jsonify=1]
 	Property TextureRect:Rectf()
 	Property TextureRect:Rectf()
 		
 		
 		Return _textureRect
 		Return _textureRect
@@ -84,6 +98,7 @@ Class Sprite Extends Renderable
 	Defaults to 0.5,0.5.
 	Defaults to 0.5,0.5.
 	
 	
 	#end
 	#end
+	[jsonify=1]
 	Property Handle:Vec2f()
 	Property Handle:Vec2f()
 		
 		
 		Return _handle
 		Return _handle
@@ -98,6 +113,7 @@ Class Sprite Extends Renderable
 	Defaults to SpriteMode.Billboard.
 	Defaults to SpriteMode.Billboard.
 	
 	
 	#end
 	#end
+	[jsonify=1]
 	Property Mode:SpriteMode()
 	Property Mode:SpriteMode()
 		
 		
 		Return _mode
 		Return _mode
@@ -109,15 +125,8 @@ Class Sprite Extends Renderable
 	
 	
 	Protected
 	Protected
 
 
-	Method New( sprite:Sprite,parent:Entity )
-		Super.New( sprite,parent )
-		
-		_material=sprite._material
-		_handle=sprite._handle
-		_mode=sprite._mode
-	End
-	
 	Method OnRender( rq:RenderQueue ) Override
 	Method OnRender( rq:RenderQueue ) Override
+		
 		rq.AddSpriteOp( Self )
 		rq.AddSpriteOp( Self )
 	End
 	End
 	
 	

+ 140 - 80
modules/mojo3d/scene/jsonifier/jsonifier.monkey2

@@ -2,64 +2,93 @@ Namespace mojo3d.jsonifier
 
 
 Class Jsonifier
 Class Jsonifier
 
 
+Private
+	
+	Class Instance
+		Field id:Int
+		Field obj:Variant
+		Field ctor:Invocation
+		Field initialState:JsonObject
+		
+		Operator To:String()
+			Return "Instance(type="+obj.Type+" dynamic type="+obj.DynamicType+")"
+		End
+	End
+	
+	Field _loading:Int
+	Field _instLoading:Int
+	Field _instsByObj:=New Map<Object,Instance>
+	Field _insts:=New Stack<Instance>
+	
+Public
+
+	Method BeginLoading()
+		
+		_loading+=1
+
+		If _loading>1 Return
+
+		_instLoading=_insts.Length
+	End
+	
+	Method EndLoading()
+		
+		_loading-=1
+		
+		If _loading Return
+		
+		For Local i:=_instLoading Until _insts.Length
+			Local inst:=_insts[i]
+			Local tobj:=Cast<Object>( inst.obj )
+			inst.initialState=JsonifyState( tobj )
+		next
+	End
+	
 	Method AddInstance( obj:Variant,ctor:Invocation )
 	Method AddInstance( obj:Variant,ctor:Invocation )
 		
 		
 		Local tobj:=Cast<Object>( obj )
 		Local tobj:=Cast<Object>( obj )
 		
 		
-		Assert( Not _instsByObj.Contains( tobj ) )
-		
-		Local inst:=New Instance
+		Local inst:=_instsByObj[tobj]
+		If inst
+			If inst.ctor Print "Warning: overwriting instance ctor for "+inst
+			inst.ctor=ctor
+			Return
+		Endif
+			
+		inst=New Instance
+		inst.id=_insts.Length
 		inst.obj=obj
 		inst.obj=obj
-		inst.id="@"+String(_insts.Length)
-		inst.ctor=ctor
-		inst.initialState=JsonifyState( tobj )
 		
 		
-		_instsByObj[tobj]=inst
-		_instsById[inst.id]=inst
-
 		_insts.Add( inst )
 		_insts.Add( inst )
-	End
-
-	'ctor via ctor
-	Method AddInstance( obj:Variant,args:Variant[] )
+		_instsByObj[tobj]=inst
 		
 		
-		AddInstance( obj,New Invocation( obj.DynamicType,"New",Null,args ) )
-	end
+		If _loading Return
 
 
-	'ctor via method call
-	Method AddInstance( obj:Variant,decl:String,inst:Variant,args:Variant[] )
-		
-		AddInstance( obj,New Invocation( decl,inst,args ) )
+		inst.ctor=ctor
+		inst.initialState=JsonifyState( tobj )
 	End
 	End
-
-	'ctor via function call
-	Method AddInstance( obj:Variant,decl:String,args:Variant[] )
+	
+	Method JsonifyInstances:JsonObject( assetsDir:String="" )
 		
 		
-		AddInstance( obj,New Invocation( decl,Null,args ) )
-	End
-
-	Method JsonifyInstances:JsonObject()
+		If Not assetsDir assetsDir=AssetsDir()
 		
 		
 		Local jobj:=New JsonObject
 		Local jobj:=New JsonObject
 		
 		
-		jobj["assetsDir"]=New JsonString( AssetsDir() )
+		jobj["assetsDir"]=New JsonString( assetsDir )
 		
 		
-		Local jinsts:=New JsonArray( _insts.Length )
+		Local jinsts:=New Stack<JsonValue>
 		
 		
 		For Local i:=0 Until _insts.Length
 		For Local i:=0 Until _insts.Length
 			
 			
-			Local jobj:=New JsonObject
+'			Print "Jsonifying "+i
 			
 			
 			Local inst:=_insts[i]
 			Local inst:=_insts[i]
 			Local tobj:=Cast<Object>( inst.obj )
 			Local tobj:=Cast<Object>( inst.obj )
+
+			'compute delta state
+			Local state:=JsonifyState( tobj )
 			
 			
-			jobj["id"]=New JsonString( inst.id )
-			
-			jobj["type"]=New JsonString( tobj.DynamicType.Name )
-			
-			jobj["ctor"]=Jsonify( inst.ctor )
-			
-			Local state:=JsonifyState( tobj ),dstate:=New JsonObject
+			Local dstate:=New JsonObject
 			
 			
 			For Local it:=Eachin state.All()
 			For Local it:=Eachin state.All()
 				
 				
@@ -69,12 +98,19 @@ Class Jsonifier
 				If CompareJson( x,y )<>0 dstate[it.Key]=x
 				If CompareJson( x,y )<>0 dstate[it.Key]=x
 			Next
 			Next
 			
 			
-			jobj["state"]=dstate
+			If Not inst.ctor And dstate.Empty Continue
+			
+			Local jobj:=New JsonObject
+			jobj["type"]=New JsonString( tobj.DynamicType.Name )	'not actually used, cool for debug
+			
+			jobj["id"]=New JsonNumber( inst.id )
+			If inst.ctor jobj["ctor"]=Jsonify( inst.ctor )
+			If Not dstate.Empty jobj["state"]=dstate
 				
 				
-			jinsts[i]=jobj
+			jinsts.Add( jobj )
 		Next
 		Next
 
 
-		jobj["instances"]=jinsts
+		jobj["instances"]=New JsonArray( jinsts )
 		
 		
 		Return jobj
 		Return jobj
 	End
 	End
@@ -86,44 +122,72 @@ Class Jsonifier
 		If jobj.Contains( "assetsDir" ) SetAssetsDir( jobj.GetString( "assetsDir" ) )
 		If jobj.Contains( "assetsDir" ) SetAssetsDir( jobj.GetString( "assetsDir" ) )
 		
 		
 		Local jinsts:=jobj.GetArray( "instances" )
 		Local jinsts:=jobj.GetArray( "instances" )
+
+		Local jobjsById:=New IntMap<JsonObject>
 		
 		
 		For Local i:=0 Until jinsts.Length
 		For Local i:=0 Until jinsts.Length
 			
 			
 			Local jobj:=jinsts.GetObject( i )
 			Local jobj:=jinsts.GetObject( i )
+			Assert( jobj.Contains( "id" ) )
 			
 			
-			Local obj:Variant
-						
-			If i<_insts.Length
-				
-				obj=_insts[i].obj
-			Else
-				Local ctor:=Cast<Invocation>( Dejsonify( jobj["ctor"],Typeof<Invocation> ) )
-			
-				obj=ctor.Execute()
-			Endif
-
-			_dejsonified.Add( obj )
-			
-			Local tobj:=Cast<Object>( obj )
+			Local id:=jobj.GetNumber( "id" )
+			Assert( Not jobjsById.Contains( id ) )
 			
 			
-			'set value type state only on this pass.
-			If jobj.Contains( "state" ) DejsonifyState( tobj,jobj.GetObject( "state" ),tobj.DynamicType,False )
+			jobjsById[id]=jobj
 		Next
 		Next
-
-		'set reference type state - do this on a second pass 'coz of forward refs. Probably wont always work?
-		For Local i:=0 Until _dejsonified.Length
+		
+		'copy of insts alreday created (ie: initial Scene)
+		Local tinsts:=_insts.ToArray(),id:=0
+		
+		For Local i:=0 Until jinsts.Length
 			
 			
 			Local jobj:=jinsts.GetObject( i )
 			Local jobj:=jinsts.GetObject( i )
+			If Not jobj.Contains( "ctor" ) Continue
 			
 			
-			Local obj:=_dejsonified[i]
+			Local ctor:=Cast<Invocation>( Dejsonify( jobj["ctor"],Typeof<Invocation> ) )
+			ctor.Execute()
 			
 			
-			Local tobj:=Cast<Object>( obj )
+			For Local j:=id Until _insts.Length
+				
+				If Not jobjsById.Contains( j ) Continue
+
+				Local jobj:=jobjsById[j]
+				Local tobj:=Cast<Object>( _insts[j].obj )
+				If jobj.Contains( "state" ) DejsonifyState( tobj,jobj.GetObject( "state" ),tobj.DynamicType,False )
+			Next
+			
+			id=_insts.Length
+		Next
+		
+		'set reference type state - do this on a second pass 'coz of forward refs. Probably wont always work?
+		For Local i:=0 Until _insts.Length
+			
+			If Not jobjsById.Contains( i ) Continue
 			
 			
+			Local jobj:=jobjsById[i]
+			Local tobj:=Cast<Object>( _insts[i].obj )
 			If jobj.Contains( "state" ) DejsonifyState( tobj,jobj.GetObject( "state" ),tobj.DynamicType,True )
 			If jobj.Contains( "state" ) DejsonifyState( tobj,jobj.GetObject( "state" ),tobj.DynamicType,True )
 		Next
 		Next
 		
 		
 		SetAssetsDir( assetsDir )
 		SetAssetsDir( assetsDir )
 	End
 	End
+	'ctor via ctor
+	Method AddInstance( obj:Variant,args:Variant[] )
+		
+		AddInstance( obj,New Invocation( obj.DynamicType,"New",Null,args ) )
+	end
+
+	'ctor via method call
+	Method AddInstance( obj:Variant,decl:String,inst:Variant,args:Variant[] )
+		
+		AddInstance( obj,New Invocation( decl,inst,args ) )
+	End
+
+	'ctor via function call
+	Method AddInstance( obj:Variant,decl:String,args:Variant[] )
+		
+		AddInstance( obj,New Invocation( decl,Null,args ) )
+	End
 	
 	
 	Method Jsonify:JsonValue( value:Variant )
 	Method Jsonify:JsonValue( value:Variant )
 		
 		
@@ -131,7 +195,7 @@ Class Jsonifier
 		
 		
 		Local type:=value.Type
 		Local type:=value.Type
 		Assert( type )
 		Assert( type )
-		
+
 		'handle primitive types
 		'handle primitive types
 		Select type
 		Select type
 		Case Typeof<Bool>
 		Case Typeof<Bool>
@@ -152,7 +216,7 @@ Class Jsonifier
 			Local obj:=Cast<Object>( value )
 			Local obj:=Cast<Object>( value )
 			If Not obj Return JsonValue.NullValue
 			If Not obj Return JsonValue.NullValue
 			Local inst:=_instsByObj[obj]
 			Local inst:=_instsByObj[obj]
-			If inst Return New JsonString( inst.id )
+			If inst Return New JsonString( "@"+inst.id )
 		Case "Enum"
 		Case "Enum"
 			Return New JsonNumber( value.EnumValue )
 			Return New JsonNumber( value.EnumValue )
 		End
 		End
@@ -164,6 +228,11 @@ Class Jsonifier
 		Next
 		Next
 
 
 		Select type.Kind
 		Select type.Kind
+		Case "Unknown"
+			Local obj:=Cast<Object>( value )
+			If Not obj Return JsonValue.NullValue
+			Local inst:=_instsByObj[obj]
+			If inst Return New JsonString( "@"+inst.id )
 		Case "Class"
 		Case "Class"
 			Return JsonValue.NullValue
 			Return JsonValue.NullValue
 		Case "Array"
 		Case "Array"
@@ -207,9 +276,8 @@ Class Jsonifier
 				Return type.NullValue
 				Return type.NullValue
 			Elseif jvalue.IsString
 			Elseif jvalue.IsString
 				Local id:=Int( jvalue.ToString().Slice( 1 ) )
 				Local id:=Int( jvalue.ToString().Slice( 1 ) )
-				Assert( id>=0 And id<_dejsonified.Length,"Dejsonify error" )
-				Local inst:=_dejsonified[id]
-				Return inst
+				Assert( id>=0 And id<_insts.Length,"Dejsonify error" )
+				Return _insts[id].obj
 			Endif
 			Endif
 		Case "Enum"
 		Case "Enum"
 			Return type.MakeEnum( jvalue.ToNumber() )
 			Return type.MakeEnum( jvalue.ToNumber() )
@@ -222,6 +290,12 @@ Class Jsonifier
 		Next
 		Next
 
 
 		Select type.Kind
 		Select type.Kind
+		Case "Unknown"
+			If jvalue.IsString
+				Local id:=Int( jvalue.ToString().Slice( 1 ) )
+				Assert( id>=0 And id<_insts.Length,"Dejsonify error" )
+				Return _insts[id].obj
+			Endif
 		Case "Class"
 		Case "Class"
 			Return type.NullValue
 			Return type.NullValue
 		Case "Array"
 		Case "Array"
@@ -242,20 +316,6 @@ Class Jsonifier
 	
 	
 	Private
 	Private
 	
 	
-	Class Instance
-		Field obj:Variant
-		Field id:String
-		Field ctor:Invocation
-		Field initialState:JsonObject
-	End
-	
-	Field _insts:=New Stack<Instance>
-	
-	Field _instsByObj:=New Map<Object,Instance>
-	Field _instsById:=New StringMap<Instance>
-	
-	Field _dejsonified:=New Stack<Variant>
-	
 	Method JsonifyState:JsonObject( obj:Object )
 	Method JsonifyState:JsonObject( obj:Object )
 		
 		
 		Local jobj:=New JsonObject
 		Local jobj:=New JsonObject
@@ -300,7 +360,7 @@ Class Jsonifier
 			
 			
 			Local type:=d.Type
 			Local type:=d.Type
 			
 			
-			Local isinst:=type.Kind="Class"
+			Local isinst:=type.Kind="Class" Or type.Kind="Unknown"
 			
 			
 			If Not isinst And type.Kind="Array" And type.ElementType.Kind="Class" isinst=True
 			If Not isinst And type.Kind="Array" And type.ElementType.Kind="Class" isinst=True
 				
 				

+ 26 - 0
modules/mojo3d/scene/jsonifier/jsonifierexts.monkey2

@@ -1,5 +1,31 @@
 Namespace mojo3d.jsonifier
 Namespace mojo3d.jsonifier
 
 
+Class MojoJsonifierExt Extends JsonifierExt
+	
+	Const Instance:=New MojoJsonifierExt
+
+	Method Jsonify:JsonValue( value:Variant,jsonifier:Jsonifier ) Override
+		
+		Select value.Type
+		Case Typeof<TextureFlags>
+			Return New JsonNumber( Int( Cast<TextureFlags>( value ) ) )
+		End
+		
+		Return Null
+	End
+
+	Method Dejsonify:Variant( jvalue:JsonValue,type:TypeInfo,jsonifier:Jsonifier ) Override
+		
+		Select type
+		Case Typeof<TextureFlags>
+			Return Cast<TextureFlags>( Int( jvalue.ToNumber() ) )
+		End
+		
+		Return Null
+	End
+	
+End
+
 Class StdJsonifierExt Extends JsonifierExt
 Class StdJsonifierExt Extends JsonifierExt
 	
 	
 	Const Instance:=New StdJsonifierExt
 	Const Instance:=New StdJsonifierExt

+ 25 - 0
modules/mojo3d/scene/material.monkey2

@@ -122,6 +122,24 @@ Class Material Extends Resource
 		Return GetOpaqueShader()
 		Return GetOpaqueShader()
 	End
 	End
 	
 	
+	Function LoadTexture:Texture( path:String,textureFlags:TextureFlags,flipy:Bool=False )
+		
+		Local scene:=Scene.GetCurrent()
+		
+		Return scene.LoadTexture( path,textureFlags,flipy )
+	End
+	
+	Function LoadTexture:Texture( path:String,name:String,textureFlags:TextureFlags,flipy:Bool=False )
+		
+		Local scene:=Scene.GetCurrent()
+		
+		Local texture:=scene.LoadTexture( path+"/"+name+".png",textureFlags,flipy )
+		
+		If Not texture texture=scene.LoadTexture( path+"/"+name+".jpg",textureFlags,flipy )
+			
+		Return texture
+	End
+	
 	Protected
 	Protected
 	
 	
 	Method New()
 	Method New()
@@ -143,6 +161,13 @@ Class Material Extends Resource
 		TextureMatrix=material.TextureMatrix
 		TextureMatrix=material.TextureMatrix
 	End
 	End
 	
 	
+	Method AddInstance()
+
+		Local scene:=Scene.GetCurrent()
+		
+		If scene.Editing scene.Jsonifier.AddInstance( Self,New Variant[0] )
+	End
+	
 	Method AddInstance( args:Variant[] )
 	Method AddInstance( args:Variant[] )
 		
 		
 		Local scene:=Scene.GetCurrent()
 		Local scene:=Scene.GetCurrent()

+ 37 - 28
modules/mojo3d/scene/materials/pbrmaterial.monkey2

@@ -30,6 +30,30 @@ Public
 #end
 #end
 Class PbrMaterial Extends Material
 Class PbrMaterial Extends Material
 	
 	
+	Private
+	
+	Method Init( boned:Bool )
+		
+		_boned=boned
+
+		Uniforms.DefaultTexture=Texture.ColorTexture( Color.White )
+		
+		ColorTexture=Null
+		EmissiveTexture=Null
+		MetalnessTexture=Null
+		RoughnessTexture=Null
+		OcclusionTexture=Null
+		NormalTexture=Null
+		
+		ColorFactor=Color.White
+		EmissiveFactor=Color.Black
+		MetalnessFactor=1.0
+		RoughnessFactor=1.0
+	End
+	
+	Public
+	
+	
 	#rem monkeydoc Creates a new pbr material.
 	#rem monkeydoc Creates a new pbr material.
 	
 	
 	All properties default to white or '1' except for emissive factor which defaults to black. 
 	All properties default to white or '1' except for emissive factor which defaults to black. 
@@ -47,26 +71,14 @@ Class PbrMaterial Extends Material
 	#end
 	#end
 	Method New( boned:Bool=False )
 	Method New( boned:Bool=False )
 		
 		
-		_boned=boned
-		
-		Uniforms.DefaultTexture=Texture.ColorTexture( Color.White )
+		Init( boned )
 		
 		
-		ColorTexture=Null
-		EmissiveTexture=Null
-		MetalnessTexture=Null
-		RoughnessTexture=Null
-		OcclusionTexture=Null
-		NormalTexture=Null
-		
-		ColorFactor=Color.White
-		EmissiveFactor=Color.Black
-		MetalnessFactor=1.0
-		RoughnessFactor=1.0
+		AddInstance( New Variant[]( boned ) )
 	End
 	End
 	
 	
 	Method New( color:Color,metalness:Float=1.0,roughness:Float=1.0,boned:Bool=False )
 	Method New( color:Color,metalness:Float=1.0,roughness:Float=1.0,boned:Bool=False )
 		
 		
-		Self.New( boned )
+		Init( boned )
 		
 		
 		ColorFactor=color
 		ColorFactor=color
 		MetalnessFactor=metalness
 		MetalnessFactor=metalness
@@ -230,12 +242,13 @@ Class PbrMaterial Extends Material
 	#end
 	#end
 	Function Load:PbrMaterial( path:String,textureFlags:TextureFlags=TextureFlags.WrapST|TextureFlags.FilterMipmap )
 	Function Load:PbrMaterial( path:String,textureFlags:TextureFlags=TextureFlags.WrapST|TextureFlags.FilterMipmap )
 		
 		
-		Local material:=New PbrMaterial
+		Local scene:=Scene.GetCurrent(),editing:=scene.Editing
 		
 		
-		Local scene:=Scene.GetCurrent()
-		If scene.Editing 
-			scene.Jsonifier.AddInstance( material,"mojo3d.PbrMaterial.Load",New Variant[]( path,textureFlags ) )
+		If editing 
+			scene.Jsonifier.BeginLoading()
 		Endif
 		Endif
+
+		Local material:=New PbrMaterial
 		
 		
 		Local texture:=LoadTexture( path,"color",textureFlags )
 		Local texture:=LoadTexture( path,"color",textureFlags )
 		If texture
 		If texture
@@ -277,6 +290,11 @@ Class PbrMaterial Extends Material
 			If jobj.Contains( "roughnessFactor" ) material.RoughnessFactor=jobj.GetNumber( "roughnessFactor" )
 			If jobj.Contains( "roughnessFactor" ) material.RoughnessFactor=jobj.GetNumber( "roughnessFactor" )
 		Endif
 		Endif
 		
 		
+		If editing 
+			scene.Jsonifier.EndLoading()
+			scene.Jsonifier.AddInstance( material,"mojo3d.PbrMaterial.Load",New Variant[]( path,textureFlags ) )
+		Endif
+		
 		Return material
 		Return material
 	End
 	End
 	
 	
@@ -292,15 +310,6 @@ Class PbrMaterial Extends Material
 	
 	
 	Field _dirty:=True
 	Field _dirty:=True
 	
 	
-	Function LoadTexture:Texture( path:String,name:String,flags:TextureFlags,flipy:Bool=False )
-		
-		Local texture:=Texture.Load( path+"/"+name+".png",flags,flipy )
-		
-		If Not texture texture=Texture.Load( path+"/"+name+".jpg",flags,flipy )
-			
-		Return texture
-	End
-	
 	Method ValidateShaders()
 	Method ValidateShaders()
 		
 		
 		If Not _dirty Return
 		If Not _dirty Return

+ 18 - 3
modules/mojo3d/scene/materials/spritematerial.monkey2

@@ -16,11 +16,15 @@ Class SpriteMaterial Extends Material
 		ColorFactor=Color.White
 		ColorFactor=Color.White
 		
 		
 		AlphaDiscard=.5
 		AlphaDiscard=.5
+		
+		AddInstance()
 	End
 	End
 	
 	
 	Method New( material:SpriteMaterial )
 	Method New( material:SpriteMaterial )
 	
 	
 		Super.New( material )
 		Super.New( material )
+		
+		AddInstance( material )
 	End
 	End
 	
 	
 	#rem monkeydoc Creates a copy of the sprite material.
 	#rem monkeydoc Creates a copy of the sprite material.
@@ -61,6 +65,7 @@ Class SpriteMaterial Extends Material
 		Return GetOpaqueShader()
 		Return GetOpaqueShader()
 	End
 	End
 	
 	
+	[jsonify=1]
 	Property ColorTexture:Texture()
 	Property ColorTexture:Texture()
 		
 		
 		Return Uniforms.GetTexture( "ColorTexture" )
 		Return Uniforms.GetTexture( "ColorTexture" )
@@ -70,6 +75,7 @@ Class SpriteMaterial Extends Material
 		Uniforms.SetTexture( "ColorTexture",texture )
 		Uniforms.SetTexture( "ColorTexture",texture )
 	End
 	End
 	
 	
+	[jsonify=1]
 	Property ColorFactor:Color()
 	Property ColorFactor:Color()
 	
 	
 		Return Uniforms.GetColor( "ColorFactor" )
 		Return Uniforms.GetColor( "ColorFactor" )
@@ -79,6 +85,7 @@ Class SpriteMaterial Extends Material
 		Uniforms.SetColor( "ColorFactor",color )
 		Uniforms.SetColor( "ColorFactor",color )
 	End
 	End
 	
 	
+	[jsonify=1]
 	Property AlphaDiscard:Float()
 	Property AlphaDiscard:Float()
 		
 		
 		Return Uniforms.GetFloat( "AlphaDiscard" )
 		Return Uniforms.GetFloat( "AlphaDiscard" )
@@ -92,14 +99,22 @@ Class SpriteMaterial Extends Material
 	#end	
 	#end	
 	Function Load:SpriteMaterial( path:String,textureFlags:TextureFlags=TextureFlags.FilterMipmap )
 	Function Load:SpriteMaterial( path:String,textureFlags:TextureFlags=TextureFlags.FilterMipmap )
 		
 		
-		Local texture:=Texture.Load( path,textureFlags )
-		If Not texture texture=Texture.ColorTexture( Color.Magenta )
+		Local scene:=Scene.GetCurrent(),editing:=scene.Editing
+		
+		If editing scene.Jsonifier.BeginLoading()
+		
+		Local texture:=LoadTexture( path,textureFlags )
+		'If Not texture texture=Texture.ColorTexture( Color.Magenta )
 		
 		
 		Local material:=New SpriteMaterial
 		Local material:=New SpriteMaterial
 		material.ColorTexture=texture
 		material.ColorTexture=texture
 		
 		
+		If editing
+			scene.Jsonifier.EndLoading()
+			scene.Jsonifier.AddInstance( material,"mojo3d.SpriteMaterial.Load",New Variant[]( path,textureFlags ) )
+		Endif
+		
 		Return material
 		Return material
 	End
 	End
 	
 	
 End
 End
-

+ 65 - 69
modules/mojo3d/scene/scene.monkey2

@@ -10,9 +10,11 @@ Class Scene
 	If there is no current scene when a new scene is created, the new scene becomes the current scene.
 	If there is no current scene when a new scene is created, the new scene becomes the current scene.
 		
 		
 	#end
 	#end
-	Method New()
+	Method New( editable:Bool=False )
 		
 		
 		If Not _current _current=Self
 		If Not _current _current=Self
+			
+		_editable=editable
 		
 		
 		_clearColor=Color.Sky
 		_clearColor=Color.Sky
 
 
@@ -22,13 +24,14 @@ Class Scene
 		
 		
 		_world=New World( Self )
 		_world=New World( Self )
 		
 		
-		Local type:=TypeInfo.GetType( "mojo3d.Scene" )
-		If type And type.Kind="Class"
+		If _editable
+			Local type:=TypeInfo.GetType( "mojo3d.Scene" )
+			Assert( type And type.Kind="Class","mojo3d reflection must be enabled for editable scenes" )
 			_jsonifier=New Jsonifier
 			_jsonifier=New Jsonifier
-			_jsonifier.AddInstance( Self,New Variant[0] )
+			_jsonifier.AddInstance( Self,New Variant[]( true ) )
+			_editing=True
 		Endif
 		Endif
 		
 		
-		_editing=False
 	End
 	End
 	
 	
 	#rem monkeydoc The sky texture.
 	#rem monkeydoc The sky texture.
@@ -40,7 +43,7 @@ Class Scene
 	This must currently be a valid cubemap texture.
 	This must currently be a valid cubemap texture.
 	
 	
 	#end
 	#end
-'	[jsonify=1]
+	[jsonify=1]
 	Property SkyTexture:Texture()
 	Property SkyTexture:Texture()
 		
 		
 		Return _skyTexture
 		Return _skyTexture
@@ -61,7 +64,7 @@ Class Scene
 	This must currently be a valid cubemap texture.
 	This must currently be a valid cubemap texture.
 	
 	
 	#end
 	#end
-'	[jsonify=1]
+	[jsonify=1]
 	Property EnvTexture:Texture()
 	Property EnvTexture:Texture()
 		
 		
 		Return _envTexture
 		Return _envTexture
@@ -195,44 +198,6 @@ Class Scene
 		_csmSplits=splits.Slice( 0 )
 		_csmSplits=splits.Slice( 0 )
 	End
 	End
 	
 	
-	Property Editing:Bool()
-		
-		Return _editing
-	
-	Setter( editing:Bool )
-		
-		If editing And Not _jsonifier RuntimeError( "Scene is not editable" )
-		
-		_editing=editing
-	End
-	
-	Property Jsonifier:Jsonifier()
-		
-		Return _jsonifier
-	End
-	
-	Method PauseEditing()
-		
-		_editingPaused+=1
-	End
-	
-	Method ResumeEditing:Bool()
-		
-		_editingPaused-=1
-		
-		Return Editing
-	End
-	
-	Method LoadTexture:Texture( path:String,flags:TextureFlags,flipNormalY:Bool=False )
-		
-		Local texture:=Texture.Load( path,flags,flipNormalY )
-		If Not texture Return Null
-		
-		If Editing Jsonifier.AddInstance( texture,"mojo3d.Scene.LoadTexture",Self,New Variant[]( path,flags,flipNormalY ) )
-			
-		Return texture
-	End
-
 	#rem monkeydoc Finds an entity in the scene.
 	#rem monkeydoc Finds an entity in the scene.
 	
 	
 	Finds an entity in the scene with the given name.
 	Finds an entity in the scene with the given name.
@@ -320,18 +285,70 @@ Class Scene
 		Return _rootEntities.ToArray()
 		Return _rootEntities.ToArray()
 	End
 	End
 	
 	
+	'***** serialization stuff *****
+	
+	Property Editable:Bool()
+		
+		Return _editable
+	End
+	
+	Property Editing:Bool()
+		
+		Return _editing
+	
+	Setter( editing:Bool )
+		
+		If editing And Not _editable RuntimeError( "Scene is not editable" )
+		
+		_editing=editing
+	End
+	
+	Property Jsonifier:Jsonifier()
+		
+		Return _jsonifier
+	End
+	
+	Method LoadTexture:Texture( path:String,flags:TextureFlags,flipNormalY:Bool=False )
+		
+		Local texture:=Texture.Load( path,flags,flipNormalY )
+		If Not texture Return Null
+		
+		If Editing Jsonifier.AddInstance( texture,"mojo3d.Scene.LoadTexture",Self,New Variant[]( path,flags,flipNormalY ) )
+			
+		Return texture
+	End
+
 	#rem monkeydoc Saves the scene to a mojo3d scene file
 	#rem monkeydoc Saves the scene to a mojo3d scene file
 	#end
 	#end
-	Method Save( path:String )
+	Method Save( path:String,assetsDir:String="" )
 		
 		
 		Assert( _jsonifier,"Scene is not editable" )
 		Assert( _jsonifier,"Scene is not editable" )
 		
 		
-		Local jobj:=_jsonifier.JsonifyInstances()
+		Local jobj:=_jsonifier.JsonifyInstances( assetsDir )
 		
 		
 		Local json:=jobj.ToJson()
 		Local json:=jobj.ToJson()
 		
 		
 		SaveString( json,path )
 		SaveString( json,path )
 	End
 	End
+
+	#rem monkeydoc Loads a mojo3d scene file and makes it current
+	#end
+	Function Load:Scene( path:String )
+		
+		Local json:=LoadString( path )
+		If Not json Return Null
+		
+		Local jobj:=JsonObject.Parse( json )
+		If Not jobj Return Null
+		
+		Local scene:=New Scene( True )
+		
+		SetCurrent( scene )
+		
+		scene.Jsonifier.DejsonifyInstances( jobj )
+		
+		Return scene
+	End
 	
 	
 	#rem monkeydoc Sets the current scene.
 	#rem monkeydoc Sets the current scene.
 	
 	
@@ -355,25 +372,6 @@ Class Scene
 		Return _current
 		Return _current
 	End
 	End
 	
 	
-	#rem monkeydoc Loads a mojo3d scene file and makes it current
-	#end
-	Function Load:Scene( path:String )
-
-		Local json:=LoadString( path )
-		If Not json Return Null
-		
-		Local jobj:=JsonObject.Parse( json )
-		If Not jobj Return Null
-		
-		Local scene:=New Scene
-		
-		SetCurrent( scene )
-		
-		scene.Jsonifier.DejsonifyInstances( jobj )
-		
-		Return scene
-	End
-	
 	Internal
 	Internal
 
 
 	Property PostEffects:Stack<PostEffect>()
 	Property PostEffects:Stack<PostEffect>()
@@ -438,11 +436,9 @@ Class Scene
 	Field _world:World
 	Field _world:World
 	
 	
 	Field _jsonifier:Jsonifier
 	Field _jsonifier:Jsonifier
-	
+	Field _editable:Bool
 	Field _editing:Bool
 	Field _editing:Bool
 	
 	
-	Field _editingPaused:=0
-	
 	Method Update( elapsed:Float )
 	Method Update( elapsed:Float )
 		
 		
 		For Local e:=Eachin _rootEntities
 		For Local e:=Eachin _rootEntities

+ 131 - 0
modules/mojo3d/tests/ducks-scene.monkey2

@@ -0,0 +1,131 @@
+
+Namespace myapp
+
+#Import "<std>"
+#Import "<mojo>"
+#Import "<mojo3d>"
+
+#Reflect mojo3d
+
+#Import "assets/duck.gltf/@/duck.gltf"
+
+Using std..
+Using mojo..
+Using mojo3d..
+
+Class MyWindow Extends Window
+	
+	Field _scene:Scene
+	
+	Field _camera:Camera
+	
+	Field _light:Light
+	
+	Field _ground:Model
+	
+	Field _ducks:=New Stack<Model>
+	
+	Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable )
+
+		Super.New( title,width,height,flags )
+		
+		'create scene
+		'		
+		_scene=New Scene( True )
+		
+		'for softer shadows
+		'
+		_scene.ShadowAlpha=.6
+		
+		'create camera
+		'
+		_camera=New Camera( Self )
+		_camera.Move( 0,15,-20 )
+		New FlyBehaviour( _camera )
+		
+		'create light
+		'
+		_light=New Light
+		_light.CastsShadow=True
+		_light.Rotate( 75,15,0 )
+		
+		'create ground
+		'
+		_ground=Model.CreateBox( New Boxf( -50,-1,-50,50,0,50 ),1,1,1,New PbrMaterial( Color.Green,0,1 ) )
+		_ground.CastsShadow=False
+		
+		'create ducks
+		'		
+		Local duck:=Model.Load( "asset::duck.gltf/Duck.gltf" )
+		duck.Mesh.FitVertices( New Boxf( -1,1 ) )
+		
+		Local root:=duck.Copy()
+		root.Move( 0,10,0 )
+		root.Scale=New Vec3f( 3 )
+		
+		_ducks.Push( root )
+		
+		For Local m:=0.0 To 1.0 Step .125
+		
+			For Local i:=0.0 Until 360.0 Step 24
+			
+				Local copy:=duck.Copy( root )
+				
+				copy.RotateY( i )
+				
+				copy.Move( 0,0,6+m*16 )
+
+				copy.Scale=New Vec3f( 1 )
+				
+				Local materials:=copy.Materials.Slice( 0 )
+				
+				For Local j:=0 Until materials.Length
+				
+					Local material:=Cast<PbrMaterial>( materials[j].Copy() )
+					
+					material.MetalnessFactor=m
+					material.RoughnessFactor=i/360.0
+					
+					materials[j]=material
+				Next
+				
+				copy.Materials=materials
+				
+				_ducks.Push( copy )
+			Next
+		Next
+		
+		duck.Destroy()
+		
+		_ducks[0].AddComponent<RotateBehaviour>().Speed=New Vec3f( 0,.01,0 )
+		
+		Print "Saving.."
+		
+		_scene.Save( "ducks-scene.mojo3d","modules/mojo3d/tests/assets/" )	'note: assets path is a bit of a hack! Need access to compile time assets dir path.
+		
+		Print "Loading..."
+		
+		_scene=Scene.Load( "ducks-scene.mojo3d" )
+	End
+	
+	Method OnRender( canvas:Canvas ) Override
+
+		RequestRender()
+		
+		_scene.Update()
+		
+		_scene.Render( canvas )
+
+		canvas.DrawText( "FPS="+App.FPS,Width,0,1,0 )
+	End
+	
+End
+
+Function Main()
+	
+	New AppInstance
+	
+	New MyWindow
+	
+	App.Run()
+End

+ 6 - 5
modules/mojo3d/tests/ducks.monkey2

@@ -76,19 +76,20 @@ Class MyWindow Extends Window
 
 
 				copy.Scale=New Vec3f( 1 )
 				copy.Scale=New Vec3f( 1 )
 				
 				
-'				copy.Alpha=1-m
+				Local materials:=copy.Materials.Slice( 0 )
 				
 				
-				For Local j:=0 Until copy.Materials.Length
+				For Local j:=0 Until materials.Length
 				
 				
-					Local material:=Cast<PbrMaterial>( copy.Materials[j].Copy() )
+					Local material:=Cast<PbrMaterial>( materials[j].Copy() )
 					
 					
 					material.MetalnessFactor=m
 					material.MetalnessFactor=m
 					material.RoughnessFactor=i/360.0
 					material.RoughnessFactor=i/360.0
 					
 					
-					copy.Materials[j]=material
-					
+					materials[j]=material
 				Next
 				Next
 				
 				
+				copy.Materials=materials
+				
 				_ducks.Push( copy )
 				_ducks.Push( copy )
 			
 			
 			Next
 			Next

+ 30 - 30
modules/mojo3d/tests/shapes-scene.monkey2

@@ -4,6 +4,7 @@ Namespace myapp
 #Import "<mojo>"
 #Import "<mojo>"
 #Import "<mojo3d>"
 #Import "<mojo3d>"
 
 
+'Need this to be able to create an 'editable' scene
 #Reflect mojo3d
 #Reflect mojo3d
 
 
 Using std..
 Using std..
@@ -13,34 +14,26 @@ Using mojo3d..
 Class MyWindow Extends Window
 Class MyWindow Extends Window
 	
 	
 	Field _scene:Scene
 	Field _scene:Scene
-	
 	Field _camera:Camera
 	Field _camera:Camera
 	
 	
-	Field _light:Light
-	
-	Field _ground:Model
-	
 	Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable )
 	Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable )
 
 
 		Super.New( title,width,height,flags )
 		Super.New( title,width,height,flags )
 		
 		
-'#rem
-		_scene=New Scene
-		
-		_scene.Editing=True
+		Local scene:=New Scene( True )	'True to create an 'editable' scene.
 		
 		
 		'create camera
 		'create camera
 		'
 		'
-		_camera=New Camera
-		_camera.Name="Camera"
-		_camera.Near=.1
-		_camera.Far=60
-		_camera.Move( 0,10,-10 )
-		New FlyBehaviour( _camera )
-		
-		Local camCollider:=New SphereCollider( _camera )
+		Local camera:=New Camera( Self )
+		camera.Name="Camera"	'so we can find camera later after loading
+		camera.Near=.1
+		camera.Far=60
+		camera.Move( 0,10,-10 )
+		New FlyBehaviour( camera )
+		
+		Local camCollider:=New SphereCollider( camera )
 		camCollider.Radius=1
 		camCollider.Radius=1
-		Local camBody:=New RigidBody( _camera )
+		Local camBody:=New RigidBody( camera )
 		camBody.Kinematic=True
 		camBody.Kinematic=True
 		camBody.Mass=0
 		camBody.Mass=0
 		camBody.CollisionGroup=32
 		camBody.CollisionGroup=32
@@ -48,32 +41,35 @@ Class MyWindow Extends Window
 		
 		
 		'create light
 		'create light
 		'
 		'
-		_light=New Light
-		_light.RotateX( 75,15 )
-		_light.CastsShadow=true
+		Local light:=New Light
+		light.RotateX( 75,15 )
+		light.CastsShadow=true
 		
 		
 		'create ground
 		'create ground
 		'
 		'
 		Local groundBox:=New Boxf( -60,-1,-60,60,0,60 )
 		Local groundBox:=New Boxf( -60,-1,-60,60,0,60 )
 		
 		
-		_ground=Model.CreateBox( groundBox,16,16,16,New PbrMaterial( Color.Green ) )
-		_ground.Name="Ground"
+		Local ground:=Model.CreateBox( groundBox,16,16,16,New PbrMaterial( Color.Green ) )
 		
 		
-		_ground.Collided+=Lambda( body:RigidBody )
+		ground.Collided+=Lambda( body:RigidBody )
 		
 		
 '			Print "Ground hit: "+body.Entity.Name
 '			Print "Ground hit: "+body.Entity.Name
 		End
 		End
-		
-		Local groundCollider:=New BoxCollider( _ground )
+
+		'3 ways to create a ground collider!
+		Local groundCollider:=New BoxCollider( ground )
 		groundCollider.Box=groundBox
 		groundCollider.Box=groundBox
+		
+'		Local groundCollider:=New ConvexHullCollider( _ground )
+'		groundCollider.Mesh=_ground.Mesh
 
 
 '		Local groundCollider:=New MeshCollider( _ground )
 '		Local groundCollider:=New MeshCollider( _ground )
 '		groundCollider.Mesh=_ground.Mesh
 '		groundCollider.Mesh=_ground.Mesh
 		
 		
-		Local groundBody:=New RigidBody( _ground )
-		groundBody.Mass=0
+		Local groundBody:=New RigidBody( ground )
 		groundBody.CollisionGroup=64
 		groundBody.CollisionGroup=64
 		groundBody.CollisionMask=127
 		groundBody.CollisionMask=127
+		groundBody.Mass=0	'static body
 		
 		
 		Local material:=New PbrMaterial( Color.White )
 		Local material:=New PbrMaterial( Color.White )
 
 
@@ -151,11 +147,15 @@ Class MyWindow Extends Window
 '			model.Destroy()
 '			model.Destroy()
 		Next
 		Next
 		
 		
-		_scene.Save( "shapes-scene.mojo3d" )
+		Print "Saving scene..."
+		
+		scene.Save( "shapes-scene.mojo3d" )
 		
 		
-'#end
+		Print "Loading scene..."
 		
 		
 		_scene=Scene.Load( "shapes-scene.mojo3d" )
 		_scene=Scene.Load( "shapes-scene.mojo3d" )
+		_camera=Cast<Camera>( _scene.FindEntity( "Camera" ) )
+		_camera.View=Self
 	End
 	End
 	
 	
 	Method OnRender( canvas:Canvas ) Override
 	Method OnRender( canvas:Canvas ) Override

+ 110 - 0
modules/mojo3d/tests/sprites-scene.monkey2

@@ -0,0 +1,110 @@
+
+Namespace myapp
+
+#Import "<std>"
+#Import "<mojo>"
+#Import "<mojo3d>"
+
+#Reflect mojo3d
+
+#Import "assets/"
+
+Using std..
+Using mojo..
+Using mojo3d..
+
+Function Main()
+	
+	New AppInstance
+	
+	New MyWindow
+	
+	App.Run()
+End
+
+Class MyWindow Extends Window
+	
+	Field _scene:Scene
+	
+	Field _camera:Camera
+	
+	Field _light:Light
+	
+	Field _ground:Model
+	
+	Field _sprites:=New Stack<Sprite>
+	
+	Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable )
+
+		Super.New( title,width,height,flags )
+		
+		_scene=New Scene( True )
+		
+		_scene.SkyTexture=_scene.LoadTexture( "asset::miramar-skybox.jpg",TextureFlags.FilterMipmap|TextureFlags.Cubemap )
+		_scene.FogColor=Color.Sky
+		_scene.FogNear=10
+		_scene.FogFar=30
+		
+		'create camera
+		'
+		_camera=New Camera( Self )
+		_camera.Near=.1
+		_camera.Far=100
+		_camera.Move( 0,10,-10 )
+		New FlyBehaviour( _camera )
+		
+		'create light
+		'
+		_light=New Light
+		_light.Rotate( 60,45,0 )
+		
+		'create ground
+		'
+		_ground=Model.CreateBox( New Boxf( -50,-1,-50,50,0,50 ),1,1,1,New PbrMaterial( Color.Green ) )
+		
+		'create sprites
+		'
+		Local material:=SpriteMaterial.Load( "asset::Acadia-Tree-Sprite.png" )
+		
+		material.AlphaDiscard=1.0/255.0
+		
+		For Local i:=0 Until 1000
+			
+			Local sprite:=New Sprite( material )
+			
+			sprite.Move( Rnd(-50,50),0,Rnd(-50,50) )
+
+			sprite.Scale=New Vec3f( Rnd(4,5),Rnd(5,6),1 )
+			
+			sprite.Handle=New Vec2f( .5,0 )
+			
+			sprite.Mode=SpriteMode.Upright
+
+			_sprites.Push( sprite )
+		Next
+		
+		For Local i:=0 Until 100
+			
+			Local box:=Model.CreateBox( New Boxf( -5,0,-5,5,Rnd(2,10),5 ),1,1,1,New PbrMaterial( New Color( Rnd(),Rnd(),Rnd() ) ) )
+			
+			box.Move( Rnd(-50,50),0,Rnd(-50,50) )
+		next	
+		
+		_scene.Save( "sprites-scene.mojo3d","modules/mojo3d/tests/assets/" )
+		
+		_scene=Scene.Load( "sprites-scene.mojo3d" )
+	End
+	
+	Method OnRender( canvas:Canvas ) Override
+	
+		RequestRender()
+		
+		_scene.Update()
+		
+		_scene.Render( canvas )
+		
+		canvas.DrawText( "Width="+Width+", Height="+Height+", FPS="+App.FPS,0,0 )
+	End
+	
+End
+

+ 4 - 9
modules/mojo3d/tests/sprites.monkey2

@@ -36,12 +36,8 @@ Class MyWindow Extends Window
 
 
 		Super.New( title,width,height,flags )
 		Super.New( title,width,height,flags )
 		
 		
-'		SetConfig( "MOJO3D_RENDERER","forward" )
-		
 		_scene=New Scene
 		_scene=New Scene
-		
-		_scene.SkyTexture=Texture.Load( "asset::miramar-skybox.jpg",TextureFlags.FilterMipmap|TextureFlags.Cubemap )
-		
+		_scene.SkyTexture=_scene.LoadTexture( "asset::miramar-skybox.jpg",TextureFlags.FilterMipmap|TextureFlags.Cubemap )
 		_scene.FogColor=Color.Sky
 		_scene.FogColor=Color.Sky
 		_scene.FogNear=10
 		_scene.FogNear=10
 		_scene.FogFar=30
 		_scene.FogFar=30
@@ -74,7 +70,7 @@ Class MyWindow Extends Window
 			Local sprite:=New Sprite( material )
 			Local sprite:=New Sprite( material )
 			
 			
 			sprite.Move( Rnd(-50,50),0,Rnd(-50,50) )
 			sprite.Move( Rnd(-50,50),0,Rnd(-50,50) )
-			
+
 			sprite.Scale=New Vec3f( Rnd(4,5),Rnd(5,6),1 )
 			sprite.Scale=New Vec3f( Rnd(4,5),Rnd(5,6),1 )
 			
 			
 			sprite.Handle=New Vec2f( .5,0 )
 			sprite.Handle=New Vec2f( .5,0 )
@@ -84,13 +80,12 @@ Class MyWindow Extends Window
 			_sprites.Push( sprite )
 			_sprites.Push( sprite )
 		Next
 		Next
 		
 		
-		For Local i:=0 Until 1'00
+		For Local i:=0 Until 100
 			
 			
 			Local box:=Model.CreateBox( New Boxf( -5,0,-5,5,Rnd(2,10),5 ),1,1,1,New PbrMaterial( New Color( Rnd(),Rnd(),Rnd() ) ) )
 			Local box:=Model.CreateBox( New Boxf( -5,0,-5,5,Rnd(2,10),5 ),1,1,1,New PbrMaterial( New Color( Rnd(),Rnd(),Rnd() ) ) )
 			
 			
 			box.Move( Rnd(-50,50),0,Rnd(-50,50) )
 			box.Move( Rnd(-50,50),0,Rnd(-50,50) )
-
-		next			
+		next	
 		
 		
 	End
 	End
 	
 	

+ 25 - 3
modules/mojo3d/tests/terrainmesh.monkey2

@@ -42,7 +42,7 @@ Class MyWindow Extends Window
 		_camera=New Camera
 		_camera=New Camera
 		_camera.Near=.1
 		_camera.Near=.1
 		_camera.Far=100
 		_camera.Far=100
-		_camera.Move( 0,15,-20 )
+		_camera.Move( 0,16,0 )
 		New FlyBehaviour( _camera )
 		New FlyBehaviour( _camera )
 		
 		
 		'create light
 		'create light
@@ -56,7 +56,7 @@ Class MyWindow Extends Window
 		Local terrainBox:=New Boxf( -256,0,-256,256,32,256 )
 		Local terrainBox:=New Boxf( -256,0,-256,256,32,256 )
 		
 		
 		'heightmap
 		'heightmap
-		Local terrainHMap:=Pixmap.Load( "asset::terrain_256.png" )
+		Local terrainHMap:=Pixmap.Load( "asset::terrain_256.png",PixelFormat.I8 )
 
 
 		'material		
 		'material		
 		Local terrainMaterial:=PbrMaterial.Load( "asset::mossy-ground1.pbr" )
 		Local terrainMaterial:=PbrMaterial.Load( "asset::mossy-ground1.pbr" )
@@ -64,9 +64,31 @@ Class MyWindow Extends Window
 		
 		
 		'model+mesh
 		'model+mesh
 		_terrain=Model.CreateTerrain( terrainHMap,terrainBox,terrainMaterial )
 		_terrain=Model.CreateTerrain( terrainHMap,terrainBox,terrainMaterial )
-
 		_terrain.CastsShadow=False
 		_terrain.CastsShadow=False
 		
 		
+		Local collider:=New TerrainCollider( _terrain )
+		collider.Heightmap=terrainHMap'.Convert( PixelFormat.I8 )
+		collider.Bounds=terrainBox
+		Local body:=New RigidBody( _terrain )
+		body.Mass=0
+		
+		Local material:=New PbrMaterial( Color.Sky,1,.5 )
+		
+		For Local i:=0 Until 360 Step 3
+			
+			Local box:=New Boxf( -.5,.5 )
+		
+			Local model:=Model.CreateBox( box,1,1,1,material )
+			Local collider:=New BoxCollider( model )
+			Local body:=New RigidBody( model )
+
+			collider.Box=box
+			
+			model.Rotate( 0,i,0 )
+			model.Move( 0,32,Rnd( 5,10 ) )
+			
+		Next			
+		
 	End
 	End
 	
 	
 	Method OnRender( canvas:Canvas ) Override
 	Method OnRender( canvas:Canvas ) Override

+ 455 - 0
modules/mojo3d/tests/test-scene.monkey2

@@ -0,0 +1,455 @@
+
+Namespace mojo3d
+
+#rem monkeydoc The Scene class.
+#end
+Class Scene
+
+	#rem monkeydoc Creates a new scene.
+	
+	If there is no current scene when a new scene is created, the new scene becomes the current scene.
+		
+	#end
+	Method New( editable:Bool=False )
+		
+		If Not _current _current=Self
+			
+		_editable=editable
+		
+		_clearColor=Color.Sky
+
+		_ambientDiffuse=Color.DarkGrey
+		
+		_envColor=Color.White
+		
+		_world=New World( Self )
+		
+		If _editable
+			Local type:=TypeInfo.GetType( "mojo3d.Scene" )
+			Assert( type And type.Kind="Class","mojo3d reflection must be enabled for editable scenes" )
+			_jsonifier=New Jsonifier
+			_jsonifier.AddInstance( Self,New Variant[]( true ) )
+			_editing=True
+		Endif
+		
+	End
+	
+	#rem monkeydoc The sky texture.
+	
+	The sky texture is used to clear the scene. 
+	
+	If there is no sky texture, the clear color is used instead.
+	
+	This must currently be a valid cubemap texture.
+	
+	#end
+	[jsonify=1]
+	Property SkyTexture:Texture()
+		
+		Return _skyTexture
+	
+	Setter( texture:Texture )
+		
+		_skyTexture=texture
+	End
+	
+	#rem monkeydoc The environment texture.
+	
+	The environment textures is used to render specular reflections within the scene.
+	
+	If there is no environment texture, the sky texture is used instead.
+		
+	If there is no environment texture and no sky texture, a default internal environment texture is used.
+	
+	This must currently be a valid cubemap texture.
+	
+	#end
+	[jsonify=1]
+	Property EnvTexture:Texture()
+		
+		Return _envTexture
+	
+	Setter( texture:Texture )
+		
+		_envTexture=texture
+	End
+	
+	#rem monkey The environment color.
+	
+	#end
+	[jsonify=1]
+	Property EnvColor:Color()
+		
+		Return _envColor
+	
+	Setter( color:Color )
+		
+		_envColor=color
+	End
+	
+	#rem monkeydoc The clear color.
+	
+	The clear color is used to clear the scene.
+	
+	The clear color is only used if there is no sky texture.
+	
+	#end
+	[jsonify=1]
+	Property ClearColor:Color()
+		
+		Return _clearColor
+		
+	Setter( color:Color )
+		
+		_clearColor=color
+	End
+	
+	[jsonify=1]
+	Property FogColor:Color()
+		
+		Return _fogColor
+	
+	Setter( color:Color )
+		
+		_fogColor=color
+	End
+	
+	[jsonify=1]
+	Property FogNear:Float()
+		
+		Return _fogNear
+	
+	Setter( near:Float )
+		
+		_fogNear=near
+	End
+	
+	[jsonify=1]
+	Property FogFar:Float()
+		
+		Return _fogFar
+	
+	Setter( far:Float )
+		
+		_fogFar=far
+	End
+	
+	[jsonify=1]
+	Property ShadowAlpha:Float()
+		
+		Return _shadowAlpha
+	
+	Setter( alpha:Float )
+		
+		_shadowAlpha=alpha
+	End
+	
+	#rem monkeydoc Update rate.
+	#end
+	[jsonify=1]
+	Property UpdateRate:Float()
+		
+		Return _updateRate
+	
+	Setter( updateRate:Float )
+		
+		_updateRate=updateRate
+	End
+	
+	[jsonify=1]
+	#rem monkeydoc Number of update steps.
+	#end
+	Property MaxSubSteps:Int()
+		
+		Return _maxSubSteps
+	
+	Setter( maxSubSteps:Int )
+		
+		_maxSubSteps=maxSubSteps
+	End
+	
+	#rem monkeydoc Ambient diffuse lighting.
+	#end
+	[jsonify=1]
+	Property AmbientLight:Color()
+		
+		Return _ambientDiffuse
+		
+	Setter( color:Color )
+		
+		_ambientDiffuse=color
+	End
+	
+	#rem monkeydoc Array containing the cascaded shadow map frustum splits for directional light shadows.
+	
+	Defaults to Float[]( 8.0,16.0,64.0,256.0 )
+	
+	Must have length 4.
+		
+	#end
+	[jsonify=1]
+	Property CSMSplits:Float[]()
+		
+		Return _csmSplits
+		
+	Setter( splits:Float[] )
+		Assert( splits.Length=4,"CSMSplits array must have 4 elements" )
+		
+		_csmSplits=splits.Slice( 0 )
+	End
+	
+	#rem monkeydoc Finds an entity in the scene.
+	
+	Finds an entity in the scene with the given name.
+	
+	#end
+	Method FindEntity:Entity( name:String )
+		
+		For Local entity:=Eachin _rootEntities
+			
+			Local found:=entity.Find( name )
+			If found Return found
+		Next
+		
+		Return Null
+	End
+	
+	#rem monkeydoc Adds a post effect to the scene.
+	#end
+	Method AddPostEffect( postEffect:PostEffect )
+		
+		_postEffects.Add( postEffect )
+	End
+	
+	#rem monkeydoc Removes a post effect from the scene
+	#end
+	Method RemovePostEffect( postEffect:PostEffect )
+		
+		_postEffects.Remove( postEffect )
+	End
+	
+	#rem monkeydocs Get all post effect that have been added to the scene
+	#end
+	Method GetPostEffects:PostEffect[]()
+		
+		Return _postEffects.ToArray()
+	End
+	
+	#rem monkeydoc Destroys all entities in the scene.
+	#end
+	Method DestroyAllEntities()
+		
+		While Not _rootEntities.Empty
+
+			_rootEntities.Top.Destroy()
+		Wend
+	End
+	
+	#rem monkeydoc Updates the scene.
+	#end
+	Method Update()
+		
+		Global time:=0.0
+		
+		Local elapsed:=0.0
+		
+		If time
+			elapsed=Now()-time
+			time+=elapsed
+		Else
+			time=Now()
+		Endif
+		
+		Update( elapsed )
+	End
+	
+	#rem monkeydoc Renders the scene to	a canvas.
+	#end
+	Method Render( canvas:Canvas )
+		
+		For Local camera:=Eachin _cameras
+			
+			camera.Render( canvas )
+		Next
+	End
+	
+	Method RayCast:RayCastResult( rayFrom:Vec3f,rayTo:Vec3f,collisionMask:Int )
+		
+		Return _world.RayCast( rayFrom,rayTo,collisionMask )
+	End
+
+	#rem monkeydoc Enumerates all entities in the scene with null parents.
+	#end
+	Method GetRootEntities:Entity[]()
+		
+		Return _rootEntities.ToArray()
+	End
+	
+	'***** serialization stuff *****
+	
+	Property Editable:Bool()
+		
+		Return _editable
+	End
+	
+	Property Editing:Bool()
+		
+		Return _editing
+	
+	Setter( editing:Bool )
+		
+		If editing And Not _editable RuntimeError( "Scene is not editable" )
+		
+		_editing=editing
+	End
+	
+	Property Jsonifier:Jsonifier()
+		
+		Return _jsonifier
+	End
+	
+	Method LoadTexture:Texture( path:String,flags:TextureFlags,flipNormalY:Bool=False )
+		
+		Local texture:=Texture.Load( path,flags,flipNormalY )
+		If Not texture Return Null
+		
+		If Editing Jsonifier.AddInstance( texture,"mojo3d.Scene.LoadTexture",Self,New Variant[]( path,flags,flipNormalY ) )
+			
+		Return texture
+	End
+
+	#rem monkeydoc Saves the scene to a mojo3d scene file
+	#end
+	Method Save( path:String )
+		
+		Assert( _jsonifier,"Scene is not editable" )
+		
+		Local jobj:=_jsonifier.JsonifyInstances()
+		
+		Local json:=jobj.ToJson()
+		
+		SaveString( json,path )
+	End
+
+	#rem monkeydoc Loads a mojo3d scene file and makes it current
+	#end
+	Function Load:Scene( path:String )
+		
+		Local json:=LoadString( path )
+		If Not json Return Null
+		
+		Local jobj:=JsonObject.Parse( json )
+		If Not jobj Return Null
+		
+		Local scene:=New Scene( True )
+		
+		SetCurrent( scene )
+		
+		scene.Jsonifier.DejsonifyInstances( jobj )
+		
+		Return scene
+	End
+	
+	#rem monkeydoc Sets the current scene.
+	
+	All newly created entities (including entites created using Entity.Copy]]) are automatically added to the current scene.
+	
+	#end
+	Function SetCurrent( scene:Scene )
+		
+		_current=scene
+	End
+	
+	#rem monkeydoc Gets the current scene.
+	
+	If there is no current scene, a new scene is automatically created and made current.
+		
+	#end
+	Function GetCurrent:Scene()
+
+		If Not _current New Scene
+			
+		Return _current
+	End
+	
+	Internal
+
+	Property PostEffects:Stack<PostEffect>()
+		
+		Return _postEffects
+	End
+	
+	Property RootEntities:Stack<Entity>()
+		
+		Return _rootEntities
+	End
+	
+	Property Cameras:Stack<Camera>()
+		
+		Return _cameras
+	End
+	
+	Property Lights:Stack<Light>()
+		
+		Return _lights
+	End
+	
+	Property Renderables:Stack<Renderable>()
+	
+		Return _renderables
+	End
+	
+	Property World:World()
+		
+		Return _world
+	End
+	
+	Private
+	
+	Global _current:Scene
+	Global _defaultEnv:Texture
+	
+	Field _skyTexture:Texture
+	Field _envTexture:Texture
+	Field _envColor:Color
+	
+	Field _clearColor:Color
+	Field _ambientDiffuse:Color
+	
+	Field _fogColor:Color
+	Field _fogNear:Float
+	Field _fogFar:Float
+	
+	Field _shadowAlpha:Float=1
+
+	Field _updateRate:Float=60
+	Field _maxSubSteps:Int=1
+	
+	Field _csmSplits:=New Float[]( 8.0,16.0,64.0,256.0 )
+	
+	Field _rootEntities:=New Stack<Entity>
+	Field _cameras:=New Stack<Camera>
+	Field _lights:=New Stack<Light>
+	Field _renderables:=New Stack<Renderable>()
+	Field _postEffects:=New Stack<PostEffect>
+	
+	Field _world:World
+	
+	Field _jsonifier:Jsonifier
+	Field _editable:Bool
+	Field _editing:Bool
+	
+	Method Update( elapsed:Float )
+		
+		For Local e:=Eachin _rootEntities
+			e.BeginUpdate()
+		Next
+		
+		_world.Update( elapsed )
+		
+		For Local e:=Eachin _rootEntities
+			e.Update( elapsed )
+		Next
+	End
+			
+End

+ 89 - 0
modules/mojo3d/tests/test.monkey2

@@ -0,0 +1,89 @@
+Namespace myapp3d
+
+#Import "<std>"
+#Import "<mojo>"
+#Import "<mojo3d>"
+
+#Reflect mojo3d
+
+#Import "assets/mossy-ground1.pbr/@/mossy-ground1.pbr"
+
+Using std..
+Using mojo..
+Using mojo3d..
+
+Class MyWindow Extends Window
+	
+	Field _scene:Scene
+	Field _camera:Camera
+	Field _light:Light
+	Field _ground:Model
+	Field _donut:Model
+	
+	
+	Method New( title:String="Simple mojo3d app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable )
+		
+		Super.New( title,width,height,flags )
+	End
+	
+	Method OnCreateWindow() Override
+		
+		'Xreate editable scene and makes it current
+		_scene=New Scene( True )
+		
+		_scene.ClearColor = New Color( 0.2, 0.6, 1.0 )
+		_scene.AmbientLight = _scene.ClearColor * 0.25
+		_scene.FogColor = _scene.ClearColor
+		_scene.FogFar = 1.0
+		_scene.FogFar = 200.0
+		
+		'create camera
+		_camera=New Camera( Self )
+		_camera.AddComponent<FlyBehaviour>()
+		_camera.Move( 0,2.5,-5 )
+		
+		'create light
+		_light=New Light
+		_light.CastsShadow=True
+		_light.Rotate( 45, 45, 0 )
+		
+		'create ground
+		Local groundBox:=New Boxf( -100,-1,-100,100,0,100 )
+		Local groundMaterial:=New PbrMaterial( Color.Lime )
+		_ground=Model.CreateBox( groundBox,1,1,1,groundMaterial )
+		_ground.CastsShadow=False
+		
+		'create donut
+		Local donutMaterial:=PbrMaterial.Load( "asset::mossy-ground1.pbr" )
+		_donut=Model.CreateTorus( 2,.5,48,24,donutMaterial )
+		_donut.Move( 0,2.5,0 )
+		
+		Print "Saving..."
+		
+		_scene.Save( "test.mojo3d" )
+		
+		Print "Loading..."
+		
+		Scene.Load( "test.mojo3d" )
+		
+	End
+	
+	Method OnRender( canvas:Canvas ) Override
+		
+		RequestRender()
+		_donut.Rotate( .2,.4,.6 )
+		_scene.Update()
+		_camera.Render( canvas )
+		canvas.DrawText( "FPS="+App.FPS,0,0 )
+	End
+	
+End
+
+Function Main()
+
+	New AppInstance
+	
+	New MyWindow
+	
+	App.Run()
+End

File diff suppressed because it is too large
+ 95 - 261
shapes-scene.mojo3d


+ 9 - 2
src/createrelease/createrelease.monkey2

@@ -5,11 +5,13 @@
 Using libc..
 Using libc..
 Using std..
 Using std..
 
 
-Const MX2CC_VERSION:="1.1.11"
+Const MONKEY2_VERSION:="2018.04"
+
+Const MX2CC_VERSION:="1.1.12"
 
 
 Const RELEASE_SUFFIX:=""
 Const RELEASE_SUFFIX:=""
 
 
-Const OUTPUT:="Monkey2-v"+MX2CC_VERSION+RELEASE_SUFFIX
+Const OUTPUT:="Monkey2-v"+MONKEY2_VERSION+RELEASE_SUFFIX
 
 
 Const IGNORE:="
 Const IGNORE:="
 .gitignore
 .gitignore
@@ -131,6 +133,11 @@ Function CopyRelease()
 	Copy( "LICENSE.TXT" )
 	Copy( "LICENSE.TXT" )
 	Copy( "README.TXT" )
 	Copy( "README.TXT" )
 	
 	
+	Copy( "ducks-scene.mojo3d" )
+	Copy( "shapes-scene.mojo3d" )
+	Copy( "sprites-scene.mojo3d" )
+	Copy( "test-scene.mojo3d" )
+	
 #If __TARGET__="windows"
 #If __TARGET__="windows"
 	Copy( "Monkey2 (Windows).exe" )
 	Copy( "Monkey2 (Windows).exe" )
 #Else if __TARGET__="macos"
 #Else if __TARGET__="macos"

+ 3 - 3
src/mx2cc/builder.monkey2

@@ -235,6 +235,7 @@ Class BuilderInstance
 				
 				
 				Local path:=fdecl.imports[imp]
 				Local path:=fdecl.imports[imp]
 				
 				
+				
 				Local i:=path.FindLast( "[" )
 				Local i:=path.FindLast( "[" )
 				If i<>-1 And path.EndsWith( "]" )
 				If i<>-1 And path.EndsWith( "]" )
 					BuildEx.srcpos=Int( path.Slice( i+1,-1 ) )
 					BuildEx.srcpos=Int( path.Slice( i+1,-1 ) )
@@ -417,7 +418,7 @@ Class BuilderInstance
 				Endif
 				Endif
 			Endif
 			Endif
 			
 			
-			'Ugly stuff for generic instances - needs more FIXING!
+			'Ugly stuff for generic instances - but hey, it works!
 			'
 			'
 			Local transFiles:=New StringMap<FileDecl>
 			Local transFiles:=New StringMap<FileDecl>
 			
 			
@@ -441,7 +442,7 @@ Class BuilderInstance
 				Endif
 				Endif
 				
 				
 				If Not transFile Or transFile.module=module Continue
 				If Not transFile Or transFile.module=module Continue
-
+				
 				Local transFile2:=transFile
 				Local transFile2:=transFile
 
 
 				transFile=transFiles[transFile2.ident]
 				transFile=transFiles[transFile2.ident]
@@ -463,7 +464,6 @@ Class BuilderInstance
 					transFile.exhfile=transFile2.hfile
 					transFile.exhfile=transFile2.hfile
 					transFile.hfile=module.hfileDir+transFile.ident+".h"
 					transFile.hfile=module.hfileDir+transFile.ident+".h"
 					transFile.cfile=module.cfileDir+transFile.ident+".cpp"
 					transFile.cfile=module.cfileDir+transFile.ident+".cpp"
-'					transFile.rfile=module.cfileDir+"r_"+transFile.ident+".cpp"
 					
 					
 					transFiles[transFile2.ident]=transFile
 					transFiles[transFile2.ident]=transFile
 					
 					

+ 2 - 0
src/mx2cc/buildproduct.monkey2

@@ -443,6 +443,7 @@ Class GccBuildProduct Extends BuildProduct
 			Endif
 			Endif
 			
 			
 			'A bit dodgy - rip out -arch's from ios
 			'A bit dodgy - rip out -arch's from ios
+			#rem
 			If opts.target="ios"
 			If opts.target="ios"
 				Repeat
 				Repeat
 					Local i0:=cmd.Find( " -arch "  )
 					Local i0:=cmd.Find( " -arch "  )
@@ -453,6 +454,7 @@ Class GccBuildProduct Extends BuildProduct
 				Forever
 				Forever
 				If opts.arch<>"x64" cmd+=" -arch armv7"
 				If opts.arch<>"x64" cmd+=" -arch armv7"
 			Endif
 			Endif
+			#end
 			
 			
 			cmd+=" -MMD -MF~q"+deps+"~q"
 			cmd+=" -MMD -MF~q"+deps+"~q"
 			cmd+=" -o ~q"+obj+"~q ~q"+src+"~q"
 			cmd+=" -o ~q"+obj+"~q ~q"+src+"~q"

+ 1 - 1
src/mx2cc/mx2cc.monkey2

@@ -22,7 +22,7 @@ Global opts_time:Bool
 
 
 Global StartDir:String
 Global StartDir:String
 
 
-'Const TestArgs:="mx2cc makemods"
+Const TestArgs:="mx2cc makedocs mojo"
  
  
 'Const TestArgs:="mx2cc makeapp src/mx2cc/test.monkey2"
 'Const TestArgs:="mx2cc makeapp src/mx2cc/test.monkey2"
 Const TestArgs:="mx2cc makeapp -parse -geninfo src/mx2cc/test.monkey2"
 Const TestArgs:="mx2cc makeapp -parse -geninfo src/mx2cc/test.monkey2"

+ 1 - 1
src/mx2cc/newdocs/docsbuffer.monkey2

@@ -43,7 +43,7 @@ Class DocsBuffer
 			Return
 			Return
 		Endif
 		Endif
 
 
-		If _pre=-1 line=tline Else Print line
+		If _pre=-1 line=tline
 		
 		
 		If Not line And _lines.Length And Not _lines.Top Return
 		If Not line And _lines.Length And Not _lines.Top Return
 		
 		

+ 23 - 1
src/mx2cc/newdocs/docsmaker.monkey2

@@ -326,7 +326,7 @@ Class DocsMaker
 
 
 			If Not name 
 			If Not name 
 				name=path
 				name=path
-				If _module=ctype.transFile.module
+				If module=_module
 					Local i:=name.FindLast( "." )
 					Local i:=name.FindLast( "." )
 					If i<>-1 name=name.Slice( i+1 )
 					If i<>-1 name=name.Slice( i+1 )
 				Endif
 				Endif
@@ -335,6 +335,28 @@ Class DocsMaker
 			Return outer+"[["+module.name+":"+path+"|"+name+"]]"+types
 			Return outer+"[["+module.name+":"+path+"|"+name+"]]"+types
 		Endif
 		Endif
 		
 		
+		Local etype:=Cast<EnumType>( type )
+		If etype
+			
+			Local module:=etype.transFile.module
+			
+			Local outer:=""
+			Local cscope:=Cast<ClassScope>( etype.scope.outer )
+			If cscope And Not name outer=TypeName( cscope.ctype )+"."
+			
+			Local path:=etype.Name
+			
+			If Not name
+				name=path
+				If module=_module
+					Local i:=name.FindLast( "." )
+					If i<>-1 name=name.Slice( i+1 )
+				Endif
+			Endif
+			
+			Return outer+"[["+module.name+":"+path+"|"+name+"]]"
+		Endif
+		
 		Local gtype:=Cast<GenArgType>( type )
 		Local gtype:=Cast<GenArgType>( type )
 		If gtype
 		If gtype
 			Return gtype.ident
 			Return gtype.ident

+ 20 - 33
test-scene.mojo3d

@@ -1,14 +1,16 @@
 {
 {
+	"assetsDir":"D:/dev/monkey2/tmp/untitled1.products/Windows/assets/",
 	"instances":[{
 	"instances":[{
 		"ctor":{
 		"ctor":{
-			"args":[],
+			"args":[true],
 			"decl":"mojo3d.Scene.New",
 			"decl":"mojo3d.Scene.New",
-			"type":"Void()"
+			"type":"Void(Bool)"
 		},
 		},
-		"id":"@0",
+		"id":0,
 		"state":{
 		"state":{
-			"AmbientLight":[0,0.125,0.25,0.25],
-			"FogColor":[0,0.5,1,1],
+			"AmbientLight":[0.05000000074505806,0.15000000596046448,0.25,0.25],
+			"ClearColor":[0.20000000298023224,0.60000002384185791,1,1],
+			"FogColor":[0.20000000298023224,0.60000002384185791,1,1],
 			"FogFar":200
 			"FogFar":200
 		},
 		},
 		"type":"mojo3d.Scene"
 		"type":"mojo3d.Scene"
@@ -18,7 +20,7 @@
 			"decl":"mojo3d.Camera.New",
 			"decl":"mojo3d.Camera.New",
 			"type":"Void(mojo3d.Entity)"
 			"type":"Void(mojo3d.Entity)"
 		},
 		},
-		"id":"@1",
+		"id":1,
 		"state":{
 		"state":{
 			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0,2.5,-5],
 			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0,2.5,-5],
 			"Visible":true
 			"Visible":true
@@ -30,10 +32,7 @@
 			"decl":"mojo3d.FlyBehaviour.New",
 			"decl":"mojo3d.FlyBehaviour.New",
 			"type":"Void(mojo3d.Entity)"
 			"type":"Void(mojo3d.Entity)"
 		},
 		},
-		"id":"@2",
-		"state":{
-
-		},
+		"id":2,
 		"type":"mojo3d.FlyBehaviour"
 		"type":"mojo3d.FlyBehaviour"
 	},{
 	},{
 		"ctor":{
 		"ctor":{
@@ -41,7 +40,7 @@
 			"decl":"mojo3d.Light.New",
 			"decl":"mojo3d.Light.New",
 			"type":"Void(mojo3d.Entity)"
 			"type":"Void(mojo3d.Entity)"
 		},
 		},
-		"id":"@3",
+		"id":3,
 		"state":{
 		"state":{
 			"CastsShadow":true,
 			"CastsShadow":true,
 			"LocalMatrix":[0.70710676908493042,0,0.70710676908493042,-0.49999997019767761,0.70710676908493042,0.49999997019767761,-0.49999997019767761,-0.70710676908493042,0.49999997019767761,0,0,0],
 			"LocalMatrix":[0.70710676908493042,0,0.70710676908493042,-0.49999997019767761,0.70710676908493042,0.49999997019767761,-0.49999997019767761,-0.70710676908493042,0.49999997019767761,0,0,0],
@@ -54,10 +53,7 @@
 			"decl":"mojo3d.PbrMaterial.New",
 			"decl":"mojo3d.PbrMaterial.New",
 			"type":"Void(std.graphics.Color,Float,Float,Bool)"
 			"type":"Void(std.graphics.Color,Float,Float,Bool)"
 		},
 		},
-		"id":"@4",
-		"state":{
-
-		},
+		"id":4,
 		"type":"mojo3d.PbrMaterial"
 		"type":"mojo3d.PbrMaterial"
 	},{
 	},{
 		"ctor":{
 		"ctor":{
@@ -65,10 +61,7 @@
 			"decl":"mojo3d.Mesh.CreateBox",
 			"decl":"mojo3d.Mesh.CreateBox",
 			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
 			"type":"mojo3d.Mesh(std.geom.Box<monkey.types.Float>,Int,Int,Int)"
 		},
 		},
-		"id":"@5",
-		"state":{
-
-		},
+		"id":5,
 		"type":"mojo3d.Mesh"
 		"type":"mojo3d.Mesh"
 	},{
 	},{
 		"ctor":{
 		"ctor":{
@@ -76,9 +69,9 @@
 			"decl":"mojo3d.Model.New",
 			"decl":"mojo3d.Model.New",
 			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
 			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
 		},
 		},
-		"id":"@6",
+		"id":6,
 		"state":{
 		"state":{
-			"Material":"@4",
+			"Materials":["@4"],
 			"Mesh":"@5",
 			"Mesh":"@5",
 			"Visible":true
 			"Visible":true
 		},
 		},
@@ -89,10 +82,7 @@
 			"decl":"mojo3d.PbrMaterial.New",
 			"decl":"mojo3d.PbrMaterial.New",
 			"type":"Void(std.graphics.Color,Float,Float,Bool)"
 			"type":"Void(std.graphics.Color,Float,Float,Bool)"
 		},
 		},
-		"id":"@7",
-		"state":{
-
-		},
+		"id":7,
 		"type":"mojo3d.PbrMaterial"
 		"type":"mojo3d.PbrMaterial"
 	},{
 	},{
 		"ctor":{
 		"ctor":{
@@ -100,10 +90,7 @@
 			"decl":"mojo3d.Mesh.CreateTorus",
 			"decl":"mojo3d.Mesh.CreateTorus",
 			"type":"mojo3d.Mesh(Float,Float,Int,Int)"
 			"type":"mojo3d.Mesh(Float,Float,Int,Int)"
 		},
 		},
-		"id":"@8",
-		"state":{
-
-		},
+		"id":8,
 		"type":"mojo3d.Mesh"
 		"type":"mojo3d.Mesh"
 	},{
 	},{
 		"ctor":{
 		"ctor":{
@@ -111,10 +98,10 @@
 			"decl":"mojo3d.Model.New",
 			"decl":"mojo3d.Model.New",
 			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
 			"type":"Void(mojo3d.Mesh,mojo3d.Material,mojo3d.Entity)"
 		},
 		},
-		"id":"@9",
+		"id":9,
 		"state":{
 		"state":{
 			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0,2.5,0],
 			"LocalMatrix":[1,0,0,0,1,0,0,0,1,0,2.5,0],
-			"Material":"@7",
+			"Materials":["@7"],
 			"Mesh":"@8",
 			"Mesh":"@8",
 			"Visible":true
 			"Visible":true
 		},
 		},
@@ -125,9 +112,9 @@
 			"decl":"mojo3d.RotateBehaviour.New",
 			"decl":"mojo3d.RotateBehaviour.New",
 			"type":"Void(mojo3d.Entity)"
 			"type":"Void(mojo3d.Entity)"
 		},
 		},
-		"id":"@10",
+		"id":10,
 		"state":{
 		"state":{
-			"Speed":[0.20000000298023224,0.40000000596046448,0.60000002384185791]
+			"Speed":[0.10000000149011612,0.20000000298023224,0.30000001192092896]
 		},
 		},
 		"type":"mojo3d.RotateBehaviour"
 		"type":"mojo3d.RotateBehaviour"
 	}]
 	}]

Some files were not shown because too many files changed in this diff