MackeyK24

Lastest Alpha has TransformNode Error

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

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Yo @Deltakosh Man Thanks... You are DA SHIT... (That a good thing) :)

BTW... The 3.1 Beta is working pretty good so far... Cleaned up those performance hit it had one or two builds ago... I get my full 60FPS on Mac With Safari.

Mac Sarfari is by far the most 'TOUCHY'. But with the beta 3.1 Beta its works great so far :)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.