Not at all, thanks.
Referencing object functions?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Referencing object functions?
I'm not sure why you need Body_getPosition, but if you only need a semantically equivalent function, you can use a simple wrapper:
Code: Select all
local function Body_getPosition(body)
return body:getPosition()
end
Re: Referencing object functions?
I'm porting a game that uses a slightly different API for Box2D so it's kind of useful to add/modify the functions for Bodies,Joints, etc.
Like for example, contact:getOther is quite useful but love.physics doesn't include that function.
Also, with the getregistry technique, you can get a direct reference to the functions, (circumventing metatables), which is x0.85 faster in LuaJIT and considerably faster than plain Lua.
Not a big deal but might come in handy if you like to squeeze every last drop of performance.
Like for example, contact:getOther is quite useful but love.physics doesn't include that function.
Also, with the getregistry technique, you can get a direct reference to the functions, (circumventing metatables), which is x0.85 faster in LuaJIT and considerably faster than plain Lua.
Not a big deal but might come in handy if you like to squeeze every last drop of performance.
Who is online
Users browsing this forum: No registered users and 1 guest