Generic vehicle scene node with a simple editor

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Generic vehicle scene node with a simple editor

Post by smso »

Link:
http://code.google.com/p/irrcodes/downl ... e_node.zip

To compile
==========
Change parameters to point to the proper directories:

main.cpp:

Code: Select all

#define IRRLICHT_DIR "/home/smso/downloads/irrlicht/irrlicht-svn/"
makefile:

Code: Select all

IRRLICHT_DIR = /home/smso/downloads/irrlicht/irrlicht-svn

To start the editor
===================
Run:
./r


Use of the editor
=================
1. Load a body mesh in the scene.
2. Change the body rotation so that it is in the z-direction (as indicated by the blue line).
3. Load a tire mesh.
4. Roughly scale the tires to match with the body.
5. Adjust the tire offsets and tire rotations accordingly.
6. Repeat steps 4 and 5 to refine.
7. Save the params.


Regards,
smso
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Generic vehicle scene node with a simple editor

Post by smso »

REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Generic vehicle scene node with a simple editor

Post by REDDemon »

nice :)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Re: Generic vehicle scene node with a simple editor

Post by ACE247 »

Now expanding to multiple vehicle types :) Will add some tabs at the top for Vessel, Wheeled, Tracked, Rotor Craft, Jet Craft, Rocket. Should have all the bases covered then.
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: Generic vehicle scene node with a simple editor

Post by Cube_ »

O_O

Just what I was thinking about making (I need vehicles) I assume it uses a zlib license?
"this is not the bottleneck you are looking for"
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Generic vehicle scene node with a simple editor

Post by smso »

aaammmsterdddam wrote:O_O

Just what I was thinking about making (I need vehicles) I assume it uses a zlib license?
Same as that of the Irrlicht engine.
I learnt much from 3D programs that come with source codes:)

Regards
smso
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: Generic vehicle scene node with a simple editor

Post by Cube_ »

then it uses a zlib license, sweet 8-)

Now I should just dissect this and see how it works ^^
"this is not the bottleneck you are looking for"
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Generic vehicle scene node with a simple editor

Post by smso »

Updated: 21st May, 2012

A real car pitches when accelerates or brakes. It also rolls to one side on turning a corner.
To add more realism in controlling the vehicle, new functions are added:

Code: Select all

        void pitchBody(f32 degs);
        void rollBody(f32 degs);
        void rotate(scene::ISceneNode* node, const core::vector3df& rot);
        void resetPitch();
 

After setting up the vehicle, press 'A', 'D' to steer it and it will roll to one side.
Press 'W', 'S' to change speed and the vehicle will pitch accordingly.

Changed files:
main.cpp
vehicle_scene_node.h
vehicle_scene_node.cpp

See the first post for an updated archive file.

Regards,
smso
Post Reply