Skip to content

Instantly share code, notes, and snippets.

@drewlustro
Last active January 4, 2016 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewlustro/8608266 to your computer and use it in GitHub Desktop.
Save drewlustro/8608266 to your computer and use it in GitHub Desktop.
Brace.Object is undefined in chapter.js -- apologies that Object needs to be fully renamed to SceneObject. Please ignore that.
(function() {
Brace = {};
define('brace/brace', ['THREE', 'brace/base', 'brace/publisher', 'brace/chapter', 'brace/app', 'brace/object', 'brace/settings'],
function (THREE, Base, Publisher, Chapter, App, SceneObject, Settings) {
Base(Brace);
Publisher(Brace);
SceneObject(Brace);
Chapter(Brace);
App(Brace);
return Brace;
});
}());
/****************************************
** Chapter.js
**
** Grouping of a set of THREE.js objects
** that combine into a single coherent
** effect for viewing with video support.
**
*****************************************/
(function() {
define('brace/chapter',
['THREE'],
function (THREE) {
return function (Brace) {
Chapter = function () {
Brace.Object.call(this);
this.cameraConfig = null;
this.state = Chapter.StateNone;
this.root = null;
this.video = null;
this.videoTexture = null;
this.videoPlaying = null;
this.settings = null;
this.app = null;
}
// ERROR HERE: Brace.Object is undefined!
Chapter.prototype = new Brace.Object;
Brace.Chapter = Chapter;
};
});
}());
(function() {
define('brace/object',
['THREE'],
function (THREE) {
return function (Brace) {
SceneObject = function() {
Brace.Publisher.call(this);
this.object3D = null;
this.children = [];
}
SceneObject.prototype = new Brace.Publisher;
SceneObject.prototype.init = function() {};
Brace.Object = SceneObject;
};
});
})();
(function() {
define('brace/publisher',
['THREE'],
function (THREE) {
return function (Brace) {
Publisher = function() {
Brace.Base.call(this);
this.messageTypes = {};
}
Publisher.prototype = new Brace.Base;
Brace.Publisher = Publisher;
};
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment