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 / Revolutejoint limits

Author
Message
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 16th Jun 2012 20:15
Hi all,

I'm trying to emulate the behavior of the wheels of a car seen from above. I'm using two Revolutejoint (one for each wheel). The problem comes when I try to assign the limits of rotation of each joint, I do not know what I'm doing wrong, but I tried everything... setting the minimum and maximum angle in degrees, radians, in percentages... and I do not know how to have a range of -35 to 35 degrees at each joint to the center of the car.
When the turn reach the minimum angle (pressing left key) the wheel becomes crazy!
Anyone know what I'm doing wrong?

Here's the code:



Thanks in advance!
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 16th Jun 2012 20:45 Edited at: 16th Jun 2012 20:46
Quote: "reach the minimum angle (pressing left key) the wheel becomes crazy"

that's because you created a limit. set your limit to off. so the wheel keeps rolling.

BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 17th Jun 2012 10:43
Thanks for the reply, basjak.
But if I set off the limit I could turn freely the wheels...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Jun 2012 15:31
You could leave the wheels free and manually set the angle of the sprite based on the angle of the car. That might be easier.

IE:
setSpriteAngle(wheel1,getSpriteAngle(car)+turnangle#)

BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 17th Jun 2012 19:09
Quote: "
You could leave the wheels free and manually set the angle of the sprite based on the angle of the car. That might be easier.

IE:
setSpriteAngle(wheel1,getSpriteAngle(car)+turnangle#)
"


Thanks, baxslash.
It's a good system a works really well. I don't know if the mistake with the limits is mine (surelly) or is a setjointlimiton bug.
Unfortunately the behavior I got emulating a vehicle is not realistic, but not because of this problem.
Anybody knows where can I find any reallistic top down vehicle emulation (I saw some of the done in Java with Box2d but are really hard to translate to AGK)?

Thanks!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Jun 2012 11:06
I saw a really good Java version too a while ago. It's not a terribly complicated system but I haven't seen an AppGameKit version yet...

I might try doing one for an AppGameKit Bitesize tutorial when I get time.

BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 18th Jun 2012 17:32
Quote: "
I saw a really good Java version too a while ago. It's not a terribly complicated system but I haven't seen an AppGameKit version yet...
I might try doing one for an AppGameKit Bitesize tutorial when I get time.
 "


Baxslash, a Bitesize showing how to emulate the topdown car mechanisms would be great, I'll look for it!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Jun 2012 19:06
No need. I had a feeling I'd tested this and look what I found:


You're most welcome

BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 18th Jun 2012 19:42
Oh, God!
This is EXACTLY what I was looking for!!
What kind on licence do it have? can I use it in my game (giving you credits, of course)?

Thanks, baxslash!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Jun 2012 20:26
Just use it no worries

Login to post a reply

Server time is: 2024-11-23 17:13:10
Your offset time is: 2024-11-23 17:13:10