Permalink
Browse files

Fixing a lot of little stuff..

  • Loading branch information...
Etienne Etienne
Etienne authored and Etienne committed Aug 18, 2017
1 parent 50eb143 commit 9d6f6562da3878ea650e39f3638c98ae36f1b3d7
Showing with 612,242 additions and 84,425 deletions.
  1. +1 −1 README.md
  2. BIN build/Hologram.zip
  3. +37 −58 build/Hologram/Project/hologram/hologram.js
  4. +1 −1 build/Hologram/Project/hologram/hologram.js.map
  5. +35 −0 build/builds.hologram.cool/index.html
  6. BIN build/builds.hologram.cool/version/latest/Hologram.zip
  7. +13 −13 build/builds.hologram.cool/version/latest/hologram.js
  8. +1 −1 build/builds.hologram.cool/version/latest/hologram.js.map
  9. +37 −58 build/hologram.js
  10. +1 −1 build/hologram.js.map
  11. +1 −0 config.coffee
  12. +8 −0 dist/Version.coffee
  13. +7,961 −0 dist/hologram.debug.js
  14. +1 −0 dist/hologram.debug.js.map
  15. +44 −0 dist/hologram.js
  16. +1 −0 dist/hologram.js.map
  17. BIN extras/Hero2@2x.png
  18. BIN extras/Hero@2x.png
  19. +2 −0 gulpfile.coffee
  20. +75 −0 loaders/fetch-script.js
  21. +60 −0 loaders/gltf-model-next.js
  22. +21 −3 src/Animation.coffee
  23. +5 −5 src/Assets.coffee
  24. +45 −18 src/Entity.coffee
  25. +20 −2 src/GltfModel.coffee
  26. +11 −0 src/Hologram.coffee
  27. +2 −2 src/Scene.coffee
  28. +1 −2 src/Sky.coffee
  29. +737 −0 test/dae/test.dae
  30. BIN test/gltf2/scene.bin
  31. +1 −0 test/gltf2/scene.gltf
  32. BIN test/gltf2/textures/NUAGES_baseColor.png
  33. BIN test/gltf2/textures/TERRE_baseColor.jpeg
  34. BIN test/gltf2/textures/TERRE_emissive.jpg
  35. BIN test/gltf2/textures/TERRE_metallicRoughness.png
  36. BIN test/gltf22/scene.bin
  37. +1 −0 test/gltf22/scene.gltf
  38. BIN test/gltf23/scene.bin
  39. +1 −0 test/gltf23/scene.gltf
  40. BIN test/gltf23/textures/grafiti_mendlak_baseColor.jpeg
  41. BIN test/gltf23/textures/grafiti_mendlak_metallicRoughness.png
  42. BIN test/gltf23/textures/grafiti_mendlak_normal.png
  43. BIN test/gltf24/scene.bin
  44. +1 −0 test/gltf24/scene.gltf
  45. BIN test/gltf24/textures/MAT_ceiling_SG1_baseColor.jpg
  46. BIN test/gltf24/textures/MAT_ceiling_SG1_metallicRoughness.png
  47. BIN test/gltf24/textures/MAT_ceiling_SG1_normal.jpg
  48. BIN test/gltf24/textures/floor_baseColor.jpg
  49. BIN test/gltf24/textures/floor_metallicRoughness.png
  50. BIN test/gltf24/textures/floor_normal.jpg
  51. BIN test/gltf24/textures/mat_arch_baseColor.jpg
  52. BIN test/gltf24/textures/mat_arch_metallicRoughness.png
  53. BIN test/gltf24/textures/mat_arch_normal.jpg
  54. BIN test/gltf24/textures/mat_crate1_baseColor.jpg
  55. BIN test/gltf24/textures/mat_crate1_metallicRoughness.png
  56. BIN test/gltf24/textures/mat_crate1_normal.jpg
  57. BIN test/gltf24/textures/pipes_baseColor.jpg
  58. BIN test/gltf24/textures/pipes_metallicRoughness.png
  59. BIN test/gltf24/textures/pipes_normal.jpg
  60. BIN test/gltf24/textures/wall_baseColor.jpg
  61. BIN test/gltf24/textures/wall_metallicRoughness.png
  62. BIN test/gltf24/textures/wall_normal.jpg
  63. +55 −1 test/index.html
  64. BIN test/obj/Maps/as1_02.jpg
  65. BIN test/obj/Maps/cp2.jpg
  66. BIN test/obj/Maps/ggt1.jpg
  67. BIN test/obj/Maps/mnd1.jpg
  68. BIN test/obj/Maps/s1.jpg
  69. BIN test/obj/Maps/vctu.jpg
  70. BIN test/obj/Maps/yx1_02_01_01.jpg
  71. +135 −0 test/obj/test.mtl
  72. +602,468 −0 test/obj/test.obj
  73. +453 −80,700 vendors/aframe.js
  74. +3 −1,787 vendors/aframe_effects.js
  75. +1 −677 vendors/aframe_gif_shader.js
  76. +1 −155 vendors/aframe_look_at.js
  77. +1 −940 vendors/aframe_mouse_cursor.js
@@ -1,7 +1,7 @@
<h1 align="center">
<br>
<a href="https://hologram.cool">
<img src="extras/Hero@2x.png" alt="Hologram" width="256">
<img src="extras/Hero2@2x.png" alt="Hologram" width="256">
</a>
<br>
Hologram Framework
BIN -473 KB (74%) build/Hologram.zip
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -10,6 +10,41 @@ <h1>Hologram Builds</h1>
These are builds for <a href="http://hologram.cool">Hologram</a>. Keep in mind that most of these are beta and some of them might be broken.
</p>
<table>
<tr>
<td><a href="https://github.com/etiennepinchon/Hologram/commit/50eb143">50eb143</a></td>
<td>Sat Aug 5 14:32:36 2017 +0200</td>
<td>Etienne</td>
<td><a href="/50eb143/hologram.js">hologram.js</a></td>
<td><a href="/50eb143/Hologram.zip">download</a></td>
</tr>
<tr>
<td><a href="https://github.com/etiennepinchon/Hologram/commit/158af29">158af29</a></td>
<td>Sat Aug 5 14:06:04 2017 +0200</td>
<td>Etienne</td>
<td><a href="/158af29/hologram.js">hologram.js</a></td>
<td><a href="/158af29/Hologram.zip">download</a></td>
</tr>
<tr>
<td><a href="https://github.com/etiennepinchon/Hologram/commit/6a1f7a4">6a1f7a4</a></td>
<td>Fri Aug 4 23:42:36 2017 +0200</td>
<td>Etienne</td>
<td><a href="/6a1f7a4/hologram.js">hologram.js</a></td>
<td><a href="/6a1f7a4/Hologram.zip">download</a></td>
</tr>
<tr>
<td><a href="https://github.com/etiennepinchon/Hologram/commit/ef138ad">ef138ad</a></td>
<td>Fri Aug 4 23:40:04 2017 +0200</td>
<td>Etienne</td>
<td><a href="/ef138ad/hologram.js">hologram.js</a></td>
<td><a href="/ef138ad/Hologram.zip">download</a></td>
</tr>
<tr>
<td><a href="https://github.com/etiennepinchon/Hologram/commit/277b335">277b335</a></td>
<td>Fri Aug 4 23:21:45 2017 +0200</td>
<td>Etienne</td>
<td><a href="/277b335/hologram.js">hologram.js</a></td>
<td><a href="/277b335/Hologram.zip">download</a></td>
</tr>
<tr>
<td><a href="https://github.com/etiennepinchon/Hologram/commit/2a6610a">2a6610a</a></td>
<td>Mon Jul 31 11:37:24 2017 +0200</td>
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -16,3 +16,4 @@ module.exports =
path: 'https://rawgit.com/mayognaise/aframe-mouse-cursor-component/master/dist/aframe-mouse-cursor-component.min.js'
]
VENDORS_PATH: './vendors'
LOADERS_PATH: './loaders'
@@ -0,0 +1,8 @@
# This gets automatically populated bij gulp
exports.date = 1503005234
exports.branch = "master"
exports.hash = "50eb143-dirty"
exports.build = 11
exports.version = "#{exports.branch}/#{exports.hash}"

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN +28 KB extras/Hero2@2x.png
Binary file not shown.
BIN -26.6 KB extras/Hero@2x.png
Binary file not shown.
@@ -152,4 +152,6 @@ importVendors = ->
.pipe(replaceStream('console.log', 'console.silence'))
.pipe file
return
fs.copySync path.join(config.LOADERS_PATH, "fetch-script.js"), path.join(config.VENDORS_PATH, "fetch-script.js")
fs.copySync path.join(config.LOADERS_PATH, "gltf-model-next.js"), path.join(config.VENDORS_PATH, "gltf-model-next.js")
return
@@ -0,0 +1,75 @@
/**
* Source: https://github.com/Adobe-Marketing-Cloud/fetch-script
*/
function getScriptId() {
return 'script_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
}
function createScript(url, id) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.id = id;
script.src = url;
return script;
}
function removeScript(id) {
const script = document.getElementById(id);
const parent = script.parentNode;
try {
parent && parent.removeChild(script);
} catch (e) {
// ignore
}
}
function appendScript(script) {
const firstScript = document.getElementsByTagName('script')[0];
firstScript.parentNode.insertBefore(script, firstScript);
}
function fetchScriptInternal(url, options, Promise) {
return new Promise(function(resolve, reject) {
const timeout = options.timeout || 5000;
const scriptId = getScriptId();
const script = createScript(url, scriptId);
const timeoutId = setTimeout(function() {
reject(new Error('Script request to ' + url + ' timed out'));
removeScript(scriptId);
}, timeout);
const disableTimeout = function(timeoutId) { clearTimeout(timeoutId); };
script.addEventListener('load', function(e) {
resolve({ok: true});
disableTimeout(timeoutId);
removeScript(scriptId);
});
script.addEventListener('error', function(e) {
reject(new Error('Script request to ' + url + ' failed ' + e));
disableTimeout(timeoutId);
removeScript(scriptId);
});
appendScript(script);
});
}
function fetchScript(settings) {
settings = settings || {};
return function (url, options) {
options = options || {};
return fetchScriptInternal(url, options, settings.Promise || Promise);
};
}
module.exports = fetchScript;
@@ -0,0 +1,60 @@
var fetchScript = require('./fetch-script')();
var LOADER_SRC = 'https://rawgit.com/mrdoob/three.js/r86/examples/js/loaders/GLTF2Loader.js';
// Monkeypatch while waiting for three.js r86.
if (THREE.PropertyBinding.sanitizeNodeName === undefined) {
THREE.PropertyBinding.sanitizeNodeName = function (s) {
return s.replace(/\./g, '_');
};
}
/**
* Upcoming loader for glTF 2.0 models.
* Asynchronously loads THREE.GLTF2Loader from rawgit.
*/
module.exports = {
schema: {type: 'model'},
init: function () {
this.model = null;
this.loader = null;
this.loaderPromise = loadLoader().then(function () {
this.loader = new THREE.GLTF2Loader();
this.loader.setCrossOrigin('Anonymous');
}.bind(this));
},
update: function () {
var self = this;
var el = this.el;
var src = this.data;
if (!src) { return; }
this.remove();
this.loaderPromise.then(function () {
this.loader.load(src, function gltfLoaded (gltfModel) {
self.model = gltfModel.scene;
self.model.animations = gltfModel.animations;
el.setObject3D('mesh', self.model);
el.emit('model-loaded', {format: 'gltf', model: self.model});
});
}.bind(this));
},
remove: function () {
if (!this.model) { return; }
this.el.removeObject3D('mesh');
}
};
var loadLoader = (function () {
var promise;
return function () {
promise = promise || fetchScript(LOADER_SRC);
return promise;
};
}());
@@ -29,12 +29,14 @@ class exports.Animation extends BaseClass
entity : undefined
properties : {}
then: null
fromOrigin: no
fromOrigin: yes
_didStart: false
_didFireCallback: false
_animationItems : []
_props: {}
constructor: (options={}) ->
super
@@ -74,7 +76,8 @@ class exports.Animation extends BaseClass
options.scale = Utils.stringifyVector(options.scale)
# Retrieve properties to animate
excluded = ['time', 'delay', 'repeat', 'curve', 'direction', 'fill', 'entity', 'then']
@properties = {}
excluded = ['animate','time', 'delay', 'repeat', 'curve', 'direction', 'fill', 'entity', 'then']
for item of options
if excluded.indexOf(item) is -1
@properties[item] = options[item] if options[item]
@@ -89,13 +92,17 @@ class exports.Animation extends BaseClass
@_didStart = false
@_didFireCallback = false
@_animationItems = []
@_props = {}
for property of @properties
animationItem = new AnimationItem
attribute: property
to: @properties[property]
if @fromOrigin and @entity
animationItem.from = @entity._properties[property]
if @entity._properties[property]
animationItem.from = @_props[property] = @entity._properties[property]
if @entity[property] and not @_props[property]
@_props[property] = @entity[property]
if @time isnt 1
animationItem.dur = @time*1000
if @delay isnt 0
@@ -129,12 +136,23 @@ class exports.Animation extends BaseClass
stop : ->
for item in @_animationItems
item.parent = null
item.destroy(yes)
@_animationItems = []
# Callback once
if @then and not @_didFireCallback
@_didFireCallback = true
@then()
@emit Events.AnimationStop
return
cancel: ->
@stop()
for property of @properties
@entity[property] = @_props[property] if @_props[property]
@properties = {}
@_props = {}
return
# ----------------------------------------------------------------------------
# METHODS
@@ -32,31 +32,31 @@ class _AssetVideo extends Entity
name: "AssetVideo"
type: "video"
AssetItem = (src) ->
exports.AssetItem = (src) ->
asset = new _AssetItem
src: src
parent: Hologram.assets
return asset
AssetModel = (src) ->
exports.AssetModel = (src) ->
asset = new _AssetModel
src: src
parent: Hologram.assets
return asset
AssetAudio = (src) ->
exports.AssetAudio = (src) ->
asset = new _AssetAudio
src: src
parent: Hologram.assets
return asset
AssetImage = (src) ->
exports.AssetImage = (src) ->
asset = new _AssetImage
src: src
parent: Hologram.assets
return asset
AssetVideo = (src) ->
exports.AssetVideo = (src) ->
asset = new _AssetVideo
src: src
parent: Hologram.assets
Oops, something went wrong.

0 comments on commit 9d6f656

Please sign in to comment.