You wake up in a room with padded walls …
Imagine a 1 meter block colliding with a large wall in Unity. They both have typical say metal-like PhysicMaterials.
In this example, picture SLOW movement and collisions. (Like the spacecraft floating around in 2001…)
Obviously, nothing happens until the moment something touches, and then PhysX correctly provides I suppose
That’s all great … Now imagine if both objects were covered in padding, say about 5 cm or 10 cm thick.
The collision would be quite different (I think??!) - sort of squidgy, slowing down after the padding started to interact.
Has anyone done this. or can think of a good approach, or does it exist already?
My only idea was to: add a manually force field that extends 5+5 = 10 cm from the wall in the example, and ends abruptly. (I guess, implement this simply with yet another collider, as a trigger). Inside that “quantum of rubber padding” I guess you would just simply add a fixed force pushing the cube away {questions arising, would it vary with distance, or not even - how do padded walls behave?}. I suppose, it would slow it down more on the way in and speed it up more on the way out.
An extreme example - imagine throwing a ball towards a very powerful fan blowing air. That would eventually stop the ball and push it away - a kind of a bounce. I suppose, that’s sort of like the solution I describe.
Or, would it be best to use the mechanism I describe, just alone without a normal collision?
Or .???
I was also thinking, is it essentially a matter of “delaying” collision. The object comes in, PhysX does everything normally, but it “hangs in space” for a few beats before firing off in the other direction. In fact, does that achieve the right feel?
Furthermore – in fact, DOES PhysX currently do what I describe? Q, does PX wait until the moment of contact (allowing for the penetration values etc) to apply forces, or, does it start doing them when they cross some threshold and apply them over a small distance? I guess this knowledge would be critical to the issue I am asking about. (if you simply tuned that range to be bigger, that would presumably exactly achieve what I am describing.)
I also thought about arranging it so that the wall is actually a big thing which is spring’d to a real wall behind! Will springs work like that in PhysX, ie, something hitting or perhaps sitting on a object, which has a spring connection, will in fact “work” that spring? forces and events carry through to springs?
thanks for any ideas !