#💬 eyeballʹs Feedback
1 messages · Page 1 of 1 (latest)
This is insane, could you walk my small brain through how it works?
Well
The constructor function new creates a table called Data which has all the data for the vector3. It also has a bunch of metamethods. It then returns an empty table with the metatable being Data
The metamethods alter the behavior of the empty table that was returned
allowing you to use + - * / on it
the logic for what happens when those are used are seen in the functions Data_add, Data_sub, Data_mul, Data_div
It returns an empty table rather than the Data table so that when you index properties in Data on the empty table returned, it accesses them from Data rather than the empty table. The logic for that is in Data_index
and you can't change the table because of the Data_newindex function which causes it to error instead of set a property, just like with regular Vector3s
the functions Lerp, Dot, Cross, Max, and Min are also added to the Data table so that when they are indexed they can be called as well
And the math for them is pretty simple so I was able to learn how they worked in a like half an hour
although I forgot the formula for Cross already 
@thorny igloo I didn't go into to much detail, if you want specifics just ask about something and I'll try to explain it
That makes a lot more sense. Thank you!
type checking ruined my day