pmndrs / cannon-es

💣 A lightweight 3D physics engine written in JavaScript.
https://pmndrs.github.io/cannon-es/
MIT License
1.73k stars 128 forks source link

Porting over tests from cannon.js #49

Open patreeceeo opened 3 years ago

patreeceeo commented 3 years ago

Hi! I noticed that cannon.js has a large suite of unit tests that seem to have not been ported over to this fork yet. Wondering if you'd be interested in having help doing that? Or if you're aware of any efforts to do that that are already in progress? It'd be a great way for me to understand Cannon (and physics rigs in general) as I work on a personal project using Cannon.

marcofugaro commented 3 years ago

Absolutely! Any help is apprecciated!

Yes it was planned, but I haven't looked into it yet. I was gonna setup a github actions pipeline after I've finished with #34.

When porting, mind that it would be necessary to change the unit testing framework, since cannon.js is using a deprecated one: nodeunit. I was thinking about ava.js or jest, but I wanted to hear @codynova's opinion first.

codynova commented 3 years ago

I think jest is probably the way to go, but I wouldn't complain about either option 😄

marcofugaro commented 3 years ago

Great! @patreeceeo feel free to make a PR when you have time!

d3x0r commented 3 years ago

There are some quaternion features there only exist to test, and are not actually used.

new Quaternion() is the only usage in the actual code... the a,b,c,d arguments are only used in test code.... the tests could be updated to be 'new Quaternion().set(1,2,3,4)... AlsotoEuler,setFromVectors`, from Euler() (at least in the cannon.js, I guess they may be used in demos or examples)