0
\$\begingroup\$

The official guide does not have any useful details on the matter:

http://www.box2d.org/manual.html

Position is an obvious one. What about velocity? Density? Anything else?

Update: the context is wrapping/interfacing a physics engine to make it more usable. E.g. units of measure in the game editor should be consistent.

\$\endgroup\$
4
  • \$\begingroup\$ Could you clarify what you mean by "pixel conversion" and provide an example for what you want to achieve? Also, your question seems vague and does not state a clear problem you are having. \$\endgroup\$ Commented Jun 24, 2015 at 8:30
  • \$\begingroup\$ everything is relative, box2d works better (more efficient and accurate) with lower numbers. if you have a box that is 30x30 and apply a force or 10,0 to it, it would have the same effect as having a box 30/ratiox30/ratio and applying a force of 10/ratiox0/ratio. \$\endgroup\$ Commented Jun 24, 2015 at 9:15
  • \$\begingroup\$ @d3dave Box2d recommends using SI units and converting to pixels when something needs to be drawn. When creating a new entity, specifying its position in pixels is natural, but it raises the questions of what kind of units should be used for other parameters? E.g. |entity.Position = "{x:10px, y:10px}"| vs |entity.BodyDensity = "53kg/m^3"|. \$\endgroup\$ Commented Jun 24, 2015 at 12:41
  • \$\begingroup\$ @Den: No, when creating a physical entity it's position needs to be specified in physical units, not pixels. Only when drawing the entity should you transform the units to pixels. \$\endgroup\$ Commented Jun 24, 2015 at 13:24

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.