[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Hi and pushing existing UserData from pointer
- From: Sam Roberts <vieuxtech@...>
- Date: Sun, 16 Aug 2009 10:21:36 -0700
On Sun, Aug 16, 2009 at 9:49 AM, Chris Camacho<c.camacho@ntlworld.com> wrote:
> does actually work! I'm getting userdata of the appropriate
> type and if I add an impulse to the colliding shape the correct
> body moves so the above *must* be passing a userdata reference
> correctly, although what I suspect I'm doing is making a
> dummy user data with the pointer inside ???
no, lightuserdata and userdata are actually different value types in lua
> (This and some other "types" I'm going to remove from the
> lua GC, in any case as it make more sense to pass back these
> objects back to the library when you want to remove them
> from the simulation)
>
> Can you explain your method? can you provide a simple
> code example that shows your technique working?
See:
http://www.lua.org/pil/28.5.html
Pay special attention to the "weak" tables ref at end of the page,
weak tables are also described in the book.
Cheers,
Sam