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 / Need help with joints

Author
Message
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 25th Feb 2012 10:23
I'm trying to figure out exactly what the different joints do by testing, but the joints just disappear after being created.

I've set up this function to test a joint when "m" is pressed on the keyboard. I added the delay to see if anything actually happens and while the program is sleeping for that second there is a joint but it's gone afterwards. I've tried different x-y values.



My hovercraft is full of eels
KareDev
12
Years of Service
User Offline
Joined: 6th Feb 2012
Location:
Posted: 25th Feb 2012 12:42
Wish I had a proper response to your problem, however, the only advice I can offer is that the documentation states that you should avoid using the "sleep" command for more than 1 frame. Could this be causing a problem with your test?
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 25th Feb 2012 12:47 Edited at: 25th Feb 2012 13:39
Yes the sleep was not originally in there but then I never even saw the joint, while sleep is active I can now actually see the joint with physicsdebugOn.


Edit:

I should add that the sprites being tested on are dynamic physics sprites that when the joint is made are resting at the bottom of the screen

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Feb 2012 14:30
Is the joint definitely gone? What happens if you move the sprites with a mouse joint?

lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 25th Feb 2012 15:49 Edited at: 25th Feb 2012 15:52
Yes it appears to be gone, the sprites move independently of eachother. Also the PhysicsDebugOn shows when there is a joint.

I wish "getJointExists()" ..existed

Baxslash, this is a continuation of my "magnetism" problems, I'm trying to determine which joint would be most appropriate, but can't even get a joint to survive save the weld joint

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Feb 2012 20:53
I'm fairly sure I'll be able to help if you can share more code. If you don't want to add it here then email me. I have been working a lot with joints recently and may very well see the problem.

I might be able to resolve your magnetism problem too, who knows

lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 25th Feb 2012 21:08
I will do so, I just have to clean up what I'm currently doing in there so you can actually run something. I've started a new try on magnetism that I'll disclose in an email

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Feb 2012 21:42
OK, I look forward to it

lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 6th Mar 2012 09:46
Did you perhaps get a chance to look at it bax? any input appreciated

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 6th Mar 2012 10:01
Hi, sorry yes I did but I've been a little distracted. I'll take another look and let you know. I forgot, sorry!

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 6th Mar 2012 10:52
Mind if I call you lil? Very neat and organised code. It was easy to follow and add to!

Here's a function I added to your code that works quite well (just call it from your main loop):


You could add to it by making triangles repel each other maybe...?

lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 6th Mar 2012 12:16
Thanks! I will try this a bit later

My hovercraft is full of eels

Login to post a reply

Server time is: 2024-05-07 11:00:18
Your offset time is: 2024-05-07 11:00:18