Giter VIP home page Giter VIP logo

Comments (7)

kaa-ching avatar kaa-ching commented on June 3, 2024 1

Be careful when fixing this: you may inadvertently break levels.

from tbe.

Wuzzy2 avatar Wuzzy2 commented on June 3, 2024
  • BowlingPin: This one is very weird, it's actually 2 polygons o_O

from tbe.

Wuzzy2 avatar Wuzzy2 commented on June 3, 2024
  • CardboardBox: I think the polygon is too small for Box2D

from tbe.

kaa-ching avatar kaa-ching commented on June 3, 2024

First of all, keep in mind that all polygons have to be convex. That already makes a single form for a bowling pin impossible. I believe you can assign a mass per polygon,but e.g. Cactus doesn't do that.

You're correct: in order to make physics calculations doable, objects need a certain thickness, otherwise, a small object may move through without the algorithms detecting a collision.
This is why a wedge has 4 points. You may be right about the cardboard box.

BowlingPin: the polygons are defined such that the behavior of the pin matches reality. The top had to be of different size and different density.
Cola Bottle: the bottle it is modeled after is not a very stable bottle anyway. But make sure that you keep a draft on the edge - otherwise it may get stuck behind an invisible edge.
Hammer: original model was meant to be a temporary placeholder. Apparently I never fixed it.

from tbe.

Wuzzy2 avatar Wuzzy2 commented on June 3, 2024

Ugh, the wedge thing really annoys me. Box2D really doesn't let us have a freaking simple triangle? Wow, that's a huge disappointment. :-( Maybe the documentation should be checked out to see if Box2D is really that limited.

Ah, ok the bowling pin makes sense. But the polygons should at least not have that weird gap.

from tbe.

Wuzzy2 avatar Wuzzy2 commented on June 3, 2024

New CardboardBox polygons:

(-0.40,-0.4)=(-0.33,-0.4)=(-0.33,0.40)=(-0.40,0.40);(0.33,-0.4)=(0.4,-0.4)=(0.4,0.40)=(0.33,0.40);(-0.33,-0.4)=(-0.33,-0.33)=(0.33,-0.33)=(0.33,-0.4)

(hopefully this is large enough)

New Hammer polygons:

(-0.5,-0.5)=(-0.3,-0.5)=(-0.3,0.5)=(-0.5,0.5);(-0.3,-0.16667)=(0.5,-0.16667)=(0.5,0.16667)=(-0.3,0.166667);

I wasn't able to fix RotatingBar. If I try to increate the outer bounds of the polygons, it stays the same.
E.g. (-.5,0.05)=(-.5,-0.05)=(.5,-0.05)=(.5,0.05) gives the exact same result as (-.1,0.05)=(-.1,-0.05)=(.1,-0.05)=(.1,0.05). Apparently the whole polygon is taken and forcefully stretched to the whole object bounding box. :-(
I think RotatingBar should be fixed differently. Turn it into a RectObject like BirchBar and use the normal BirchBar texture and just render the peg/pivot point separately (with a slightly higher ZValue). This would also fix annoying stretching issues.

from tbe.

Wuzzy2 avatar Wuzzy2 commented on June 3, 2024

I have read the Box2D manual and there's no indication that simple triangles are disallowed. In fact, there's even an example of a triangle in the manual https://github.com/erincatto/box2d/blob/ecatto/manual/docs/manual.md, so I guess wedges actually can be perfect triangles, so there's no need for that weird 4th point. I can also confirm this in testing.

from tbe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.