[Qt-interest] [SOLVED] Re: Howto Do `hit Test' with QGraphicsItems ?

Aaron Lewis aaron.lewis1989 at gmail.com
Sat May 8 05:20:44 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/06/2010 03:55 PM, Andre Somers wrote:

>> Is that a good way for doing this ?
>>    
> Sounds ok to me. Do you run into issues if you check the 
> collidingItems() method of the graphicsItem that represents your sprite?


Exactly ,Player is a QGraphicsItem actually , so I just check if it will
collide with any other items.

But in this way , it's not able to do `predicts' , you can't know before
you hit an Object.

So after doing some researches , i decided to set up some rules of the
position of my Object , which will be easy for me to get their fixed
position on a map.

Then use QGraphicsItem::contains() method to check the player against
all of the rest.


Thanks Andre.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvk2IwACgkQvf41sEptMqBdQACZAdwM90SzjCTZFCNpYSeWa65k
9QcAn3Y0RWt1W1QymUH1LP+pXuIlwPdL
=mTYK
-----END PGP SIGNATURE-----



More information about the Qt-interest-old mailing list