|
@@ -450,15 +450,15 @@ module BABYLON {
|
|
|
* The node will remain exactly where it is and its position / rotation will be updated accordingly
|
|
|
* Returns the TransformNode.
|
|
|
*/
|
|
|
- public setParent(node: Nullable<TransformNode>): TransformNode {
|
|
|
+ public setParent(node: Nullable<Node>): TransformNode {
|
|
|
|
|
|
if (node == null) {
|
|
|
var rotation = Tmp.Quaternion[0];
|
|
|
var position = Tmp.Vector3[0];
|
|
|
var scale = Tmp.Vector3[1];
|
|
|
-
|
|
|
- if (this.parent && (<TransformNode>this.parent).computeWorldMatrix) {
|
|
|
- (<TransformNode>this.parent).computeWorldMatrix(true);
|
|
|
+
|
|
|
+ if (this.parent && this.parent.computeWorldMatrix) {
|
|
|
+ this.parent.computeWorldMatrix(true);
|
|
|
}
|
|
|
this.computeWorldMatrix(true);
|
|
|
this.getWorldMatrix().decompose(scale, rotation, position);
|