Page 1 of 1

Physics trouble

Posted: Fri Mar 05, 2010 12:14 am
by C++arl
Hi all,
I'm new to the forums and to LÖVE, so bear with me on this one. So I'm trying out the API and have done some progress but two falling boxes have gotten the best of me so far. The trouble is that they dont seem to fall quiet as you would expect them to do, have a look at this image which explains the problem better:

Image

As you can see the boxes are stuck in an unnatural way, and i dont know why so if some experienced fella would like to give a helping hand it would be greatly appreciated. I have attached the .love package aswell so you can see what I meen by yourselfs, code and pics and all is in there ofc.

Thx
~~Carl
:megagrin:

Re: Physics trouble

Posted: Sat Mar 06, 2010 1:08 am
by treeturtle
yeah i have no clue how to fix that, but i know how to bump!

bump

Re: Physics trouble

Posted: Sat Mar 06, 2010 8:50 am
by Robin
I tried it, but had no such problem.

Re: Physics trouble

Posted: Sat Mar 06, 2010 9:48 am
by pekka
The bounding box cannot be used to tell how big a physics objects is. It is an axis-aligned bounding box and thus can change size when the object rotates to different angles. It does remain a constant size when your object is a circle, though. What is basically means is the smallest rectangle with sides that align with x and y coordinate axes that can be drawn around the particular object.

You should store the image sizes somewhere for the drawShapeImage function to use, instead of trying to calculate them from the bounding box.

Re: Physics trouble

Posted: Sat Mar 06, 2010 8:49 pm
by C++arl
Aha okay, i see how it works now. Very cool, works swell now, thank you all! :ultraglee: