lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>From 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?