lua-users home
lua-l archive

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


> 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). Can I use tags to overload the arithmetic operators. eg.
> vec3= vec1 + vec2 ?
> 
> Be something like: struct _vector3 { float x,y,z; };

I would sugest you to write in C and then 
bind the class and its methods to Lua.

"toLua" may help you on it
(http://www.tecgraf.puc-rio.br/~celes/tolua/tolua.html).

-- waldemar