luabind
Bind function returning btVector3 with luabind
I'm trying to bind class using btVector3. Binding btVector3 with constructor works fine. Binding functions like: void SetPosition(const btVector3& position) works fine, but binding this: btVector3 GetPosition() gives me following error: error C2719: 'unnamed-parameter': formal parameter with __declspec(align('16')) won't be aligned I understand that btVector3 is aligned, how to fix/workaround this?
Dunno if it's the exact same problem (and if it's still relevant to you, almost two months on), but I was having trouble binding Bullet btTransforms using Luabind. For instance, this gave the same error you described: void bindBtTransform(lua_State *L) { luabind::module(L) [ luabind::class_<btTransform>("btTransform") // constructors .def(luabind::constructor<>()) // methods // INCORRECT ------------------------------------------------------- .def("getOrigin", &btTransform::getOrigin) ]; return; } However, when I gave the full signature of the getOrigin() function, it worked: void bindBtTransform(lua_State *L) { luabind::module(L) [ luabind::class_<btTransform>("btTransform") // constructors .def(luabind::constructor<>()) // methods // CHANGE TO THIS------------------------------------------------- .def("getOrigin", (const btVector3& (btTransform::*)() const)&btTransform::getOrigin) ]; return; } Hope that works for you; my problems cleared right up when I made the change. I'm still getting the error now, but only when I define the multiplication operator for btQuaternions. I'm hoping it's a similar fix.
Related Links
Luabind pure_out_value refuses to compile
Bind function returning btVector3 with luabind
how to bind a functor with more than one argument to lua using luabind
lua-function as parameter for exported function