|
@@ -6,12 +6,41 @@ var node = self.node;
|
|
|
function start() {
|
|
function start() {
|
|
|
|
|
|
|
|
var scene = game.scene;
|
|
var scene = game.scene;
|
|
|
|
|
+ var cache = game.cache;
|
|
|
|
|
+
|
|
|
|
|
+ // zone
|
|
|
|
|
+ var zoneNode = scene.createChild("Zone")
|
|
|
|
|
+ var zone = zoneNode.createComponent("Zone");
|
|
|
|
|
+ zone.boundingBox = [-1000, -1000, -1000, 1000, 1000 , 1000];
|
|
|
|
|
+ zone.ambientColor = [0.15, 0.15, 0.15];
|
|
|
|
|
+ zone.fogColor = [0.5, 0.5, 0.7, 1.0];
|
|
|
|
|
+ zone.fogStart = 10;
|
|
|
|
|
+ zone.fogEnd = 100;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
var lightNode = scene.createChild("Directional Light");
|
|
var lightNode = scene.createChild("Directional Light");
|
|
|
lightNode.direction = [0.6, -1.0, 0.8];
|
|
lightNode.direction = [0.6, -1.0, 0.8];
|
|
|
var light = lightNode.createComponent("Light")
|
|
var light = lightNode.createComponent("Light")
|
|
|
light.lightType = Atomic.LIGHT_DIRECTIONAL;
|
|
light.lightType = Atomic.LIGHT_DIRECTIONAL;
|
|
|
|
|
|
|
|
|
|
+ light.castShadows = true;
|
|
|
|
|
+ light.setShadowCascade(10.0, 50.0, 200.0, 0.0, 0.8);
|
|
|
|
|
+ light.setShadowBias(0.00025, 0.5);
|
|
|
|
|
+ light.specularIntensity = 8;
|
|
|
|
|
+
|
|
|
|
|
+ // create the grid plane
|
|
|
|
|
+ var planeNode = scene.createChild("Plane");
|
|
|
|
|
+ planeNode.scale = [100.0, 1.0, 100.0];
|
|
|
|
|
+ var planeObject = planeNode.createComponent("StaticModel");
|
|
|
|
|
+
|
|
|
|
|
+ var model = cache.getResource("Model", "Models/Plane.mdl");
|
|
|
|
|
+ var material = cache.getResource("Material", "Materials/BlueGrid.xml");
|
|
|
|
|
+
|
|
|
|
|
+ planeObject.model = model;
|
|
|
|
|
+ planeObject.material = material;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// add the roboman
|
|
// add the roboman
|
|
|
var roboman = node.createChild("TheRoboMan");
|
|
var roboman = node.createChild("TheRoboMan");
|
|
|
roboman.createJSComponent("RoboMan");
|
|
roboman.createJSComponent("RoboMan");
|