06-10-2015, 09:06 PM
Firstly, I am only speaking from a Lua developer point of view. I don't know if there's any technical limitations to what is being suggested in the rest of this post.
So, 3 Vector3 types are exposed in the Lua API. Vector3i, Vector3f, and Vector3d
These each represent a Vector3 with different number data types. As far as being exposed to the Lua API, I think this isn't a good choice.
On the programmer side of Lua, you can see that messing with number data types really isn't a thing in Lua. This is because Lua has always interpreted these data types for us. The design allows us to not care too much about it. Having 3 Vector3 classes that accept different data types kind of defeats the original design.
Ideally, on a plugin developers perspective, having a single Vector3 class and then the data types being interpreted elsewhere would be a more clean and better design choice if this is possible. This increases simplicity to the plugin developer and should ideally still keep the optimization of having the proper data types.
So, 3 Vector3 types are exposed in the Lua API. Vector3i, Vector3f, and Vector3d
These each represent a Vector3 with different number data types. As far as being exposed to the Lua API, I think this isn't a good choice.
On the programmer side of Lua, you can see that messing with number data types really isn't a thing in Lua. This is because Lua has always interpreted these data types for us. The design allows us to not care too much about it. Having 3 Vector3 classes that accept different data types kind of defeats the original design.
Ideally, on a plugin developers perspective, having a single Vector3 class and then the data types being interpreted elsewhere would be a more clean and better design choice if this is possible. This increases simplicity to the plugin developer and should ideally still keep the optimization of having the proper data types.