Find out force of impact ?

Hi everyone,

I have not seen a solution to this, but lets take the falling craters box on the ground.

Is there a way to see with how much force it hit the ground ? Lets say I make one box start at top of screen and one at center of screen, they would hit the ground with a different force. This should be available as this is clearly demonstratable with this code below. The rect1 jumps higher than rect2

[lua]H = display.contentHeight
W = display.contentWidth

local physics = require(“physics”)

local rect1 = display.newRect(20,10,50,50)
local rect2 = display.newRect(W/2, H/2, 50, 50)

local floor = display.newRect(0,H-20, 320, 20)

local leftWall = display.newRect(0,0,10,H)
local rightWall = display.newRect(W-10,0,10,H)
local function start()
physics.start()

physics.addBody(floor, “static”, {density=2, bounce=0.2})
physics.addBody(rect1, {denisty=2, bounce=0.3})
physics.addBody(rect2, {denisty=2, bounce=0.3})
end

start()[/lua] [import]uid: 61610 topic_id: 10334 reply_id: 310334[/import]

i dont know if there is already a special function to determine that

but it can be solved using some physics equation

see this example

http://www.ehow.com/how_6454559_calculate-force-falling-object.html

[import]uid: 46546 topic_id: 10334 reply_id: 37700[/import]

There is an API for that

http://developer.anscamobile.com/reference/index/eventforce

You can use “event.force” to get the force of a collision. “event.force” happens within the PostCollision event. [import]uid: 27965 topic_id: 10334 reply_id: 37705[/import]

calebr2048 : Thank you so much, this worked just as expected [import]uid: 61610 topic_id: 10334 reply_id: 37706[/import]

No problem, glad I could help. I am new to Corona so I am excited when I can help others with what I’ve learned. [import]uid: 27965 topic_id: 10334 reply_id: 37707[/import]

Me too. I just got approved a project idea I had that requites Corona, so I now need to put up and show stuff, so I am busy as a hamster now [import]uid: 61610 topic_id: 10334 reply_id: 37708[/import]