Collision detection with zoomed/rotated Sprite3D

Advanced game related topics
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Collision detection with zoomed/rotated Sprite3D

Post by Fluid Byte »

I know that PB's sprite collision works for Sprite3D as well but what if they are zoomed or rotated?

Do I need to write my own collision detection?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: Collision detection with zoomed/rotated Sprite3D

Post by Thorium »

Fluid Byte wrote: Do I need to write my own collision detection?
Yes.
Maybe we can team up on that if you have pixel collision in mind.
I am currently working on a "proof of concept" for a very fast pixel collision test. It works with collision maps. For rotation, zoom, etc. the collision maps would need to be rotated, zoomed, etc.
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: Collision detection with zoomed/rotated Sprite3D

Post by mpz »

Hi Thorium,

at first you can make a rotated, zoomed, etc. collision map. The second step is to make a collsions detection. The follwing code helped my very much for my collision detection. Perhaps you can make it faster with a ASM code :mrgreen: .

www.gamedev.net/reference/articles/article735.asp
http://creators.xna.com/en-GB/tutorial/ ... 2dperpixel

best regards
Michael
Working on - MP3D Library - PB 5.73 version ready for download
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: Collision detection with zoomed/rotated Sprite3D

Post by Thorium »

mpz wrote:Perhaps you can make it faster with a ASM code :mrgreen: .
Yes. In fact a lot faster.
I allready have coded it without rotation and zoom. But it am currently on debugging it because it does not work correctly. But thats just a matter of mistakes i did, the system works very well.

It does not test pixel by pixel. It generates a collision map in which 1 bit represents 1 pixel. That allowes to test multiple pixels with just one compare. The goal is to test 128 pixel at once using the XMM register. However i just did the prototype in PB code. Once it's working i am rewriting it in asm and use the XMM register.
Post Reply