I am trying to make a destruction physics system
the method i am attempting is shown below through the diagram:
(NOTE: We are going to ignore the welding part of this system for the sake of keeping this
post concise)
the “impact” is represented as a red circle on the wall. The idea is that the wall is then split into 5 parts.
Sadly my highschool diploma only allows me to find the size and position of the “fragments” on a 2 dimensional level, meaning that if the wall is not perfectly aligned with the world, everything breaks.
So far ive managed to do one thing which is to find how far out from the center the “impact” is located by substracting the positions of the center of the part (i’ve already compensated for the fact the part isn’t a flat piece of paper) to the position of the impact. In a 2d environment i can simply decompose the vector and add half the size of the wall itself and the impact zone (2 pieces of data i already have). The problem is that the vector i obtain is rotated according to the world and not the part itself. In summary, i just need some help finding a way to turn this three dimensional vector into a two dimensional one relative to the part.