Skip to content

Commit

Permalink
Merge pull request NASAWorldWind#23 from ESAFastPrototyping/feature/c…
Browse files Browse the repository at this point in the history
…ollada

Added the possibility to do local translations for the ColladaScene.
  • Loading branch information
pdavidc committed Apr 12, 2016
2 parents 86d86a3 + 025f509 commit c3ea71a
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 c3ea71a

Please sign in to comment.