Skip to content

Conversation

zero-meta
Copy link

  1. We can tuned box2d by 'physics.setMKS' now.
  2. When changed the pixels-per-meter ratio with a little bigger number, like physic.setScale(160), we will receive too much
    'body shape no area' warning, And loose collision shape we defined.

@CLAassistant
Copy link

CLAassistant commented Jan 9, 2022

CLA assistant check
All committers have signed the CLA.

@Shchvova
Copy link
Contributor

So I was reviewing this pull request and it seems to alter how physics is solved. Would this break existing games, how would it alter physics? I am not pro in Box2D, so didn't want to dive deep if you have some quick answers.

@zero-meta
Copy link
Author

It will not break existing games. We fixed three problems.

  1. Solar2d api 'physic.setMKS' is exposed to user before, but it has no actual effect when user call it. Now we changed the code to take the effect.
  2. When we defined a fixture shape that contains points closed too much, we will receive no area warning. And the shape will be ignored. But according to the box2d official repo, the tolerance here should be squared. We changed this to prevent ignoring of the small but normal area shapes.
  3. For the 'physics.newJoint' api, we exposed a boolean param to let us control if the joined objects follow the standard collision rules or not. We make a pull request #327 on the solar2d main repo.

Those three changes will not change the default behavior of box2d and apis defined by solar2d. So they will not break existing games.

zero-meta and others added 5 commits November 23, 2022 14:51
local particleSystem = physics.newParticleSystem
{
    filename = "particle.png",
    radius = 3,
    filter = {categoryBits=1, maskBits=0xFFFF, groupIndex=0}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants