irrBullet raycast vehicle

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
BiggestSmile
Posts: 3
Joined: Fri Mar 07, 2014 2:29 pm

irrBullet raycast vehicle

Post by BiggestSmile »

Hello folks. I'm rather new to both irrlicht and bullet and having some troubles setting up raycast vehicle properply.
Found video showing something similar i want to achieve, i mean idea behind the game: https://www.youtube.com/watch?v=4rUGhlNCNho
Thanks to the author for uploading sources. Took them as a base. Actually did not change anything, just wanted to compile it and get something similar to what's shown on video.
But what i'm getting is kinda weird, meshes are getting rotated and vehicle moves to totally wrong direction, got no clue what could be wrong here actually, tried rotating meshes before exporting, but it's only getting much worse.
Wheels are created on correct joint positions.
Here's a video showing off my problem: https://www.youtube.com/watch?v=bUSx68U ... e=youtu.be

http://rghost.net/52888566 - binaries
http://rghost.net/52888602 - blender models
http://pastebin.com/cX6q2xbq - sources

Thanks in advance!
Last edited by BiggestSmile on Sat Mar 08, 2014 8:23 am, edited 2 times in total.
horvatha4
Posts: 12
Joined: Sun Feb 23, 2014 6:03 am
Location: Rheiland-Pfalz, Germany
Contact:

Re: irrBullet raycast vehicle

Post by horvatha4 »

Hi!
1.)"Unable to connect server rghost.net... "
2.) this is your code what running on the first video?
3.) belnder use right-handed Z-up cordinate-system, bullet use left-handed Y-up! It seems the car's chasis is turned 90 degree. So check it.
I export blend files to .x and this .x files will load the irrEngine. With this methode - I don't need care the turns and axles. I just hold the X direction. ;-)
Arpi
BiggestSmile
Posts: 3
Joined: Fri Mar 07, 2014 2:29 pm

Re: irrBullet raycast vehicle

Post by BiggestSmile »

Hello, thanks for a reply! :)
1. Rghost works fine for me, i'll reupload if won't manage to fix that
2. No, it's Jorge Rose's code and video
3. Oh, missed that.. thanks for pointing out
Also, forgot to mention that if i rotate chassis mesh around Y axis on 90 degrees it gets in right position but getting stuck and vehicle does not move.
Going to try to fix it, thanks again :)
Have a nice day.

Fast update: Blender does not seem to export bones to .x format, is that a common sense or there's a better exporter somewhere around?
So i was finally able to get clear with axis directions.. Using http://irrlicht.sourceforge.net/forum/v ... hp?t=21993 that scene node.
So what i have to do in that case, rotate meshes for bullet axes before exporting? That seems to be a hack way.. And as i mentioned if i rotate mesh node after loading, vehicle getting stuck and won't move..
So got it fixed by simply rotating meshes.. But everything is really weird for me.
http://i.imgur.com/0I78Jwc.png - chassis in blender
http://i.imgur.com/CEtqKmQ.png - wheel in blender
http://i.imgur.com/dL1kNGe.png - vehicle in irrlicht
Meshes look at totally different directions in blender, yet they look at the same direction in irrlicht. Ugh that's weird.. totally don't understand anything. But well, at least it's working as intended..
Would be nice if someone could explain situation with axes.
horvatha4
Posts: 12
Joined: Sun Feb 23, 2014 6:03 am
Location: Rheiland-Pfalz, Germany
Contact:

Re: irrBullet raycast vehicle

Post by horvatha4 »

Hi again!
In my previous post, I think, you must turn the modell and export again... not the scene in the program! Sorry I wrote too short!
Look the first two pic was you posted here and compare! The wheel's direction is +Y ! And the chasis? -X ! There is 90 degree difference ;-)
Blender does not seem to export bones to .x format, is that a common sense or there's a better exporter somewhere around?
I use blender's build-in exporter. I don't use bones so this is not important for me. Are you think you will need it?
Ugh that's weird.. totally don't understand anything. But well, at least it's working as intended..
Would be nice if someone could explain situation with axes.
There is no "magic". Learn Mathematics, read books, wiki and so on. ;-)
Good Luck!
Arpi
horvatha4
Posts: 12
Joined: Sun Feb 23, 2014 6:03 am
Location: Rheiland-Pfalz, Germany
Contact:

Re: irrBullet raycast vehicle

Post by horvatha4 »

BiggestSmile
Posts: 3
Joined: Fri Mar 07, 2014 2:29 pm

Re: irrBullet raycast vehicle

Post by BiggestSmile »

horvatha4 wrote: Look the first two pic was you posted here and compare! The wheel's direction is +Y ! And the chasis? -X ! There is 90 degree difference ;-)
Exactly what i mean. I have exported meshes at it's shown on first two screenshots -> it works fine in irrlicht(3-rd screenshot), but if i export them while facing the same direction in blender - they face different directions in irrlicht. That is actually magic or i'm missing something important about bullet raycast vehicle.
Thanks for help anyway! Currently checking code, maybe i've missed something there..
About bones, yes i do use them to set positions for constraints.

Got another question, don't want to create separate thread for it.
Is there a way to load one mesh file consisting of many objects and then create separate mesh\node in irrlicht for every object?
Post Reply