Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

graphics.newOutline VS. third party app like "Physics Body Editor"
Started by craig.stowers May 13 2019 02:05 AM

- - - - -
3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

craig.stowers

[GLOBAL: userInfoPane.html]
craig.stowers
  • Observer

  • 29 posts
  • Corona SDK

When it comes time to do more than basic shapes... what is the general wisdom on how to build your shapes?

So far I've been getting by with graphics.newOutline on simple black & white "outline" images, which I lay a proper detailed image above. Seems to work but I'm wondering if it comes at a performance cost? I imagine not if the shapes it calculates are rather simple?

If it's better to use an editor for tracing shapes then which editor is recommended?

Also if there is no good reason to change my newOutline workflow (which seems to work), is it just assumed all devices will pretty much behave the same in generating these shapes?

Thanks. I wasn't exactly sure which sub forum this might belong in...



[TOPIC: post.html]
#2

ojnab

[GLOBAL: userInfoPane.html]
ojnab
  • Contributor

  • 574 posts
  • Corona SDK

I use PhysicsEditor. It is the best one as far as I know.

https://www.codeandweb.com/physicseditor



[TOPIC: post.html]
#3

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 894 posts
  • Corona SDK

The best match would probably be the physics API thread, but this works just as fine. :P

ojnab's suggestion is great. PhysicsEditor is a well-established, reliable and affordable physics editor. The vendor also has other cool software like TexturePacker and SpriteIlluminator that you can pair with PE.

I would personally not recommend using graphics.newOutline for live games. If it is being used on user submitted images, then that may be the only way, but I don't like how little control I have over the actual outline. If the shape isn't overtly complex, then I personally prefer to type it in by hand :D



[TOPIC: post.html]
#4

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 522 posts
  • Corona SDK

Physics Editor is great.  It will seamlessly repack your object as a multi-element body.  However, if the shapes are detailed and small, you can have collisions that fail to resolve correctly.  Small physics objects with intricately shaped bodies can get stuck inside each other during collisions and eventually pry apart in ways that crash the engine.  A trick for resolving this is making your objects really big and then scaling the world view.

 

Another trick is to use circular bodies as much as possible (even if the shape isn't quite circular).  Box2D seems to resolve circular bodies with the most ease.


  • craig.stowers and XeduR @Spyric like this


[topic_controls]
[/topic_controls]