flyover / box2d.js Goto Github PK
View Code? Open in Web Editor NEWA JavaScript port of Box2D
A JavaScript port of Box2D
Does a minified version of this exist anywhere? I'm not as familiar with the closure library, and am especially interested in this version as it's the only javascript one I've found that has particle/body collision detection via b2ParticleSystem.GetBodyContacts
Can you tell me where to download the c lang version(2.3.2)?
because i need the client version is same as the web verison.
thank you very much!
Please, implement b2Draw, SetDebugDraw, and DebugDraw like it was implemented in pybox2d
from Box2D import b2Draw
from OpenGL.GL import *
class DebugDrawer(b2Draw):
def __init__(self, program, worldScale):
super().__init__()
self.program = program
self.WORLD_SCALE = worldScale
def DrawSolidPolygon(self, vertexes, color):
print("Polygon. Begin")
print(vertexes[0][0] * 30, vertexes[0][1] * 30)
print(vertexes[1][0] * 30, vertexes[1][1] * 30)
print(vertexes[2][0] * 30, vertexes[2][1] * 30)
print(vertexes[3][0] * 30, vertexes[3][1] * 30)
print("Polygon. End")
self.debugDrawer = DebugDrawer(self.program, self.WORLD_SCALE)
self.world.renderer = self.debugDrawer
self.debugDrawer.flags = { 'drawShapes': True,
'drawJoints': True, 'drawAABBs': True, 'drawPairs': True }
def paintGL(self):
glClear(GL_COLOR_BUFFER_BIT)
glBindVertexArray(self.vao)
self.projViewMatrix = self.projMatrix * self.viewMatrix
if self.showColliders:
self.world.DrawDebugData()
Great library , been playing it for a while , thanks for the great work.
I noticed that EndContactParticleParticle and EndContactFixtureParticle are commented out in the b2ParticleSystem.js source file, any fix or support possible in the future?
This is the best box2d.* library I have found, but I know little about functions like goog.require
. How about using webpack to bundle it?
when I run make, I get this error:
Box2D/Box2D/Dynamics/Joints/b2FrictionJoint.js:367: ERROR - Redeclared variable: Cdot
var Cdot = box2d.b2Sub_V2_V2(
...
16 error(s), 0 warning(s)
They are all the same, redeclared variable.
please,can support node.js? The compressed file size is also too big~~
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.