Jump to content

[SOLVED] Babylon.js 2.5 - Issue with type definition file.


jsdream
 Share

Recommended Posts

Looks like OimoJSPlugin class incorrectly implements IPhysicsEnginePlugin interface.

So with Babylon.js 2.5 when I try to enable physics with Oimo.js plugin like this:

scene.enablePhysics(new BABYLON.Vector3(0, -9, 0), new BABYLON.OimoJSPlugin());

I get the following TypeScript compilation error:

TS2345: Argument of type 'OimoJSPlugin' is not assignable to parameter of type 'IPhysicsEnginePlugin'.
  Types of property 'updateDistanceJoint' are incompatible.
    Type '(joint: IMotorEnabledJoint, maxDistance: number, minDistance?: number) => void' is not assignable to type '(joint: DistanceJoint, maxDistance: number, minDistance?: number) => any'.
      Types of parameters 'joint' and 'joint' are incompatible.
        Type 'DistanceJoint' is not assignable to type 'IMotorEnabledJoint'.
          Property 'setMotor' is missing in type 'DistanceJoint'.

I'm using babylon.d.ts type definition file from babylonjs npm package.

Edited by jsdream
To update title and tags
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...