Comments (7)
I think I'll be able to find some time to help in a few months, maybe even spark a friend's interest to contribute. But I never used yarn, is there a reason for not using npm ?
from box2d.ts.
Sounds good :)
I usually use npm as well, but workspaces are not ready in npm, that's why I used yarn. I think npm 7 was released recently, but I haven't given it a try yet. If it works with it, we can go with npm instead.
from box2d.ts.
I'm still using one repo per package at the moment I didn't realize npm only supported this recently. From their blog I read v7 support yarn workspaces and v8 will have more advanced features, but latest version is still on v6 atm.
I'll try setting up a workspace with npm@next-7
this weekend or the next to see if it can relieve me from the npm link
troubles I'm facing in dev mode.
from box2d.ts.
Moving that discussion to #5
from box2d.ts.
Really looking forward to giving all this a try. We use a version of box2web - for https://zimjs.com - (https://zimjs.org/cdn/Box2dWeb-2.1.a.3.min.js) - will the api be compatible, do you expect? And is it try you are roughly getting 5 times the speed? We have some physics demos here https://zimjs.com/physics and did a couple games https://zimjs.com/droid2 and https://zimjs.com/droid but could use more speed on mobile. Cheers - let's keep in touch.
from box2d.ts.
Honestly, I can't say. Box2dweb has not been touched in 5 years and they started from the flash version (rather than the original), so it is probably way behind the c++ version.
It' safe to say, that some changes will be required. Some things might just be search & replace. But since I never did anything except the benchmark code with it, I can't give details.
Not sure where you get the 5 times speed info from. This project improved speed compared to flyovers version. There are still ports which perform better at Benchmarks. But benchmarks are flawed. They might not reflect the way you use box2d and they also give different results for different browsers:
https://github.com/Lusito/box2d.ts/tree/master/packages/benchmark
The main goal of this project is to give a maintained box2d version which is in sync with upstream (c++), has good documentation and a set of extension libraries to make more of box2d, like particles, lighting, etc.
Performance and especially garbage collection is a tough thing to work on with javascript games, so it will be a big part of the documentation process to find best practices and bottlenecks to avoid.
If you want to discuss this further, please create a new ticket to avoid getting offtopic here.
For example, creating hundreds of b2vec2s within a frame , leaving them to the garbage collector to clean up will hurt performance and should be avoided.
from box2d.ts.
Thanks @Lusito the 5 times came from eyeballing the benchmarks at https://lusito.github.io/box2d.ts/benchmark/ - I see the box2D-web.js is more like 4 times the avg ms/frame of box2d.js (haha - here I was calculating when the ratio shows the result - duh). Not sure if avg ms/frame is equivalent to speed - as you say, various factors. Thanks for the added clarity of focus. Sounds great. Will start a new ticket with any implementation findings. Cheers.
Browser: Firefox 83
Name | avg ms/frame | 5th %ile | 95th %ile | Ratio |
---|---|---|---|---|
box2d.js | 4.65 | 5 | 3 | 1.00 |
box2d-web | 17.94 | 20 | 26 | 3.86 |
@box2d/core | 29.23 | 32 | 21 | 6.29 |
box2d-html5 | 30.75 | 38 | 29 | 6.62 |
@flyover/box2d | 48.71 | 48 | 42 | 10.48 |
planck.js | 61.03 | 65 | 48 | 13.13 |
from box2d.ts.
Related Issues (20)
- Port upstream code HOT 1
- Convert comments to jsdoc
- Evaluate and implement a consistent and safe style for temporary variables.
- Make attributes and methods protected or private again HOT 2
- Evaluate possibilities for further *Def simplifications
- bit flags vs boolean attributes
- Clean up comments HOT 1
- Active development HOT 1
- Potential Project Dependant - How to install and Good Fit? HOT 1
- Create API Docs HOT 1
- As a project developer, I want to be able to render the world to a canvas using a function HOT 7
- wasm builds of box2d and liquidfun HOT 2
- [Solved] Constructor of class 'b2World' is private and only accessible within the class declaration HOT 2
- [Solved] b2_island.d.ts:3:10 - error TS2305: Module '"./b2_contact_solver"' has no exported member 'b2ContactVelocityConstraint'. HOT 6
- Hasn't the DebugDraw() method been implemented? HOT 2
- [Solved] Where can I find the demo source code for the official @box2d/core examples? HOT 2
- Hello World example HOT 2
- Testbed a little too fast
- Hacktoberfest
- Plz make little note in guide HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box2d.ts.