Alexar's Physics Editor(APE)
Re: Alexar's Physics Editor(APE)
all created by the editor, no code needed.
Re: Alexar's Physics Editor(APE)
Ever think of putting the following in your library?
Then in main.lua you could do:
Just an idea.
Code: Select all
-- note: following requires that 'world' be global
function helper.newBox( t, x, y, w, h, d ) -- type, location, size [,density]
local d = d or 1
local box = love.physic.newBody( world, x, y, t )
local shape = love.physic.newRectangleShape( w, h )
local fixture = love.physic.newFixture( box, shape, d ) -- density
return box
end
function helper.newCircle( t, x, y, r, d ) -- type, location, radius [,density]
local d = d or 1
local circle = love.physic.newBody( world, x, y, t )
local shape = love.physic.newCircleShape( r )
local fixture = love.physic.newFixture( circle, shape, d )
return circle
end
function helper.newPolygon( t, x, y, v, d ) -- type, location, relative verts [,density]
local d = d or 1
local poly = love.physic.newBody( world, x, y, 'dynamic' )
local shape = love.physic.newPolygonShape( unpack( v ) )
local fixture = love.physic.newFixture( poly, shape, d )
return poly
end
function helper.newLine( t, x, y, ... ) -- type, location, relative verts [,density]
local d = d or 1
local body = love.physic.newBody( world, x, y, t )
local shape = love.physic.newChainShape( false, ... ) -- don't close line
local fixture = love.physic.newFixture( body, shape, d )
return body
end
Code: Select all
--------------------------- rope -----------------------------
local box = help.newBox( 'static', 400, 100, 35, 35 )
local circle = help.newCircle( 'dynamic', 400, 150, 20 )
love.physisc.newRopeJoint( box, circle, 400,100, 400,150, 100 )
Re: Alexar's Physics Editor(APE)
Thank you. but for now the helper works more for an Editor than for code. oh yes, we can use them in the script for bodies as shortcut.Ref wrote:Ever think of putting the following in your library?
Re: Alexar's Physics Editor(APE)
Alexar, in the gif, are you driving the car or is it the AI? Is the driving thing included in the .love in post #1?
Re: Alexar's Physics Editor(APE)
it uses keyboard control, all interaction functions are in body--userdata. click the wheel and look up the userdata tab, you can see the magic.Zireael wrote:Alexar, in the gif, are you driving the car or is it the AI? Is the driving thing included in the .love in post #1?
all the examples are in the tutorial project. just load the project and switch to the scene.
Re: Alexar's Physics Editor(APE)
I downloaded the .love from first post, and I get tons of "a body escaped Memoizer" errors when trying to test the topdown car example.
Also pressing "Help" in first menu causes a Lua error: bad argument #1 to utf8len (string expected, got table)
Also pressing "Help" in first menu causes a Lua error: bad argument #1 to utf8len (string expected, got table)
Re: Alexar's Physics Editor(APE)
euh, i will see. but you can find the source code in my git.Zireael wrote:I downloaded the .love from first post, and I get tons of "a body escaped Memoizer" errors when trying to test the topdown car example.
Also pressing "Help" in first menu causes a Lua error: bad argument #1 to utf8len (string expected, got table)
Re: Alexar's Physics Editor(APE)
Fond this problem in util.lua:
On Linux seems it should be (tested on Manjaro):
Code: Select all
function string.stripfilename(filename)
print(filename)
return string.match(filename, ".+\\([^\\]*%.%w+)$") -- *nix system
end
Code: Select all
function string.stripfilename(filename)
print(filename)
return string.match(filename, ".+/([^\\]*%.%w+)$") -- *nix system
end
Re: Alexar's Physics Editor(APE)
Tells me it can't load incompatible bytecode. Not that there should be any to begin with - I prefer being able to read and modify the source.
Just in case you didn't know: different Lua versions generate different bytecode and more often than not they're incompatible.
Just in case you didn't know: different Lua versions generate different bytecode and more often than not they're incompatible.
Re: Alexar's Physics Editor(APE)
please loop up the source code on my git. although, it's a mess.raidho36 wrote:Tells me it can't load incompatible bytecode. Not that there should be any to begin with - I prefer being able to read and modify the source.
Just in case you didn't know: different Lua versions generate different bytecode and more often than not they're incompatible.
Who is online
Users browsing this forum: No registered users and 0 guests