Hover craft like physics?

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
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Hover craft like physics?

Post by dwfait »

Does any one have any good links or resources on how to set up hover craft like physics? I don't need it to go too in depth or deep into formulaes as I'll be using Newton physics. Or if anyone knows a good way to do hover physics themselves that would be great...I'm not asking for code, just the theory behind it.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

A really good point to start would be buoyancy and fluid simulation ;)
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

Well I'm looking for hovercraft behaviour over land, al la hover tanks.
GuerillaSoftworks
Posts: 83
Joined: Wed May 23, 2007 6:11 pm

Post by GuerillaSoftworks »

Dorth wasnt suggesting that your hover craft is a boat but instead that the way a water bound vessel moves can be very similar in some aspects to how a hovercraft moves.
Guerilla Softworks

New Guerilla Softworks website under construction - http://guerillasoftworks.awardspace.com
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

you have to apply force to the bottom of hovercraft. to keep it in the same height you should apply force and lift it unless you are at required height, when you dont need to go up - do not apply force. When you fall lower than you need - lift hovercraft again. to get height from ground you will need to cast a ray downwards. for better stability of craft you will have to apply force to several points of craft. this will keep balance. and cast a ray from each point of applying force, so you will know when you will need to lift up specific part of craft. i hope it helps ;)
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

Ok...To do that I would need to use a Raycast, right? I've been searching the API for ages looking for a raycast, but can't seem to find it. If someone could post the syntax or a link to the docs for it I would be very grateful.

Btw, I know newton has it's own raycast, but it doesn't seem to work with tree collisions, which is what my terrain is :\.
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

The movement tutorial shows how to raycast.

Also if you want to do this the simple and dirty way you can create a physics object in something like newton and in the material settings turn off friction or set it really, really low.
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

Dances wrote:The movement tutorial shows how to raycast.
Are you sure about that? I can't seem to find anything on ray casting in there..
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

oh crap. I'm so sorry. I meant the collision tutorial. Here I'll snatch the code to make up for my blunder.

Code: Select all

core::line3d<f32> line;

		line.start = camera->getPosition();

		line.end = line.start +

         (camera->getTarget() - line.start).normalize() * 1000.0f;



		core::vector3df intersection;

		core::triangle3df tri;



		if (smgr->getSceneCollisionManager()->getCollisionPoint(

			line, selector, intersection, tri))

		{
			//if the line hit something code goes here
		}
Thats almost pasted out of the collision tutorial directly.

The nomalize thing doesn't have to be used... thats just because the angle of the camera is being used. really they are just two 3d points..

Again, really sorry :oops:
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

to implement realistic hovercraft movement you should use physics library, lets say Newton. and then you use Newton raycasting, not irrlicht ;)
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

I used Roxaz method for this. For stability a small force is applied (constantly in each update) above the centre of gravity (at the top of the craft) to keep it upright.

However with that method the hovercraft bounces in the air a lot. So if you just want something that slides just above the ground, set the friction very low as Dances suggests.
Post Reply