Re: Vectors

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Vectors

Luiz Henrique de Figueiredo
>From [hidden email] Mon Jun 22 14:24:50 1998
>
>Hi I'm attempting to add a 3D vector class to Lua and I wondered if anyone
>had any thoughts on the matter. What would be the most efficient manner?
>(ie. fastest).

Lua is fast, but the fastest way is to write it in C.

>Can I use tags to overload the arithmetic operators. eg.
>vec3= vec1 + vec2 ?

yes, that would be the most elegant way.

>Be something like: struct _vector3 { float x,y,z; };

do you want to operate on C structs or on Lua tables?
--lhf