ËNVY (LÖVE Framework)
Re: ËNVY (LÖVE Framework)
Cool, and this one has Wrath version that really works!
Re: ËNVY (LÖVE Framework)
Hey Kudomiku, I just came across a problem with doing maths on a shape's points. And since the getPoints() function returns a stack rather than a table I wrote a small util function:
If you wonder why I wrote this, you asked for shadows huh.. I'm writing a shadow "engine" based on this article:
http://www.gamedev.net/reference/articl ... le2032.asp
[Edit]
Check this: http://love2d.org/forum/viewtopic.php?f ... 2850#p2850
Code: Select all
local function getShapeTable( ... )
local result = {}
for i = 0, ( math.floor( #arg / 2 ) - 1 ) do
local x = arg[i*2 + 1] or 0
local y = arg[i*2 + 2] or 0
result[i+1] = envy.vector:new( x, y )
end
return result
end
function envy.entity.class:getShapeTable()
return getShapeTable( self:getShape():getPoints() )
end
function envy.entities.class:getEdges()
local points = self:getShapeTable()
local result = {}
for i = 1, #points do
local cp = points[ i ]
local np = points[i + 1] or points[ 1 ]
local vec = ( np - cp )
local normal = envy.vector:newFromAngle( vec:angle() + 90 )
result[i] = { origin = cp, vector = vec, normal = normal }
end
return result
end
http://www.gamedev.net/reference/articl ... le2032.asp
[Edit]
Check this: http://love2d.org/forum/viewtopic.php?f ... 2850#p2850
Re: ËNVY (LÖVE Framework)
Oh my! I was reading that SAME article, I was going to do it too.
But as you're doing it I'll leave it to you.
Mind if I add that function to ËNVY's util library (credit to you, of course).
But as you're doing it I'll leave it to you.
Mind if I add that function to ËNVY's util library (credit to you, of course).
Re: ËNVY (LÖVE Framework)
Sure, but it's a little more than just utility functions, it needs further implementation. You basically have to add all shapes and remove em before they get removed. Dunno, we'll find a good solution
I'll add a quick and nasty quadtree thingy to speedup shadow-ray-collision-detection, so you can set the shadow's alpha which makes it look a little better.
I'll add a quick and nasty quadtree thingy to speedup shadow-ray-collision-detection, so you can set the shadow's alpha which makes it look a little better.
Re: ËNVY (LÖVE Framework)
Yeah, add me to Steam Friends, spec_soldier so we can discuss this
I'd love to work with you on some things, you're clearly a guy who knows what he's doing
I'd love to work with you on some things, you're clearly a guy who knows what he's doing
Re: ËNVY (LÖVE Framework)
Will add you when I'm home later today, here's another vector function that could come in handy:
If you just want to rotate something
Code: Select all
function envy.vector.class:rotate( angle )
angle = math.rad( angle )
local ca = math.cos( angle )
local sa = math.sin( angle )
return envy.vector:new( ( self.x * ca - self.y * sa ), ( self.x * sa + self.y * ca ) )
end
Re: ËNVY (LÖVE Framework)
Thank ye.
Re: ËNVY (LÖVE Framework)
Wait, isn't that just like rotateAround?
Re: ËNVY (LÖVE Framework)
Kinda, but I can't be arsed to define a null vector just to rotate something
Re: ËNVY (LÖVE Framework)
Interesting, I could always make it an optional argument?
Who is online
Users browsing this forum: No registered users and 0 guests