Jump to content

Lastest Alpha has TransformNode Error


MackeyK24
 Share

Recommended Posts

Just an FYI to whoever :)

I get this error for my components using AbstractMesh:

Assets/[App]/babylon.scenecomponents.ts(469,21): error TS2322: Type 'TransformNode' is not assignable to type 'AbstractMesh'.
  Property '_facetPositions' is missing in type 'TransformNode'.
Assets/[App]/babylon.scenecomponents.ts(471,21): error TS2322: Type 'TransformNode' is not assignable to type 'AbstractMesh'.
Assets/[App]/babylon.scenecomponents.ts(473,21): error TS2322: Type 'TransformNode' is not assignable to type 'AbstractMesh'.
Assets/[App]/babylon.scenecomponents.ts(475,21): error TS2322: Type 'TransformNode' is not assignable to type 'AbstractMesh'.
Assets/[App]/babylon.scenecomponents.ts(477,21): error TS2322: Type 'TransformNode' is not assignable to type 'AbstractMesh'.
Assets/[App]/babylon.scenecomponents.ts(479,21): error TS2322: Type 'TransformNode' is not assignable to type 'AbstractMesh'.
Assets/[App]/babylon.scenecomponents.ts(490,17): error TS2322: Type 'TransformNode' is not assignable to type 'AbstractMesh'.

I dont reference any TransformNode so it MUST be some internal Change to the AbstractMesh class

Link to comment
Share on other sites

Hello this is a change introduced recently.

Just change your code to this:

 public rotate(x: number, y: number, z: number, order:BABYLON.RotateOrder = BABYLON.RotateOrder.ZXY):BABYLON.TransformNode{
            var result:BABYLON.TransformNode= null;
            if (this._owned != null) {
                // Note: Z-X-Y is default Unity Rotation Order
                if (this._owned.rotationQuaternion == null) this._owned.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(this._owned.rotation.y, this._owned.rotation.x, this._owned.rotation.z);
                if (order === BABYLON.RotateOrder.XYZ) {
                    result = this._owned.addRotation(x, 0, 0).addRotation(0, y, 0).addRotation(0, 0, z);
                } else if (order === BABYLON.RotateOrder.XZY) {
                    result = this._owned.addRotation(x, 0, 0).addRotation(0, 0, z).addRotation(0, y, 0);
                } else if (order === BABYLON.RotateOrder.ZXY) {
                    result = this._owned.addRotation(0, 0, z).addRotation(x, 0, 0).addRotation(0, y, 0);
                } else if (order === BABYLON.RotateOrder.ZYX) {
                    result = this._owned.addRotation(0, 0, z).addRotation(0, y, 0).addRotation(x, 0, 0);
                } else if (order === BABYLON.RotateOrder.YZX) {
                    result = this._owned.addRotation(0, y, 0).addRotation(0, 0, z).addRotation(x, 0, 0);
                } else {
                    result = this._owned.addRotation(x, y, z); // Note: Default Babylon Y-X-Z Rotate Order
                }
            }
            return result;
        }

(just replace the two AbstractMesh refrerence to a TransformNode reference)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...