lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Sam Roberts wrote:

no, lightuserdata and userdata are actually different value types in lua
I know, but how can I be using methods of "cpShape" of the returned
userdata, if its lightuserdata..?

how can it still have the same metatable as other lightuserdata

....
  lua_pushlightuserdata(d, a);
  luaL_getmetatable(d, "cpShape");
lua_setmetatable(d, -2); -- <----- so now the lightuserdata has a different metatable what is it!
....
   eventually pushright is called with lua_pcall



function pushright(a,b)
  bdy=a:getBody()  --  <--- lightuserdata executing getBody ???
bdy:applyImpulse(cpVect.new(20000,0),cpVect.new()) -- <--- correct body returned from lightuserdata ??? how?



Best
Chris



--
Disclaimer:
By sending an email to ANY of my addresses you are agreeing that:

  1. I am by definition, "the intended recipient"

  2. All information in the email is mine to do with as I see fit and
make such financial profit, political mileage, or good joke as it lends
itself to. In particular, I may quote it where I please.

  3. I may take the contents as representing the views of your company.

  4. This overrides any disclaimer or statement of confidentiality that
may be included on your message.