(12-02-2013, 05:07 AM)STR_Warrior Wrote: Would that not be fixed if we change [...]No, that wouldn't probably even compile in C++, and even if it did, it would leak memory - there's no way to tell lua to take ownership of the object; and now everytime the C++ code queries entity's position, it makes a copy, thus putting quite a strain on the memory allocator.
It could be fixed by declaring
Vector3d GetPosition(void) const { return m_Position; }This makes a copy and Lua / ToLua++ *might* know how to handle these. But it would still hurt the performance for C++ code.