Force and acceleration

Hi, im trying to calculate stress applied on object and im having a hard time believing that to calculate the force that you need to calculate the stress you need only to do, Mass * Acceleration???.

If let say a rock with a mass of 999999999999999999kg fall on you at a constant speed of 999999999999m/s which is not changing direction then the force will be 0 because the acceleration is 0 and the stress will be 0 because 0 divided by anything(Area m2 in this case) is zero so im not very sure how to calculate it. And i would like to know how to actually calculate Acceleration in game.

Looked up a lot of page about, it same thing.

1 Like

If the rock is falling at a constant speed, the sum of forces affecting its movement is zero. However, that doesn’t mean that no force is affecting it. It means that the force that is moving it upwards (air resistance) is as big as the force that is moving it downwards (gravity). So I think that the force to use for calculating the stress is just the gravity, which is rock:GetMass() * workspace.Gravity. I’m not sure though.

Edit: I was wrong. The force that air applies to the rock’s bottom surface while the rock is falling may be equal to gravity (I’m not sure), but the force that the rock applies to the head isn’t.

image
try using these equations.
The reason F=ma when a is 0 making F= 0 is because while the object is moving there isn’t a change in acceleration so the Force is 0, but once the object hits something there is a deceleration and that deceleration is what shows how much force is being transferred from one object to another.

2 Likes

In the case of an object which isnt accelerating, stress is not a result of the total force

Say you have a big rope which can only hold an object which applies a force of up to 500 newtons


This rope has a force of 100 N being applied to it but its not moving
How does that make sense?
F = MA
100 = M*0
100 = 0???

The reason this happens is because the rope applies a tensile force of 100 N to counteract this weight of 100 N resulting in a total force of 0

100 + -100 = M*0
0 = M * 0
0 = 0
This makes much more sense

Stress is like the inner force some object has to apply to counteract some other force having to do with molecular bonds and mechanical connections, not necessarily the total force on the object

When you say that a rope can only hold 500 N of force, what youre really saying is:
The fibers in this rope can only apply an opposite force of up to 500 N before breaking

Hopefully that brings some more clarity to the question but Im not the best at explaining things
If you are still confused I should be able to reply sometime soon

I think that you are right, but how can i calculate the acceleration whitout causing too much lag?

For a falling rock the acceleration is gravity (aka 192.2 studs/sec/sec)
Other than that we might be able to give more insight if we knew more about the specifics of your problem
Would you mind sharing more details?

Oops, i did no read the first post you made so i gonna make a reply on that one but i wont delete this one maybe it will still help.

Yeah but what if there is no gravity. And is acceleration a Vector? Like if your velocity is 10000, 0, 0 and you and it never change if it hit a surface with a normal of 1, 0, 0 then even if the acceleration is 0, 192.2, 0 it will do no damage because it is not logic to apply Force or Acceleration if it did not hit something in that axis or am i wrong? If you dont understand i could try explaining you.ex

I think you did not understand, i meant calculate force whitout acceleration. If an cube is moving at a constant speed and hit a wall then no matter what the speed and the mass of the cube was the applied stress will be 0 because the acceleration is 0.

Maybe im talking about the wrong force because i discovered that the formula to calculate stress is (Fn(Normal Force) / Area) and Fn is the force that an object apply to another so the other object do not go trough it. The formula for it is (Mass * GravityForce + cos(Surface Angle) + ExternalForce * sin(External Force Angle). The thing that make me think that im using the wrong force is, the fact that even if you are not moving you are applying force to the object due to gravity and that even if a constant force is applied to you and is never changing you are still applying force to the object but with the other force technique it wont do anything because there is no acceleration.

The normal force is typically for stationary objects just like sitting on a table or sitting in an elevator and their response in relation to external forces and gravity (like the formula you showed said)

For calculating max force in collisions like you said you’d probably want to venture into the field of momentum

Formulas I will use and reference back to using the number assignments:

image

(1): the formula for the momentum of an object
p=momentum
m=mass
v=velocity

arrow hat means its a vector quantity (or it has direction)

(2): the formula for impulse, or change in momentum
Δp = impulse or change in momentum
F = force
Δt = change in time

Δ means “the change in ____”

(3): the formula for the coefficient of restitution, or elasticity, related to the energy lost in a collision
c = coefficient of restitution
v1f = the final velocity of object 1
v2f = the final velocity of object 2
v1i = the initial velocity of object 1
v2i = the initial velocity of object 2

| | means the absolute value of ___, or just making it positive (eg |-5| = 5, |-10| = 10, etc…)

(4): formula for conservation of momentum
pinitial = the initial net momentum (sum of all of the momentums of objects 1 and 2 before the collision)
pfinal = the final net momentum (sum of all of the momentums of objects 1 and 2 after the collision)


Lets start with the harder collision of two moving objects

According to the conservation of momentum, formula (4), the total momentum before the collision is equal to the total momentum after the collision
Using formula (1), we can fill this formula out in the context of our problem:


m1, v1i, m2, and v2i are all known values because roblox gives them to you

We’re trying to solve for v1f and v2f because, using those values, we can calculate its final momentum, and therefore its change in momentum, Δp
We can then use Δp and Δt to calculate the force, F applied on each object

The problem we are faced with is that we need to solve for two variables with one equation, which isnt possible without a second equation
So we need another equation

Lets begin working on one other equation with velocity which we could use, equation (3)

I will be using the average of the two objects elasticities according to each objects elasticityweight (these are two other values given by the roblox engine, which can be found using part.CustomPhysicalProperties.Elasticity and part.CustomPhysicalProperties.ElasticityWeight if customphysicalproperties is enabled in studio which is a really stupid limitation but whatever. you can just determine your own elasticity values if you really want)

Some formulas roblox could perhaps use for this are:
image

(6): formula for the elastic weight combined, the proportion of e1 that will be used to determine the combined elasticity/coefficient of restitution
I will use (1-ewc) to determine the proportion of e2 that will be used to determine the combined elasticity because they both add to 1 (ewc1+ewc2=1; ewc2=(1 - ewc1))

ewc=corrected elastic weight of object 1
e1w=uncorrected elastic weight of object 1 (given by roblox)
e2w=uncorrected elastic weight of object 2 (given by roblox)

(7): formula for the average, combined elasticity using both of the elasticities of object 1 and 2, and averaging them according to the weights, ewc and (1 - ewc)

e1=elasticity of object 1 (given by roblox)
e2=elasticity of object 2 (given by roblox)

Going back to the beginning, lets use equation (3) to bring this equation into the main problem
Remember how we’re trying to solve for v1f and v2f, and how we need two equations to do that

Now we have two equations, (3) and (5)

Remember, we’re trying to solve for v1f and v2f, so lets begin
We will start by solving for v1f in both equations, (3) and (5), starting with (3):

image

Continuing onto (5):

Set (9) and (11) equal to eachother and solve for v2f:


I believe that the ± symbol in equation (16) (and the previous ± symbols of course) can be turned to a + symbol, because in the case of a collision with any elasticity the two objects would not continue in the same direction or phase through eachother, and in the case that c = 0, or theres no elasticity or bounciness, the ± term is multiplied by 0 and no longer affects the behavior
For simplicity sake, I will simply change it in equation (16) and leave it in the rest

Now, knowing v2f we can just plug it into one of our equations such as (11) and we will get an answer for v1f

We can simplify this a lot when the second object isnt moving / cant move (is anchored)

Going back to equation (9), we can make a couple assumptions

v2f = 0
v2i = 0

Therefore:
image

In this case the ± symbol can be turned to a - symbol, because if its + it would go straight through the stationary object which isnt a very realistic solution

So, with that in mind, lets continue on with this post and wrap it up sooner rather than later

The next part of this problem is converting our vf values to forces using equation (2)

The hard part of this relatively short equation is the weird Δt term
So basically, I think the best way to go about the Δt term would be to determine it yourself depending on the material in terms of an “impact absorption rate” in terms of Δt/stud/second, so steel would have a Δt/s/s of 0.01, and fabric would have a Δt/s/s of 0.5
This “Δt/s/s” value is the speed at which the material can decelerate an object
A metallic object slows down an object very quickly and abruptly, causing more force and more damage, while a fabric pillow slows down an object very slowly and gently, causing less force and less damage

(I edited the t/s/s value a tiny bit in order for it to work properly downwards, the new t/s/s value should be a value from 0 to 1 and represents the amount of time lost from a starting value of 1 second, at 1 stud/second)

(up and down in that graph is Δt, or the time it takes for the collision to happen. side to side in the graph is the speed, stud/second)

So I would take the Δt/s/s value of each object and average them
So for example, if metal hit metal I would add 0.03 Δt/s/s and 0.01 Δt/s/s together to get an overall deceleration of 0.02 Δt/s/s
I would then get the difference between the two velocities and power that to the average of the two Δt/s/s values
The formula for this would look something like:


(in the case of a collision with a stationary object, v2i is 0, so just plug in 0 for v2i)
(also its hard to tell but the |v1i-v2i| is in an exponent)

t1ss and t2ss are the Δt/s/s values of each object, 1 and 2 then the velocities are of course just the velocities

Now, to calculate Δp, you simply need to get the difference from initial to final velocities for both of the objects and plug them into equation (1), this is shown below:
image
You would use equation (20) once each for object 1 and object 2

So now, we are able to calculate the force by just rearranging equation (2) a little bit:
image

So, to sum it up:

For collision with a stationary object:
Use equation (7) to calculate the coefficient of restitution, plug into equation (17) along with the initial velocity, then use the final velocity in equation (19) along with the initial velocity and mass
You then have to calculate Δt in equation (18) using the predetermined Δt/s/s values for each material class along with the velocity of the moving object and 0 for the nonmoving object
Then use Δp and Δt which you just calculated in equations (18) and (19) in equation (20) to solve for the force
You can then plug this into the stress equation, (21)
image

For collision with two moving objects:
Use equation (7) to calculate the coefficient of restitution, plug into equation (16) along with object 1 and 2’s masses and velocities
Then use v2f to calculate v1f into equation (9) or (11) (I would prefer equation (9) because its far shorter but also has the added complexity of the ± symbol, just remember that the ± symbol can be simplified to a - in this specific equation)
You then plug this data into equations (18), (19) and then (20) using the methods described just above (keep in mind in this case youll actually use the same formula, you will NOT set v2i or vf to 0 in any of the cases

As for the area component of the stress equation, Im really not sure what you would do
I would personally, if I wanted a lot of realism, calculate either an actual area based on the shapes, angles and positions of the two objects, or use some filler value based on some random calculation, or just simply ignore that part of the formula cause force is proportional to stress and for roblox collisions it probably doesnt matter all that much
I would be interested to hear what you have to say about the area though, in terms of the actual application of this system so perhaps you could reply back on this topic

Continuing on to a more complete piece of code, here is how I would likely implement all of this math, applying the explanations above


function elasticity_weight_combined(e1weight,e2weight)
	return e1weight/(e1weight+e2weight) --formula (6)
end

function elasticity(e1,e2,e1weight,e2weight)
	local ewc = elasticity_weight_combined(e1weight,e2weight)
	return e1 * ewc + e2 * (1 - ewc) --formula (7)
end

function delta_t(t1ss,t2ss,v1i,v2i)
	return ((t1ss + t2ss)/2)^math.abs(v1i - v2i) --formula (18)
end

function delta_p(m,vi,vf)
	return m * (vf - vi) --formula (19)
end

function stationary(vi, m, e1, e2, e1weight, e2weight, t1ss, t2ss)
	local c = elasticity(e1,e2,e1weight,e2weight)

	local vf = -(c*vi) --formula (17)

	local delta_p = delta_p(m,vi,vf)

	local delta_t = delta_t(t1ss,t2ss,vi,0)

	local F = delta_p/delta_t --formula (20)
	--do stress stuff here
        --you likely want to math.abs() the force, because the direction isnt really important here
end

function nonstationary(v1i, v2i, m1, m2, e1, e2, e1weight, e2weight, t1ss, t2ss)
	local c = elasticity(e1, e2, e1weight, e2weight)
	local a = m1 * v1i + m2 * v2i + m1 * c * v1i - m1 * c * v2i --top half of formula (16)
	local b = m1 + m2 --bottom half of formula (16)
	local v2f = a/b --combining of two halves
	local v1f = v2f - c * v1i + c * v2i --formula (9)

	local delta_p_1 = delta_p(m1, v1i, v1f)
	local delta_p_2 = delta_p(m2, v2i, v2f)

	local delta_t = delta_t(t1ss,t2ss,v1i,v2i)

	local F_1 = delta_p_1/delta_t --formula (20)
	local F_2 = delta_p_2/delta_t --formula (20)
	--do stress stuff here
        --you likely want to math.abs() the two forces, because the direction isnt really important here
end

--further considerations
--[[

* Producing of t1ss and t2ss values
* Producing of e1, e2, e1weight and e2weight
* Length of code & performance
* Multi-object interactions
* Detecting collisions, getting velocity and mass

-- Producing of t1ss and t2ss values --
KEEP IN MIND THE NEW TSS VALUES NEED TO BE BETWEEN 0 AND 1
As I recommended earlier, I would make several values based on the material, or just one big general value if that doesnt matter that much
You could do something like:
local tss_values = {
"Stone" = 0.01,
"Metal" = 0.02,
"Wood" = 0.1,
"Fabric" = 0.5...
}
---------------------------------------------------

-- Producing of e1, e2, e1weight and e2weight --
Either use a predetermined value between 0 and 1 for all of the values (robloxs default for like plastic for example is e = 0.5, eweight = 1), or by ticking customphysicalproperties IN STUDIO (This is a HUGE limitation because you cant use robloxs default values unless you tick the customphysicalproperties in edit mode of studio. Idk why they made it like that in their new update but who cares, we have to deal with it. I would personally just make my own elasticity and elasticity weight values for each material just like the Δt/s/s values above)
-----------------------------------------------------------------

-- Length of code & performance --
This is way longer than I hoped it would be and I can see why you might be thinking (because you commented it earlier), how could this be efficient?
I mean Im no expert but, because these are all very elementary calculations and the cpu can do them in like 0.0001 nanoseconds I wouldnt personally be worried about it. I would be more worried about the implementation of this system (for example if you used .touched to detect collisions on tons of objects)
-----------------------------------------------

-- Multi-object interactions --
I would personally not care that much about multi object physics and mass, and just think about each object individually, BUT if you have a big ship made up of like 500 parts, you either could or could not, for the mass of object 1, count all of the masses of the entire ship together
I mean to be honest thats pretty important, because if a tiny little triangle piece on a big ship hits something it will take on the weight of the whole ship like its nothing and isnt very realistic
But this is absolutely something you might have to consider when thinking about such things
Im just mentioning this here so you can think about it from your perspective, because I really dont know much about what youre trying to do
-------------------------------------

-- Detecting collisions, getting velocity and mass --
Like I was talking about earlier, you could use like .touched to detect collisions however this might get real laggy real quick
Im not sure the scale of your project and that might be a good thing to reply about, because if there is a massive scale in your project a new solution might have to be thought through

Also for getting velocity and mass, in the case that you're not familiar with such things here is the process
(its much easier than elasticity and stuff)

1) velocity
I have built this program around 1D collisions, and therefore we need to think in 1D
We need to get the relative velocity between the two which can be done somewhat simply
To get the raw 3D velocity of both objects, use part.AssemblyLinearVelocity
To convert it to a 1D thing, I would just do
v1i = v1_linearVelocity3D:Dot(part2.Position-part1.Position)
v2i = v2_linearVelocity3D:Dot(part2.Position-part1.Position)
v1i and v2i are the things you want
2) mass
This is much simpler and just involves a basic function
part:GetMass()
I just thought Id throw this here in the case that, again, you arent familiar with how to get the mass of a base part
-------------------------------------------------------------------


--]]

I most certainly forgot many things so please feel free to ask questions and respond to the multiple considerations, and Im always happy to clarify my bad work so feel free

Sorry it took forever but as you can see its a tiny bit long

tl;dr:
phisyks

5 Likes

I thought F = M * A

So parts mass * it’s speed?

Do the code contain all the formula? Im currently trying to understand how everything work and i got a little question. Could you try keep it as simple as possible because im not very good at complex math. I dont really understand the utility of the formula 8 to 16 cause i dont see it anywhere in the code or the equation in general. Is the 8 to 16 are represented in the code as a and b? And Vi is the velocity at which the object touched the other one? And thank you for that cause like i said im struggling with complex math and when i find something on the internet i understand like 5% of it, so your help give me a lot of progresses. And should i still take in consideration the Normal Force?

All 21 of the formulas are not used in the final product
Most of them are just the steps of how to get to the final solution
I have labeled which formulas are which in the code to make it more clear, sorry for the confusion

As for formulas 8 to 16
Formulas (8) and (9) are rearrangements of formula (3), I was just showing the steps to solve for v1f
Similarly, (10) and (11) are rearrangements of formula (5), I was again just showing the steps to solve for v1f

I then set formula (9) and (11) equal to eachother (in a similar way that you would set (this is completely unrelated, just as an example) a+5=b and 2a+3=b equal to eachother like a+5=2a+3 because they’re both equal to eachother by the variable b)

Once I set formula (9) and (11) equal to eachother I solve it for v2f from (12) to (16)
(16) is the final answer for the final velocity of object 2
You can then plug in the final velocity of object 2 back into formula (9) or something like that to solve for the final velocity of object 1, v1f

So most of these formulas arent even used, theyre just steps along the way of me solving the problem
From (8) to (16), the only ones I use in the final product are (9) and (16) for actually solving for v1f and v2f

Also yes, I kinda split it into a and b
Equation (16) I split into the top and bottom half of the fraction, top being a and bottom being b just to shorten the line, I do a/b right after to complete the fraction
I also labeled this in the code for more clarity

Vi is the velocity as it touches the other object, or right before it touches the other object, you are correct

As for simplifying it, depending on how much realism you want, you could really delete all of the elasticity and Δt stuff, giving them generic values, but this really cuts down on realism and I wouldnt personally recommend it but its your game

Here is the simplified code:

function stationary(vi, m)
	local c = elasticity(e1,e2,e1weight,e2weight)

	local vf = -(c*vi) --formula (17)

	local delta_p = m * (vf - vi) --formula (19)

	local delta_t = delta_t(t1ss,t2ss,vi,0)

	local F = delta_p/delta_t --formula (20)
	--do stress stuff here
        --you likely want to math.abs() the force, because the direction isnt really important here
end

function nonstationary(v1i, v2i, m1, m2)
	local c = 0.5 --general value of 0.5 elasticity 
	local a = m1 * v1i + m2 * v2i + m1 * c * v1i - m1 * c * v2i --top half of formula (16)
	local b = m1 + m2 --bottom half of formula (16)
	local v2f = a/b --combining of two halves
	local v1f = v2f - c * v1i + c * v2i --formula (9)

	local delta_p_1 = m1 * (v1f - v1i) --formula (19)
	local delta_p_2 = m2 * (v2f - v2i) --formula (19)

	local delta_t = 0.05 --very general value of 0.05 Δt

	local F_1 = delta_p_1/delta_t --formula (20)
	local F_2 = delta_p_2/delta_t --formula (20)
	--do stress stuff here
        --you likely want to math.abs() the two forces, because the direction isnt really important here
end

Also I made a bit of a mistake for the Δt/s/s value in the original math, where it would increase with higher speed when it really should trend downwards, Ill go about fixing it in a sec

As for normal forces, in terms of a collision I think the force of velocity change should be enough, especially considering the amount of math here
In terms of an object just sitting there, unless youre doing something really intensive, it shouldnt be enough to cause significant stress on the object but youd have to be the one to decide that

Thank for your response, im actually looking for my game to be the more realistic to the Noticable and Shor Time point, what do i mean by that is that im trying to make my game realistic as possible whitout taking in account minor, long period and laggy factor. I will firstly answer to your question that you add and then im gonna ask the one that i did not think about at the begining. You first question was about getting the area which the stress is applied on, im gonna first list the step below and then explain them with details, problemes and optimisation.

  1. Reconstruct the position, rotation and velocity of both object when the hit happend.

  2. Performe 2 SubtractAsync() to get the area.

  3. Get the size of the area.

The first step is vital because if we dont do it, when the part touch something it has time to bounce off before the event execute which then lead to an error saying that the area which is an Union is nil because you cutting nothing with nothing. It is currently not working because i have no idea how to restore it.

An easy solution to this is to completly remove elasticity but at the same time it remove a lot from the game and the destruction. The next solution that i got was to raycast in the opposite direction to the velocity but because it is a raycast it is not very accurate which caused it to no work properly on medium sized object or when the object velocity was too fast. So this step still need a solution which was not found with 2 other post that i made.

The second step is pretty simple, i just SubtractAsync() the part that is affected by destruction to the hit part which give a hole part(hp) and then i SubtractAsync() the part with hp and it give a Union shaped as the hole made by the first SubtractAsync().

There is currently a problem in this part too but i think that it is because it in a Module Script but i did not use OOP because i half understand it but im not sure at 100%. The problem comes when 2 objects are using the module which then cause the script to create an infinite amount of hp.

The last step is just to get the area size, get the 2 right axis and convert them to Pa.

Your next “question” in this case was about multi-object interaction, every structure will be an Union created at the load of the map with every part individual property(Color, Material, Mass and attribute) saved somewhere(Maybe a module script) so i can modify each part property and if roblox dont care about the union part and mass then the mass will be recalculated smartly if a part get fractured or thing like that. For the scale of the project, im the only one working on it, there will be 20 player(All device maybe vr) server, menu to create your own server and maybe a story mode will release at some point.

For you collision detection question i would really need something else but i dont see any possibility maybe we could try to figure out each of the problemes together or if you really want, maybe help me make the game?

Now im gonna ask my question. How i expected it to work it is that when a tagged(Affected by destruction) object get touched the game calculate the stress applied on it so, if i only want to get the stress of the tagged part what do i do or it is already doing that.

So i made a graph on what i have found in these days which because im really bad at it, understand almost anything about it and complex math, my progress for the amount of time are minimal so, could you try to help me understanding some time and maybe modifying them to be correct. And because all of these thing have formula that i just cant understand could you try to help me figure them out and shorting the one that are in the category of realism at the top of my first reply to your post. Thanks.

I mean a lot of this math would require literal years of intense study, and I think that at a certain point its no longer realistic to be realistic

I probably wouldnt calculate elastic deformation, because its just temporary
I might calculate plastic deformation because its permanent, but by “calculate” I would mean just more of finding the yield stress and applying damage to the part through unions once the pressure reaches beyond that point
Robox doesnt really support part fracturing either in normal unions (you could probably implement it but itd be real hard), and the actual fracturing of a part is more prominent in statics like a bridge or rope, not as much in the collision of two objects (especially when roblox doesnt let it happen easily)

I would say the damage of a part would be limited to:

  1. Permanent deformation if the stress above the yield stress is reached
  2. Accelerated permanent deformation if the stress is above the ultimate stress
  3. Destroying the object after a certain amount of deformation and damage

All of this could be fairly easily calculated through less realistic means in terms of physics but possibly more realistic in terms of your project

Two considerations you might want to think about for a more realistic feeling collision are:

  1. The changing of the force
  2. The changing of the impact area

The force usually has a graph shape of an “upside down v”, like this:


The force value we calculated is the peak force I believe

We can use the values to calculate how the force changes over time

F(t) is the function of how the force, F changes over t, time
F is the force at a given point in time
t is the time since the start of the collision
Fp is the peak force which we calculated in the massive set of equations above
Δt is the total time of the collision

The changing impact area is harder but there are certain ways to calculate such things

A sphere, for example, will have an impact area, over a distance, of:
image

(A visual representation of a similar concept, this uses a different formula and is 2D but is a similar concept)

This is much harder for shapes like squares and especially cubes and it would take a very long time to figure out a problem like that, the cross sectional area of any plane intersecting a cube in 3D, which is probably like the fundamental equation of all geometry or something
Although this behavior would be super cool Im just not sure its realistic for a project like this In my personal opinion

I would just go with whatever you can think of
You could do a raycasting thing, scrap area alltogether, give a certain set value for area, estimate the area based on the types of objects (for example anything touching a sphere at the initial point will be touching at just a single point, and same with pretty much any square thats not perfectly lined up, and the area would grow as the object further deteriorated)
This last option is what I would try
Starting with an initial area value which is quite low, but it increases based on some rate then decreases as the object gets pulverized into dust
(This is similar to the force and Ill use basically the same equation)

Represented graphically as some random function I made to generally represent something like that:


Formula:

A(x) is the cross-sectional area of the object over x distance
A is the area
x is the current depth it has deformed into the object
Amax is the maximum cross sectional area of the object (the widest it could be from that angle)
ddepth is the total depth of the object from that angle

(I would also probably add a constant to the very end of this equation such as 0.05 so you dont get infinite stress values at the beginning of the collision)

“that angle” being the direction from the other object smashing into it

I cant think right now of a good way to calculate Amax, you could do a shortcut using relative positions and sizes or something but I cant think rn
As for the max depth you can just raycast the front and of the object being hit or something like that

The depth wouldnt be determined positionally, but you would calculate it based on the stress using some deformation thing which you would probably get by getting the area of the stress function according to time over the yield stress and applying some constant to turn that stress area into a depth of deformation
You could then get the area of the stress function according to time over the ultimate stress and apply some even higher constant to turn that stress area into an even higher depth of deformation

This would require a bit of calculus and Ill just do it tomorrow, its getting late and I didnt want to leave you hanging for too long

I would also consider moving this to DMs cause we’re kinda just clogging the public devforum with our dialogue, unless you think people could join in and help

But yeah thats a somewhat decent amount of math for a day, dont let the bedbugs bite