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

Categories

HOME
httparty
fabricjs
formal-languages
swt
socket.io
owl-carousel
google-cloud-functions
mips
hugo
interpolation
frontend
pkcs#11
text-mining
plist
symbol
standards
vuejs
identity-management
nodemcu
enterprise-miner
googlebot
springfox
draft-js-plugins
data.stackexchange.com
slidetoggle
asymptotic-complexity
delimiter
eviews
xbox
postback
paragraph
android-gridview
sammy.js
biztalk-rule-engine
contacts
least-squares
news
stringtokenizer
laravel-elixir
parser-generator
softmax
photos
clarifai
robomongo
semantic-logging
yii2-user
oracleclient
janus
javafx-css
gets
chromium-os
flex-monkey
seek
adafruit
uicolor
stream-processing
project-organization
turbo-prolog
upx
nullable
qbxml
directdraw
concurrentmodification
terracotta
iced-coffeescript
sonarqube-5.0
teaspoon
machine-instruction
with-statement
kissfft
verold
gnumeric
spring-remoting
vsx
syndicationfeed
ie8-compatibility-mode
unit-of-work
bjyauthorize
booksleeve
intersect
patricia-trie
dajaxice
thttpd
failing-tests
gobject-introspection
android-holo-everywhere
winmain
webdev.webserver
rmdir
massive
cdonts
mtu
maven-1
nstokenfield
qtabbar
java1.4
information-management
online-storage

Resources

Encrypt Message