Change vertex normals on collision
Hello Internet,
I want to change the floor's vertex normals' direction as the ball is rolling on the floor. I just need some direction on how to achieve this.
So far this is the direction that I'm heading:
Make a copy of all the vertex normals of the floor on start.
On collision get the contact point and raycast/spherecast/boxcast to get the affected vertices. (Set variable offset to control how much vertices I want to be affected by the casting)
Rotate the affected normals parrallel to the ball's closest surface point.
As ball moves away from affected's floor's vertices, slowly return the floor normals back to original direction. (Set a variable to control the movement speed of the normal's rotating back to original direction)
I just need help figuring out which type of casting to use and how to rotate the normals parallel to the ball's surface. This is for a mobile platform so performance is a must.
Thanks in advance.
Your answer
Follow this Question
Related Questions
Unity shader vertex displace doesn't work 0 Answers
Procedural mesh shader problem 0 Answers
Rotate an Object to align to a specified Vertex. 0 Answers
How do I do a spherecast/boxcast/whatever but have the radius increase proportionally with distance? 1 Answer
Change vertex position not working? 2 Answers