Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

Is there a way to measure the pressure of an object upon another object?

Asked by 10 years ago

As the titles says, it is possible to measure the pressure between an object and another object EX. A car crash.

1
It's late, so if nobody has answered by the end of tomorrow then I'll share some thoughts on the matter on Friday. ;) My initial remark is that you don't need to bother with pressure, but rather just changes in momentum/forces applied/rate of change of velocity/impulses. i.e. You perhaps don't need to know about the relative sizes of surfaces and their 'pressure' exerted to achieve what you want. duckwit 1404 — 10y
0
Thanks :) Orlando777 315 — 10y

1 answer

Log in to vote
0
Answered by
25564 200 Moderation Voter
10 years ago

Firstly I know I am a little late to the party here but I would like to share something quickly. Firstly I think accurately simulating a car crash in Roblox would be a pain, but I would go about it by first getting the mass of the two vehicles with:

function getMass(obj)
    if not obj then return 0 end
    if obj:IsA("BasePart") then
        return math.ceil(obj:GetMass())
    else
        local mass = 0
        for i, p in pairs(obj:GetChildren()) do
            mass = mass + getMass(p)
        end
        return mass end
end

Then I would measure the two speeds of the car then use this to approximate force. How would simulate the results are beyond me and this is a simple solution as a more complex one would involve some very interesting math involving the surface size of the impact and materials involved and a whole host of other equations that I think is simply too in depth to be relevant to current roblox games.

0
Lets say you already have the mass, how would you "approximate the force" witht the two speeds one a touched event? I was thinking of having sensors in the sides and front of the cars. If they also ram each other from side to side, how do I measure that force? (since it would be in a different direction, not forward.) Orlando777 315 — 10y
Ad

Answer this question