corona icon indicating copy to clipboard operation
corona copied to clipboard

Core/Physics: Add option needHull to Outline/Shape body to using Hull Builder.

Open kan6868 opened this issue 7 months ago • 0 comments

This upgrade provides better and more optimized vertex handling. More explained in the description of this PR.

I did a work to ensure backwards compatibility with Solar2D:

local image_name = "star.png"

local image_outline = graphics.newOutline( 2, image_name )

local image_star = display.newImageRect( image_name, 32, 32 )

physics.addBody( image_star, { outline=image_outline, needHull = true } )
local pentagonShape = { 0,-37, 37,-10, 23,34, -23,34, -37,-10 }
 
physics.addBody( pentagon, { density=3.0, friction=0.8, bounce=0.3, shape=pentagonShape, needHull = true } )

Work with PR

https://github.com/coronalabs/submodule-box2d/pull/8

kan6868 avatar Jul 11 '25 01:07 kan6868