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
walk src_dir, (err, results) -> | |
stream = process.stdout | |
stream.write "# DO NOT MODIFY - Generated file\n#\n\n" | |
for pattern, hook of asset_hooks | |
results | |
.filter((asset_path) -> asset_path.match(pattern)) | |
.forEach (asset_path) -> | |
rel = path.relative(src_dir, asset_path) | |
stream.write "module.exports['#{rel}'] = \"\"\"" | |
fs.createReadStream(asset_path) |
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(root) { | |
function foo() { | |
console.log("foo"); | |
} | |
function foo2() { | |
console.log("foo2"); | |
} | |
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
touch .git/hooks/pre-commit | |
chmod +x .git/hooks/pre-commit | |
cat > .git/hooks/pre-commit | |
#!/bin/sh | |
make test |
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
return class AABB | |
@property 'size', | |
get: -> @max.sub(@min, new Vec3) | |
@property 'vertices', | |
get: -> [ | |
new Vec3(new Float32Array([@min.x, @min.y, @min.z])) | |
new Vec3(new Float32Array([@max.x, @min.y, @min.z])) | |
new Vec3(new Float32Array([@max.x, @min.y, @max.z])) | |
new Vec3(new Float32Array([@min.x, @min.y, @max.z])) |
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
return class Sun extends require('events') | |
constructor: (gui, @bounds, @orientation=104, @elevation=60) -> | |
gui.remember @ | |
super() | |
folder = gui.addFolder('Sun') | |
folder.add(@, 'orientation', 0, 360).onChange(@update) | |
folder.add(@, 'elevation', 0, 90).onChange(@update) | |
@size = @bounds.size.length | |
@center = @bounds.min.add(@bounds.size.div 2, new Vec3) |
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::property = (prop, desc) -> | |
Object.defineProperty @prototype, prop, desc | |
arrayExcept = (arr, idx) -> | |
res = arr[0..] | |
res.splice idx, 1 | |
res | |
combine = (str) -> | |
fn = (active, rest, a) -> |
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
<script> | |
//<![CDATA[ | |
document.write("<script type='text/javascript' src='http://" + window.location.hostname + ":9810/compile?id=areas-serve&mode=RAW'><\/script>"); | |
//]]> | |
</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
Function::property = (prop, desc) -> | |
Object.defineProperty @prototype, prop, desc | |
typed_concat = (type, a, b) -> | |
alen = a.length | |
result = new type(alen + b.length) | |
result.set(a) | |
result.set(b, alen) | |
result | |
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::property = (prop, desc) -> | |
Object.defineProperty @prototype, prop, desc | |
class vec3i | |
X = 0 | |
Y = 1 | |
Z = 2 | |
constructor: (x, y, z) -> | |
@data = new Uint32Array() | |
@data[X] = x |
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
/** | |
* Extended version of THREE.ShadowMapPluginVSM using VSM shadow mapping. | |
* @author Dusan Maliarik | |
*/ | |
THREE.ShadowMapPluginVSM = function ( ) { | |
var _gl, | |
_renderer, | |
_depthMaterial, _depthMaterialMorph, _depthMaterialSkin, _depthMaterialMorphSkin, |