on the tutorial for the weld-joint, they says that it’s not rigid, there are slighty move because math calculation.
Use better an entire multi-body with shape, it’s don’t oscillate, and you can rotate the whole body easily.
Use also a preCollision to made the part-element “sensor” with the contact isEnabled value.
local ball=display.newGroup() local shapes = {} local numPart = 1 local function add(i,j) local r1=display.newRect( ball, 50\*i, 50\*j, 40, 40) // or other pictures shapes[1+#shapes]= {shape= {-20+50\*i,-20+50\*j, 20+50\*i,-20+50\*j, 20+50\*i,20+50\*j, -20+50\*i,20+50\*j} } r1.id=numPart numPart=numPart+1 return r1 end for i=-2,2 do for j=-2,2 do if i~=0 or j~=0 then add(i,j) end // avoid the center, just for esthetic ; you can put here a png end end physics.addBody( ball,"dynamic", unpack(shapes) )
However, the shapes in Bubble Spinner are hexagonal in nature. So it’s a hexagonal grid.
I also want the momentum to be transferred to the central body on collision(which rotates along the central axis). What do you suggest in that regard? The center of this physics body needs to be pivoted to the center. I’m guessing that you havent taken into consideration the rotation of the cental setup.
on the tutorial for the weld-joint, they says that it’s not rigid, there are slighty move because math calculation.
Use better an entire multi-body with shape, it’s don’t oscillate, and you can rotate the whole body easily.
Use also a preCollision to made the part-element “sensor” with the contact isEnabled value.
local ball=display.newGroup() local shapes = {} local numPart = 1 local function add(i,j) local r1=display.newRect( ball, 50\*i, 50\*j, 40, 40) // or other pictures shapes[1+#shapes]= {shape= {-20+50\*i,-20+50\*j, 20+50\*i,-20+50\*j, 20+50\*i,20+50\*j, -20+50\*i,20+50\*j} } r1.id=numPart numPart=numPart+1 return r1 end for i=-2,2 do for j=-2,2 do if i~=0 or j~=0 then add(i,j) end // avoid the center, just for esthetic ; you can put here a png end end physics.addBody( ball,"dynamic", unpack(shapes) )
However, the shapes in Bubble Spinner are hexagonal in nature. So it’s a hexagonal grid.
I also want the momentum to be transferred to the central body on collision(which rotates along the central axis). What do you suggest in that regard? The center of this physics body needs to be pivoted to the center. I’m guessing that you havent taken into consideration the rotation of the cental setup.