BabylonJS/Babylon.js — pull request #116 by gwenael-hagenmuller (2014-01-02 10:46:41+00:00)
Title: BABYLON.Mesh.prototype.{s,g}etLocalTranslation

Fixed BABYLON.Mesh.prototype.{s,g}etLocalTranslation to take into account the parent.
Renamed BABYLON.Mesh.prototype.{s,g}etLocalTranslation respectively by BABYLON.Mesh.prototype.setPositionWithLocalVector and BABYLON.Mesh.prototype.getPositionExpressedInLocalSpace
Added BABYLON.Mesh.prototype.locallyTranslate

BABYLON.Mesh.prototype.locallyTranslate adds the passed vector3 (expressed in local space; the origin of vector3 is the origin of the local space) after conversion to the parent space to the position (expressed in parent space)
whereas BABYLON.Mesh.prototype.setPositionWithLocalVector sets the position (expressed in parent space) to the passed vector3 (expressed in local space but which the origin is the origin of the parent space) once it has been converted.

The following code for BABYLON.Mesh.prototype.setPositionWithLocalVector could also be used. It explains itself the relation between setPositionWithLocalVector and locallyTranslate.

BABYLON.Mesh.prototype.setPositionWithLocalVector = function(vector3) {
this.position = BABYLON.Vector3.Zero();
this.locallyTranslate(vector3);
};

And here is a jsfiddle to illustrate it: http://jsfiddle.net/gwenaelhagenmuller/35uFf/11/