This file contains 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
# specs: | |
# https://tools.ietf.org/html/rfc6121 - XMPP | |
# http://xmpp.org/extensions/xep-0045.html - Multi-User Chat | |
# Raised Events: | |
# xmpp_invite_accepted | |
# xmpp_add_invite | |
# xmpp_roster_update | |
app.service 'XMPP', ['$rootScope', 'Config', '$q', 'Account', 'User', 'Roster', ($rootScope, Config, $q, Account, User, Roster)-> | |
xmpp = new JSJaCWebSocketConnection | |
# oDbg: new JSJaCConsoleLogger 4 |
This file contains 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
// Generated by CoffeeScript 1.6.3 | |
(function() { | |
window._RTCPeerConnection = window.mozRTCPeerConnection || window.webkitRTCPeerConnection || window.RTCPeerConnection; | |
window._RTCSessionDescription = window.webkitRTCSessionDescription || window.mozRTCSessionDescription || window.RTCSessionDescription; | |
window._IceCandidate = window.mozRTCIceCandidate || window.RTCIceCandidate; | |
if (!window._RTCPeerConnection) { | |
console.error('Your browser doesn\'t support WebRTC'); |
This file contains 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
// Generated by CoffeeScript 1.6.3 | |
(function() { | |
app.service('XMPP', [ | |
'$rootScope', 'Config', '$q', 'Account', 'User', 'Roster', function($rootScope, Config, $q, Account, User, Roster) { | |
var basicHandlers, connected, handler, name, xmpp; | |
xmpp = new JSJaCWebSocketConnection({ | |
oDbg: null, | |
httpbase: Config.httpbase, | |
timerval: 500 | |
}); |
This file contains 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
var head = this.mesh.getObjectByName("FPSCharacter.head"); | |
var camera = head.children[0]; | |
var startPoint = head.position.clone().applyMatrix4(this.mesh.matrixWorld); | |
var endPoint = camera.position.clone().applyMatrix4(this.mesh.matrixWorld); | |
var directionPoint = endPoint.sub(startPoint).normalize(); | |
var ray = new THREE.Raycaster(startPoint, directionPoint, 0, 50); | |
var collisionResult = ray.intersectObject(V3.RenderSystem.scene.getObjectByName('Room')); |
This file contains 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
animate: (t) -> | |
@render() | |
window.requestAnimationFrame @animate.bind @ | |
render: -> | |
@sceneHelpers.updateMatrixWorld() | |
@scene.updateMatrixWorld() | |
@renderer.render @scene, @camera | |
@renderer.render @sceneHelpers, @camera |
This file contains 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
raycaster.setFromCamera mouse, camera | |
intersects = raycaster.intersectObjects [terrain] | |
if intersects.length > 0 | |
geometry = intersects[0].object.geometry | |
vertex = geometry.vertices[intersects[0].face.a] | |
geometry.vertices[0].z++ | |
vertex.z++ | |
geometry.computeFaceNormals() | |
geometry.computeVertexNormals() |
This file contains 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
* | |
padding: 0 | |
margin: 0 |
This file contains 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
attribute float height; | |
varying vec2 vUv; | |
${THREE.ShaderChunk["shadowmap_pars_vertex"]} | |
void main(){ | |
vUv = uv; | |
vec3 newPosition = position + normal * height; | |
gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition,1.0); | |
${THREE.ShaderChunk["shadowmap_vertex"]} | |
} |
This file contains 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
@tileMaterial = new THREE.ShaderMaterial | |
uniforms: THREE.UniformsLib["shadowmap"] | |
vertexShader: [ | |
THREE.ShaderChunk[ "shadowmap_pars_vertex" ] | |
THREE.ShaderChunk[ "shadowmap_vertex" ] | |
ShaderLoader.get 'terrainV' | |
].join "\n" | |
fragmentShader: [ | |
THREE.ShaderChunk[ "shadowmap_pars_fragment" ] | |
ShaderLoader.get 'terrainF' |
This file contains 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
geometry = new THREE.PlaneGeometry 2000, 2000, 596, 596 | |
console.log geometry.vertices.length | |
j = 0 | |
for i in [0..geometry.vertices.length-1] | |
geometry.vertices[i].z = (data[j]) | |
j += 4 | |
console.log "done" | |
geometry.computeFaceNormals() | |
geometry.computeVertexNormals() |