Jump to content

Debugging Babylon source code


Nikos
 Share

Recommended Posts

I'm trying to debug the CreateSphere method in webstorm but when I ctrl click it, it takes me to a t.ds file. Also when I try step into the method when debugging nothing happens.

 

Any ideas how to achieve this? Maybe I should use TS instead of ES6, but I don't really want to.

 

/**
*
* User controllable unit
*/
export default
class Core {
constructor(scene) {
this.sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);
this.isSelected;//selected units receive commands
this.modifiers = [];//powerups,sheldss etc
this.currentCommands = [];
//todo investigate queued commands
}
}
 

Link to comment
Share on other sites

The best solution in this case would be to include the TS files of Babylon (Which is not an easy task, as IntelliJ doesn't really work like Visual Studio when it comes to TypeScript) or remove the declaration file. If you don't use typescript, the 2nd option is the best one for you. If you do, you'll have some problems without it.

 

I use both visual studio and intelliJ (depends on the project) and have configured intelliJ to show me the declaration from both .d.ts file and the .js file. This way I can choose to which declaration it should go. Works great (usually).

Link to comment
Share on other sites

The best solution in this case would be to include the TS files of Babylon (Which is not an easy task, as IntelliJ doesn't really work like Visual Studio when it comes to TypeScript) or remove the declaration file. If you don't use typescript, the 2nd option is the best one for you. If you do, you'll have some problems without it.

 

I use both visual studio and intelliJ (depends on the project) and have configured intelliJ to show me the declaration from both .d.ts file and the .js file. This way I can choose to which declaration it should go. Works great (usually).

I wrote a Canvas spaceinvaders game with typescript and quite like it, but want to see how far I can get with es6. Might even try es7 https://github.com/dslomov-chromium/typed-objects-es7

Link to comment
Share on other sites

Hi,

 

 TypeScript generate source map files to be able to debug our original TS code rather than the pure JS version. I've explained how it works in this article: http://blogs.msdn.com/b/davrous/archive/2014/08/22/enhance-your-javascript-debugging-life-thanks-to-the-source-map-support-available-in-ie11-chrome-opera-amp-firefox.aspx

 

 You can easily disable that by simply removing the source map line at the end of the JS file. Your browser and/or IDE will then simply show you the JS version to debug. 

 

Bye,

 

David

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...