diff --git a/src/scenejs/core/core.js b/src/scenejs/core/core.js index 953d8453..5a94bab9 100755 --- a/src/scenejs/core/core.js +++ b/src/scenejs/core/core.js @@ -125,7 +125,7 @@ var SceneJS = { } return func.apply(this, args); }, - + /** * Fire an event at the node with teh given ID * diff --git a/src/scenejs/geometry/text/text.js b/src/scenejs/geometry/text/text.js index 7094767e..f7d66719 100644 --- a/src/scenejs/geometry/text/text.js +++ b/src/scenejs/geometry/text/text.js @@ -33,6 +33,7 @@ SceneJS.Text.prototype._init = function(params) { this._create = function() { var geo = SceneJS._vectorTextModule.getGeometry(1, 0, 0, params.text); // Unit size return { + type: this._id, primitive : "lines", positions : geo.positions, normals: [], diff --git a/src/scenejs/geometry/text/vectorTextModule.js b/src/scenejs/geometry/text/vectorTextModule.js index ad25c309..cbb62f6b 100644 --- a/src/scenejs/geometry/text/vectorTextModule.js +++ b/src/scenejs/geometry/text/vectorTextModule.js @@ -1460,7 +1460,7 @@ SceneJS._vectorTextModule = new (function() { continue; } - geo.positions.push(x + a[0] * -mag); + geo.positions.push(x + a[0] * mag); geo.positions.push(y + a[1] * mag); geo.positions.push(0); @@ -1486,10 +1486,10 @@ SceneJS._vectorTextModule = new (function() { } needLine = true; } - x -= c.width * mag; + x += c.width * mag; } - y -= 25 * mag; + y += 25 * mag; } return geo; }; diff --git a/src/scenejs/interpolation/interpolator.js b/src/scenejs/interpolation/interpolator.js index 76affdd5..67b0d40e 100755 --- a/src/scenejs/interpolation/interpolator.js +++ b/src/scenejs/interpolation/interpolator.js @@ -48,7 +48,7 @@ */ SceneJS.Interpolator = function() { SceneJS.Node.apply(this, arguments); - this._nodeType = "interpolator"; + this._nodeType = "interpolator"; this._input = null; this._output = null; this._outputValue = null; @@ -284,7 +284,7 @@ SceneJS.Interpolator.prototype._render = function(traversalContext, data) { if (key == undefined || key == null) { throw SceneJS._errorModule.fatalError( new SceneJS.errors.DataExpectedException( - "SceneJS.Interpolator failed to find input on data: '" + params.input + "'")); + "SceneJS.Interpolator failed to find input on data: '" + this._input + "'")); } this._update(key); var obj = {}; diff --git a/src/scenejs/node/node.js b/src/scenejs/node/node.js index e448d703..1e179bef 100755 --- a/src/scenejs/node/node.js +++ b/src/scenejs/node/node.js @@ -187,7 +187,7 @@ SceneJS.Node = function() { this._NODEINFO = null; // Big and bold, to stand out in debugger object graph inspectors this._sid = null; this._children = []; - this._fixedParams = true; + this._fixedParams = true; this._parent = null; this._listeners = {}; this._numListeners = 0; // Useful for quick check whether node observes any events @@ -1013,6 +1013,15 @@ SceneJS.Node.prototype.addListener = function(eventName, fn, options) { return this; }; +/** + * Destroys this node the next time it's rendered + * @return {SceneJS.Node} this + */ +SceneJS.Node.prototype.destroy = function() { + // alert("destroying"); + return this; +}; + /** * Fires an event at this node * @param {String} eventName Event name diff --git a/src/scenejs/transformation/modelView/lookAt.js b/src/scenejs/transformation/modelView/lookAt.js index ab4df074..b4cd9c66 100755 --- a/src/scenejs/transformation/modelView/lookAt.js +++ b/src/scenejs/transformation/modelView/lookAt.js @@ -55,6 +55,39 @@ SceneJS.LookAt.prototype.setEye = function(eye) { return this; }; +/** Sets the eye X position. + * + * @param {float} x Eye X position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setEyeX = function(x) { + this._eyeX = x || 0; + this._memoLevel = 0; + return this; +}; + +/** Sets the eye Y position. + * + * @param {float} y Eye Y position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setEyeY = function(y) { + this._eyeY = y || 0; + this._memoLevel = 0; + return this; +}; + +/** Sets the eye Z position. + * + * @param {float} z Eye Z position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setEyeZ = function(z) { + this._eyeZ = z || 0; + this._memoLevel = 0; + return this; +}; + /** Returns the eye position. * * @returns {Object} Eye position - Eg. { x: 0.0, y: 10.0, z: -15 } @@ -81,6 +114,39 @@ SceneJS.LookAt.prototype.setLook = function(look) { return this; }; +/** Sets the look X position. + * + * @param {float} x Look X position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setLookX = function(x) { + this._lookX = x || 0; + this._memoLevel = 0; + return this; +}; + +/** Sets the look Y position. + * + * @param {float} y Look Y position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setLookY = function(y) { + this._lookY = y || 0; + this._memoLevel = 0; + return this; +}; + +/** Sets the look Z position. + * + * @param {float} z Look Z position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setLookZ = function(z) { + this._lookZ = z || 0; + this._memoLevel = 0; + return this; +}; + /** Returns the position being looked at. * @returns {Object} Point looked at - Eg. { x: 0.0, y: 2.0, z: 0.0 } */ @@ -113,6 +179,39 @@ SceneJS.LookAt.prototype.setUp = function(up) { return this; }; +/** Sets the up X position. + * + * @param {float} x Up X position + * @returns {SceneJS.UpAt} this + */ +SceneJS.LookAt.prototype.setUpX = function(x) { + this._upX = x || 0; + this._memoLevel = 0; + return this; +}; + +/** Sets the up Y position. + * + * @param {float} y Up Y position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setUpY = function(x) { + this._upY = y || 0; + this._memoLevel = 0; + return this; +}; + +/** Sets the up Z position. + * + * @param {float} z Up Z position + * @returns {SceneJS.LookAt} this + */ +SceneJS.LookAt.prototype.setUpZ = function(x) { + this._upZ = z || 0; + this._memoLevel = 0; + return this; +}; + /** Returns the "up" vector - the direction that is considered "upwards". * diff --git a/src/scenejs/transformation/modelView/translate.js b/src/scenejs/transformation/modelView/translate.js index 2184ef9f..86fc323b 100755 --- a/src/scenejs/transformation/modelView/translate.js +++ b/src/scenejs/transformation/modelView/translate.js @@ -19,7 +19,7 @@ SceneJS.Translate = function() { SceneJS.Node.apply(this, arguments); this._nodeType = "translate"; this._mat = null; - this._xform = null; + this._xform = null; this._x = 0; this._y = 0; this._z = 1;