This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| 'use strict'; | |
| var FLOAT_VIEW = new Float32Array( 1 ), | |
| INT_VIEW = new Uint32Array( FLOAT_VIEW.buffer ), | |
| rsqrt = function( number ) { | |
| var x2 = 0.5 * number; | |
| FLOAT_VIEW[0] = number; | |
| INT_VIEW[0] = 0x5f3759df - ( INT_VIEW[0] >>> 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| terrain_shader = new TerraFrame.TerrainShader({ | |
| uniforms: [ | |
| { name: 'sunlight_dir', type: 'v3', value: new THREE.Vector3( -.5, .8, .7 ) } | |
| ], | |
| textures: [ | |
| { name: 'grass', asset: 'terrain.grass', repeat: new THREE.Vector2( 2, 2 ) }, | |
| { name: 'rock', asset: 'terrain.rock', repeat: new THREE.Vector2( 3, 3 ) }, | |
| { name: 'sand', asset: 'terrain.sand', repeat: new THREE.Vector2( 2, 2 ) } | |
| ], | |
| pieces: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TerraFrame.TerrainShader = function ( shader_config ) { | |
| var i, vertexShader, fragmentShader; | |
| shader_config = TerraFrame.utils.merge( | |
| { | |
| uniforms: [], | |
| textures: [], | |
| pieces: [], | |
| pervertex_textures: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var collisionsound1 = new buzz.sound( "assets/sounds/collision1", { | |
| formats: [ 'wav' ] | |
| }); | |
| collisionsound1.load(); | |
| var collisionsound2 = new buzz.sound( "assets/sounds/collision2", { | |
| formats: [ 'wav' ] | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| THREE.CSG | |
| @author Chandler Prall <[email protected]> http://chandler.prallfamily.com | |
| Wrapper for Evan Wallace's CSG library (https://github.com/evanw/csg.js/) | |
| Provides CSG capabilities for Three.js models. | |
| Provided under the MIT License | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="csg.js"></script> | |
| <script type="text/javascript" src="http://chandler.prallfamily.com/threebuilds/builds/r46/ThreeDebug.js"></script> | |
| <script type="text/javascript" src="ThreeBSP.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| THREE.Vector3.prototype.lerp = function ( a, t ) { | |
| return this.clone().addSelf( a.clone().subSelf( this ).multiplyScalar( t ) ); | |
| }; | |
| THREE.Vertex.prototype.interpolate = function( other, t ) { | |
| var v = new THREE.Vertex( this.position.lerp( other.position, t ) ); | |
| v.normal = this.normal.clone(); | |
| return v; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import copy | |
| class State(object): | |
| solutions = [] | |
| def __init__(self): | |
| self.zombied = [] | |
| self.bridged = [] | |
| self.flashlight = 'zombied' | |
| self.weight = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Uses PySQLPool (http://code.google.com/p/pysqlpool/) for the database connection. | |
| from PySQLPool.PySQLConnection import PySQLConnection | |
| from PySQLPool.PySQLQuery import PySQLQuery | |
| import urllib2 | |
| import threading | |
| import sys | |
| dbconn = PySQLConnection(host='localhost',user='user',password='password',port=3306,db='schema',charset='utf8') | |
| query = PySQLQuery(dbconn, commitOnEnd=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib2 | |
| import threading | |
| from Queue import Queue | |
| import sys, os, re | |
| class ThreadedDownload(object): | |
| REGEX = { | |
| 'hostname_strip':re.compile('.*\..*?/', re.I) | |
| } |