Closed lpberg closed 10 years ago
OK, so the initial issue is that premult with matrices modifies, rather than returning the result - see this help info
void preMult([IN] Matrixd x)
So, in the first one, local world_pose is void
:
result = RelativeTo.World:getInverseMatrix():preMult(forklift.Matrix)
help(result)
-- Help:
-- class = void
Which is obviously not a valid value to be setting for a Matrix property. That said, it shouldn't crash (but rather error out), but it does.
It must be specific to void, since other wrong-type assignments just error: (ugly error, but it's inside osgIntrospection)
MatrixTransform{}.Matrix = osg.Group()
-- vrjLua ERROR: Could not run provided Lua string. Lua returned this error message: [string "MatrixTransform{}.Matrix = osg.Group()"]:1: [/home/rpavlik/src/vr-jugglua/third-party/osgLua/src/osgLua/Value_metamethod_members.cpp:197] cannot convert from type `PN3osg5GroupE' to type `const N3osg7MatrixdE &'
The matrix method makeIdentity also returns void. Thus, we can simplify the testcase further (and this will actually run in the command line, not just in the navtestbed):
osg.MatrixTransform().Matrix = osg.Matrixd():makeIdentity()
It's crashing inside of osgIntrospection, in convertArgument<osg::Matrixd const&>
(line 42 in Utility
)
So, a couple issues here:
This code crashes:
This code doesn't:
The
local world_pose
line is key here - removing it (and updating the setting line) doesn't crash.