Comments (7)
How does it render? If it's using GL emulation, could be a limitation of that. Otherwise, it should work, please make as reduced a testcase as you can.
from box2d.js.
I'm testing with the canvas testbed https://github.com/kripken/box2d.js/blob/master/html5canvas_demo/tests/fallingShapes.js
b2CircleShape(); <- doesn't seem to render the fill or stroke but is still affected by physics simulation
from box2d.js.
I think @iforce2d wrote that, iforce2d?
from box2d.js.
Yes. I just did a git clone and it looks ok when running with the box2d.js as in the repo...
@jarbot when you say 'axes' you mean the red and green marker for the body position right? Is the drawCircle function in embox2d-html5canvas-debugDraw.js being entered at all?
from box2d.js.
The box2d.js from the repo works fine for me too. It's when I do my own build that the circle doesn't render.
when you say 'axes' you mean the red and green marker for the body position right?
Correct.
I set a break point on line 50 of embox2d-html5canvas-debugDraw.js and it never gets hit.
from box2d.js.
@jarbot After building with the latest source I was able to reproduce the problem you describe.
It looks like customizeVTable is not matching the correct function when replacing the virtual functions of b2Draw. Instead of matching DrawCircle, it is matching DrawTransform, so you see an axis marker instead of a circle. As the comments for customizeVTable indicate, the method used to replace virtual functions may not be 100% reliable:
// Prepare replacement lookup table and add replacements.
// There is actually no good way to do this! So we do the following hack:
// We create a fake vtable with canary functions, to detect which actual
// function is being called
Unfortunately I have no idea why the problem occurs or how to fix it, but I found two ways to avoid it. The first is to remove the -O2 flag from the final step in the makefile, if you can live with a slightly larger/slower build.
The other way is to move the call to customizeVTable for the two circle drawing functions (DrawCircle and DrawSolidCircle) so that they appear after that of DrawTransform (these calls are in embox2d-html5canvas-debugDraw.js). Obviously this is not ideal, because then the transform marker axes do not get drawn... just thought I would mention it anyway.
from box2d.js.
@iforce2d thank you for spending the time to look into this. I will give the -O2 approach a shot and hope it doesn't get too slow.
from box2d.js.
Related Issues (20)
- b2Vec2 won't free HOT 2
- Unable to build latest on macOS Mojave with [email protected] HOT 5
- High Gravity jitter HOT 1
- missing runtime methods for allocating arrays HOT 4
- box2d.wasm.html test faild with [email protected] build HOT 2
- is there typescript declaration file (d.ts) for this project? HOT 2
- Box2d 2.4.0
- Box2D 2.4.0 HOT 8
- Node server side implementation
- How does this work with webpack? HOT 1
- May I ask why the calculation results are different on the ios and android platforms HOT 2
- vue how to use it
- vue hao to use it
- why is not show?
- why now show debugdraw
- could i have more simple demos about the box2djs οΌand where can i see the API about box2djs
- How to build? I want to build the debug version of javascript file
- Position not getting what is set
- Uncaught (in promise) cannot construct a b2Draw, no constructor in IDL
- Memory won't free HOT 4
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.js.