Hi all,
While I know about the bugbox for reporting bugs, I thought I would post this here so anyone who wants to can use my workaround in the meantime.
There are some inconsistencies in the way Fusion handles collisions on PC, and the way it handles them in the iOS exporter.
1.) When using box (non-fine) collision detection on PC, you can still rotate the objects, and collisions will be handled between the two rotated bounding boxes. However, in the iOS exporter, a big imaginary axis-aligned box is drawn around the rotated object and that is simply used for collision detection (it does not handle rotated bounding boxes).
2.) When doing fine vs. box or box vs. fine on PC, fine collision detection still works. It just tests the bounding box of the box object against the mask of the fine object. However, the iOS exporter doesn't have this capability; it simply assumes both objects are boxes if either of them don't use fine detection.
These bugs can be most easily seen in Please login to see this link.. Run it on PC, and hold down the mouse button to rotate. Then run it on iOS, and see how different it looks.
Since this was messing up my current game, and I didn't want to wait for Clickteam, I fixed these problems myself. I implemented collision detection between angled boxes using the Separating Axis Theorem, which is also used as an easy-out for fine collision detection, meaning the performance of pure rotated fine collision detection has been improved as well (it definitely helped my game run smoother).
To implement the fix, after exporting your project, merge the files inside the attached Please login to see this attachment. into your Xcode project, which will replace the files RunLoop/CRun.m and Sprites/CMask.m with my patched files.
One note: my changes all have the text CHANGED BY SEB in comments near them, if you want to integrate my code into some other version.
It's worth noting that, when I turned on fine vs box collision detection in CRun.m, I exposed a serious bug in Clickteam's CMask::testRect routine which was causing it to not test enough mask indices, resulting in detection failure in certain situations. Since fine vs box collision was not possible with Actives until I added my code, I think the only way to experience this bug previously would have been with very specific Active vs. Background collisions. You can see this bug in action if you compare the behavior of Please login to see this link. on PC vs its behavior on iOS (tap the diamonds to nudge the object onto the left edge of the block, then go right). Note that you can only see this bug if you implement my fix for CRun.m, but not my fix for CMask.m.
I'll submit this to the bugbox and hopefully Clickteam will fix it in a future release. All really they have to do is pull my changes. ***DISCLAIMER*** while I did my best to debug, this code comes without warranty. I didn't test it extensively --- that's Clickteam's job.
Also, one side note, I am almost always available for freelance I'm an ex-Disney engineer and one of the best coders around. I also made Please login to see this link., one of the most widely used Fusion extensions around. Easiest way to reach me is to email admin at ultimatewalrus.com since I don't check these forums that often.