My engine needs control over matrices but if I pass a pointer it will create a new matrix every time I multiply it. So I need to push the actual matrix but I don't know how to push an array on to the stack.
Any ideas? Do I push each element of it?
How to pass a matrix to lua?
Moderator: Coders of Rage
- unholysavagery
- Chaos Rift Cool Newbie
- Posts: 73
- Joined: Tue Oct 28, 2008 4:27 am
How to pass a matrix to lua?
This is the internet, men are men, women are men and children are the FBI.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: How to pass a matrix to lua?
Yeah, you're going to have to use some sort of 2-layer loop if you're pushing and popping from the stack. I would recommend doing something like pass by reference, but I'm not good enough at working with raw Lua userdata without going through toLua++ to say anything on the matter.