Skip to content

Commit

Permalink
Added the possibility to translate a ColladaScene.
Browse files Browse the repository at this point in the history
  • Loading branch information
strikerM committed Apr 11, 2016
1 parent 3a1841e commit 025f509
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/formats/collada/ColladaScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ define([
this._yRotation = 0;
this._zRotation = 0;

// Documented in defineProperties below.
this._xTranslation = 0;
this._yTranslation = 0;
this._zTranslation = 0;

// Documented in defineProperties below.
this._scale = 1;

Expand Down Expand Up @@ -241,6 +246,48 @@ define([
}
},

/**
* The scene's translation for the x axis.
* @memberof ColladaScene.prototype
* @type {Number}
*/
xTranslation: {
get: function () {
return this._xTranslation;
},
set: function (value) {
this._xTranslation = value;
}
},

/**
* The scene's translation for the y axis.
* @memberof ColladaScene.prototype
* @type {Number}
*/
yTranslation: {
get: function () {
return this._yTranslation;
},
set: function (value) {
this._yTranslation = value;
}
},

/**
* The scene's translation for the z axis.
* @memberof ColladaScene.prototype
* @type {Number}
*/
zTranslation: {
get: function () {
return this._zTranslation;
},
set: function (value) {
this._zTranslation = value;
}
},

/**
* The scene's scale.
* @memberof ColladaScene.prototype
Expand Down Expand Up @@ -792,6 +839,8 @@ define([

this.transformationMatrix.multiplyByScale(this.scale, this.scale, this.scale);

this.transformationMatrix.multiplyByTranslation(this.xTranslation, this.yTranslation, this.zTranslation);

this.computeNormalMatrix();

};
Expand Down

0 comments on commit 025f509

Please sign in to comment.