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 / Checking the existence of a joint...

Author
Message
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 24th Apr 2012 03:47
I've run into a problem with joints.

The documentation says that a joint may be deleted by the system if any of the sprites it's connecting are deleted.

It also says that joints should be deleted before the sprites they connect.

Now lets take an example where you have some sprites that are deleted by your program in an explosion, which are connected by a joint. Subsequently the system deletes that joint when the sprites are deleted.

Now lets add to the example that as a a secondary way of joint deletion within the same program, you are checking the joint reaction forces of all the joints you've created to simulate breaking and then processing them for deletion.

The problem is, since there is no way to check the existence of a joint, if you try to return the reaction forces being applied to a joint that was automatically deleted by the system, the program throws an error.

Now I could go and store the values of the indexes of every sprite connected to a joint, and check to see if those sprites still exist, and if they don't then assume the joint is deleted and not try to return any values. Which in theory sounds simple, but the numbers of connected sprites can change dynamically etc etc..

It ends up being like killing a fly with a sledgehammer when I could get the same result with one simple command.

So I'm wondering if we'll be seeing a GetJointExists(JointIndex) command?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Apr 2012 03:55
A good point, I'm not sure why that command doesn't exist. Added.
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 24th Apr 2012 04:59
Thanks Paul!
polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 24th Apr 2012 09:20
Now that's what I call service Paul,

Blackberry App Development & ZX Spectrum Game Development.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Apr 2012 11:33
While you're around Paul what about getSpriteGroup()?

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Apr 2012 18:02
Quote: "what about getSpriteGroup()?"


Easy enough, done.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Apr 2012 19:58
Yay!

Login to post a reply

Server time is: 2024-05-04 20:08:58
Your offset time is: 2024-05-04 20:08:58