Following my previous question, I am wondering how one can achieve the same effect under Unity?
The effect in action
Description of the effect
When you fire the Quake Disruptor weapon, it creates a sine wave that mimics an earth quake, it happens over the next track sections forward to the player ship as you can see on the small video. This results in instant-damage and slowdown to the ships that are caught in the quake.
Deforming the mesh
The function for generating a quake-like wave to apply to each section of the track mesh is easy, e.g. a Gaussian filter will probably be good enough:
Applying the deformation to mesh
This is where it starts to get trickier, a track is made out of sections that have few faces, each face being nothing more than a quad.
Here you can see three sections and their faces (wall, track, track, wall):
The challenge in here is how to apply the deformation and yet being able to check collisions against the track (remember that we can't use a mesh collider since it'll be updated in real-time).
I first thought that subdividing the mesh using tessellation would be needed to apply smooth deformations, hence my previous question. However, if you look closely at the video they simply move either edge of faces according to where they're against the 'quake' function being applied to the track mesh.
Here's a link to a video with the best quality, around 13 mins 10 secs:
We're getting closer but we still need to be able to check for collisions.
Being able to still collide against the track
This is the big question mark, since we cannot update a mesh collider in real-time as it's a CPU hog, I really have no idea on how to address this part of the problem.
This also leads to another problem, since we cannot use a mesh collider, how are physics are going to be handled, by writing a physics system from scratch ?
How can such effect be achieved under Unity, if possible at all?
PS You will want to remember that the PS1 had a 33Mhz CPU and certainly no mesh collider like the one we can find in Unity, yet they achieved to do it. For sure there is a trick involved but I couldn't figure it out.