Browse Source

ToonTown tweaks

Josh Engebretson 10 years ago
parent
commit
1c6a680118

+ 1 - 1
ToonTown/Resources/Components/AvatarController.js

@@ -259,7 +259,7 @@ function postUpdate(timestep) {
 
         var rayDir = vec3.create();
         vec3.transformQuat(rayDir, [0, 0, -1], dir);
-        vec3.scale(rayDir, rayDir, 12);
+        vec3.scale(rayDir, rayDir, 8);
 
         vec3.add(aimPoint, aimPoint, rayDir);
 

+ 16 - 28
ToonTown/Resources/Components/Scene.js

@@ -7,36 +7,25 @@ function start() {
 
     var scene = game.scene;
     
-    var procSky = self.procSky = scene.createComponent("ProcSky");
-    procSky.setDayTime(time); 
-    
-    var lightNodes = scene.getChildrenWithComponent("Light", true); 
-    for (var i = 0; i < lightNodes.length; i++)  {
-        lightNodes[i].createJSComponent("LightFlicker");  
-    } 
-
-    /*
-    // If we're running on android tweak the shadows
-    if (Atomic.platform == "Android") {
-
-        light.setShadowCascade(20.0, 50.0, 200.0, 0.0, 0.9);
-        light.shadowIntensity = 0.33;
-    } else {
-        light.setShadowCascade(10.0, 50.0, 200.0, 0.0, 0.8);
+    // Add light flickers
+    var lightNodes = scene.getChildrenWithComponent("Light", true);
+    for (var i = 0; i < lightNodes.length; i++) {
+        lightNodes[i].createJSComponent("LightFlicker");
     }
-
-    light.setShadowBias(0.00025, 0.5);
-    */
+    
+    // create the procedural sky
+    var pnode = scene.createChild();
+    var procSky = self.procSky = pnode.createComponent("ProcSky");
+    
+    procSky.setDayTime(time);
 
     // add the roboman
-    
+
     var spawnPoint = scene.getChild("PlayerInfoStart", true);
-    
-    
+
     var roboman = node.createChild("TheRoboMan");
     roboman.createJSComponent("RoboMan");
-    if (spawnPoint)
-    {
+    if (spawnPoint) {
         roboman.position = spawnPoint.position;
     }
 
@@ -46,13 +35,12 @@ function start() {
     var musicSource = musicNode.createComponent("SoundSource");
     musicSource.gain = .5;
     musicSource.soundType = Atomic.SOUND_MUSIC;
-    musicSource.play(musicFile);    
-
+    musicSource.play(musicFile);
 
 }
 
 function update(timeStep) {
 
-    time += timeStep * .1;
-    self.procSky.setDayTime(time); 
+    time += timeStep * .08;
+    self.procSky.setDayTime(time);
 }

+ 7 - 0
ToonTown/Resources/Scripts/main.js

@@ -19,7 +19,14 @@ function start() {
 	node.createJSComponent("Scene");
 	
     if (Atomic.platform == "iOS" || Atomic.platform == "Android")
+    {        
 	    node.createJSComponent("TouchInput");
+	}
+	else
+	{
+	    // bump the shadowmap size up so it is crisper
+	    game.renderer.shadowMapSize = 2048;
+	}
 	
 
 }