illandril / box2dweb-closure Goto Github PK
View Code? Open in Web Editor NEWModified version of http://code.google.com/p/box2dweb/ optimized for use with Google Closure
Modified version of http://code.google.com/p/box2dweb/ optimized for use with Google Closure
Original Box2D created by Erin Catto http://www.gphysics.com http://box2d.org/ Box2D was converted to Flash by Boris the Brave, Matt Bush, and John Nesky as Box2DFlash http://www.box2dflash.org/ Box2DFlash was converted from Flash to Javascript by Uli Hecht as box2Dweb http://code.google.com/p/box2dweb/ box2Dweb was modified to utilize Google Closure, as well as other bug fixes, optimizations, and tweaks by Illandril https://github.com/illandril/box2dweb-closure Requires Google Closure: http://code.google.com/closure/ Important changes from Box2DWeb: * all userData references have been removed * b2Body types are now in b2BodyDef * b2Shape types are now in each specific Shape * most integer parameters now assume non-null, non-undefined values (like the b2Vec2 and b2Vec3 constructors) * b2BodyList and b2FixtureList have been added, instead of each object acting as a node in a linked list * b2ContollerEdge has been replaced by b2ControllerList and b2BodyList Anticipated future changes: * b2JointList (similar to b2BodyList and b2FixtureList) * b2ContactList (similar to replacement of b2ControllerEdge... maybe) * b2ContactID/Features consolidation * (maybe) renaming of some variables (mostly removing the m_ prefixes, but some changes to make them more clear on what they are for) * fixing visibility of most variables (by annotation and convention only - not by anything that would actually make them private as far as javascript is concerned) * moving constant values from b2Settings (and maybe other areas) to Box2D.Consts If you are interested in a version that is Gjslint compliant, and with all warnings fixed (sometimes by making things public that are supposed to be private or protected), firecow has made a fork: https://github.com/firecow/box2dweb-closure Notice anything else that doesn't work (especially if it did work using box2dweb)? E-mail [email protected]
Hi I thought I would give this ago and with a couple of tweeks had my game ported from the stock version of box2dweb to your google version.
Would there be any reason why if I change my step frequency it looks all jittery? I am using the easel framework and have set my frame rate to 25. This works fine with the original version, but with your version it looks like it is studerring.
Setting the frame-rate to 30 minimises this to some extent but not really enough, is there something your port does differently?
Thanks for the help.
With the new google closure compiler, you have like 700 warnings...
Mostly because private members are accessed publicly.
Wondering why you removed the get/setUserData functionality
Hi Joe,
I have small question.
Why Box2D.Common.Math.b2Vec2() is private? It used in many cases.
For example in the baseInit.js
var world = new Box2D.Dynamics.b2World(new Box2D.Common.Math.b2Vec2(0, 9.8) /* gravity /, true / allowSleep */);
Thanks,
Vlad
PS Thank you for the box2dweb-closure library.
Can't seem to get a revolute joint to move it's motor is the objects its attached to have mass. Anybody seen anything similar?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.