I'm testing some things out with SWIG, trying to see what I can do with it and how. I've run into a problem I haven't been able to solve.

In my experiments to see what I can do, I have a class Vertex exposed to Lua, along with two constructors: Vertex() and Vertex( flaot, float, float ). These work just fine, but what I'd really like to be able to do is something like this in Lua:

local v = testing.Vertex( { 1.0, 2.0, 3.0 } )
local t = { 1.0, 2.0, 3.0 }
local v = testing.Vertex( t )

SWIG's documentation talks about automatic conversion of numeric tables to arrays, and I've seen in std_vector.i some functions that look like they should do that with std::vectors, but nothing I've tried has worked. I'm too new to SWIG to be sure how to set this up in the interface file, and to be honest, I'm not even real sure what parameter type the constructor should take. ( I'm guessing Vertex( float* ). ) I know how I'd do it exposing the class manually, using a lua_State* parameter and Lua's C API, but it looks like I should be able to do this with SWIG, and I just can't suss it out.

Thanks for any help you can provide.