Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] SetSpriteShape crash.

Author
Message
JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 13th Apr 2017 10:34
I'm getting a strange crash on iOS, MAC & HTML5, but works fine in windows.

I think I've tracked it down to the SetSpriteShape function. I get the following error for the HTML5 version, but Mac & iOS just crashed out.

uncaught exception: Assertion failed: area > 1.1920928955078125e-07F, at: common/Box2D/Collision/Shapes/b2PolygonShape.cpp,115,ComputeCentroid at jsStackTrace@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:39146 stackTrace@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:39329 ___assert_fail@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:246887 WY@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:6:1 gk@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:4:1 Ly@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:8:1 _h@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:14:1 bi@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:14:1 Th@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:14:1 eRa@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:16:1 invoke_ii@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:313076 yh@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:14:1 Ug@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:14:1 PRa@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.asm.js:16:1 Runtime.dynCall@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:27641 Browser_mainLoop_runner/<@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:121515 Browser.mainLoop.runIter@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:123053 Browser_mainLoop_runner@file:///C:/Users/Jon/Dropbox/Fatleg/Trionix/Verision%201.5/HTML52/AGKPlayer.js:1:121411

I noticed that as I changed the animations for an individual sprite that the collision shape was not being reset properly, so I had to use SetSpriteShape again to set the correct collision shape.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Apr 2017 15:47
This could happen if the polygon shape has zero area, which would depend on the image it is trying to create a collision shape for. The image has to have some non-transparent pixels for the polygon shape to work.
JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 13th Apr 2017 16:09
I just tried removing a tween that was scaling the sprite to zero and the crash stopped. I guess this is weird behaviour.

Login to post a reply

Server time is: 2024-11-17 18:19:07
Your offset time is: 2024-11-17 18:19:07