0

i wanna make something like that http://brm.io/gears-d3-js/ based on Famo.us, but looking throw physics module i could not find polygon body. Could it be done in the another way, or may be there some other forks with polygons?

I found this project interesting, that's why i want to get full-featured physics engine from that...

Thanks.

Timopheym
  • 363
  • 3
  • 15

1 Answers1

1

Currently the physics engine is limited in a number of ways. There are no polygon bodies and barely even rectangular bodies. The only type of collision constraints that may be applied are to circular bodies, and walls.

Your example would be a bit tricky to do in the current release of Famo.us. I'm not saying it can't be done, but you may want to at least wait for rectangular body collision support.

johntraver
  • 3,612
  • 18
  • 17
  • Thnx... but here, there are http://famous-bird.herokuapp.com/ rectangles groups, collisions... – Timopheym May 14 '14 at 15:44
  • @Timopheym The floor is a wall, which I had mentioned, and although the pipes are visually rectangular they may still be represented with one or more circular bodies. I have asked for rectangle collision support, and it is something they are working on. – johntraver May 14 '14 at 15:48
  • i looked in the code - pipe.js //upper pipe new Rectangle({ mass: 0, size : [this.options.pipeWidth, upperPipe.height], position : [this.options.initPipePos, upperPipe.y, -2], velocity : [this.options.velocity,0,0] }), //lower pipe new Rectangle({...}) ]; – Timopheym May 14 '14 at 15:58
  • BTW it may be not collision - just calculation of position... i just dreamed that may be we can associate and create polygon collision by our self? I can't do it alone, but if with somebody... – Timopheym May 14 '14 at 16:00
  • @Timopheym Linking through the code requires, I found what controls the overlapping.. Overlap! http://famous-bird.herokuapp.com/js/app/Overlap.js – johntraver May 14 '14 at 16:06
  • You are right, they are doing all manually. Rectangle Collisions are trickier than circular, bc you can imagine as particles, if a box gets hit, in needs to have some angular velocity to make it spin. Circles don't worry about that. – johntraver May 14 '14 at 16:10
  • Yeh... i know it =( I coded a year ago around it... may be will do a fork and play, it can be fun +) btw. Thanks you, i think famo.us can be really nice platform in the soon featue. – Timopheym May 14 '14 at 16:22
  • I found Famous Bird sources, If somebody need: https://github.com/DrClick/FamousBird – Timopheym May 15 '14 at 09:33
  • @Timopheym When I download the repo my local version freezes on the loading screen, any fix? – RenaissanceProgrammer Jun 18 '14 at 22:18
  • It was the custom fonts... they only work on servers due to those XLMHTTPRequest domain issues... – RenaissanceProgrammer Jun 18 '14 at 22:36