#💬 eyeballʹs Feedback

1 messages · Page 1 of 1 (latest)

craggy fossilBOT
thorny igloo
#

This is insane, could you walk my small brain through how it works?

simple wasp
#

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 spanishkek

#

@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

thorny igloo
#

That makes a lot more sense. Thank you!

nova crest
#

@simple wasp why did this take 6 hours

#

how did it take 6 horus

simple wasp
#

type checking ruined my day

nova crest
#

you dont need type checking

#

dont overcomplicate

#

keep it simple- use type checking as little as possible, its not essential for making just about anything in lua

#

@simple wasp

#

imean lua dont even need typechecking yet people are making much more complicated things in it

simple wasp
#

I was well aware of the potential issues

#

I was doing this for fun