Has Contact:getSeparation() been removed from LÖVE 0.8.0?
It's still in the documentation at https://www.love2d.org/wiki/Contact:getSeparation, but whenever I call it on a Contact returned inside the love.physics callbacks I get the error "attempt to call method 'getSeparation' (a nil value)". Contact:getFriction() works fine and can be found in the LÖVE src. References to Contact:getSeparation was not found in the LÖVE src.
If this was pulled from LÖVE 0.8.0, what's the recommended approach to getting distance between colliders now? love.physics.getDistance(...)?
I've been lurking for about a year now, finding answers to every problem I encounter already answered in the forums or docs. Great/Fun game engine, great community! I hate for this to be the first question I ask on the forums, but ... there it is.
Here's a sneak peak at what I'm working on, in case an offering is required for first-timers ...
[SOLVED] LÖVE 0.8.0 Contact:getSeparation() ?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[SOLVED] LÖVE 0.8.0 Contact:getSeparation() ?
Last edited by yared0319 on Tue Mar 12, 2013 4:36 pm, edited 2 times in total.
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: LÖVE 0.8.0 Contact:getSeparation() ?
Um, how about plain-old pythagorean theorem? dist = sqrt(distX^2 + distY^2)?
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
Re: LÖVE 0.8.0 Contact:getSeparation() ?
Maybe use Contact:getPositions and then do what substitute541 said, where distX = x1 - x2, distY = y1 - y2.
Re: LÖVE 0.8.0 Contact:getSeparation() ?
Ok, that's fine, I can do that. Was just going to offer to update the wiki, but someone beat me to it! Thanks!
Who is online
Users browsing this forum: Google [Bot] and 2 guests