I have a fast moving physics object set as a bullet. The problem occurs when the object collides at a speed great enough where it would normally pass through if mybody.isBullet did not equal true. When it collides with the wall the wall momentarily (on one frame) breaks its weld with the center piece. However on the next frame the wall reestablishes its weld.
It takes a sharp eye to notice and it is only an aesthetics problem the physics of the game behaves as it should.
[lua]
display.setStatusBar( display.HiddenStatusBar )
require “physics”
physics.start()
physics.setDrawMode(“normal”)
physics.setGravity(0,0)
–components
center = display.newCircle(50,50,50)
center.x = 320
center.y = 480
physics.addBody(center, “kinematic”,{ radius=50})
blade_HORI_Sensor = display.newRect(200,15,250,20)
blade_HORI_Sensor:setFillColor(200,0,0)
blade_HORI_Sensor.x = 320-125; blade_HORI_Sensor.y = 470
physics.addBody(blade_HORI_Sensor, “dynamic”,{ bounce = 1})
blade_HORI_Wall = display.newRect(200,15,250,20)
blade_HORI_Wall:setFillColor(0,200,200)
blade_HORI_Wall.x = 320-125; blade_HORI_Wall.y = 490
physics.addBody(blade_HORI_Wall, “dynamic”,{ bounce=1})
blade_HORI_Tip = display.newCircle(320-250,480,20)
blade_HORI_Tip:setFillColor(0,200,200)
physics.addBody(blade_HORI_Tip, “dynamic”,{ radius=20})
–
physics.newJoint( “weld”, center, blade_HORI_Sensor, 320, 480 )
physics.newJoint( “weld”, center, blade_HORI_Wall, 320, 480 )
physics.newJoint( “weld”, center, blade_HORI_Tip, 320, 480 )
center.angularVelocity = 300
gameBall = display.newCircle(400,150,16)
physics.addBody( gameBall, “dynamic”,{radius = 16, bounce = 0})
gameBall.isBullet = true
gameBall:setLinearVelocity( -1000, 1000 )[/lua]