Spaceship Steering

Introduce your project and write about your work.

Moderator: PPS-Leaders

User avatar
Biber
Noxonian Pryllgnothor
Posts: 1
Joined: Wed Oct 03, 2007 6:25 pm
Location: Schwyz/Siebnen

Spaceship Steering

Post by Biber » Fri Nov 16, 2007 1:58 pm

This thread is about the spaceship steering.

Project Page

I developed a class, which can steer a node. There are functions which rotate the node in every 6 directions plus a function, which moves the node forward. The speeds and acceleration in for every function are controlled by parameters.

Next I had to implement an interface, so that the functions can be controlled by user input such as keyboard and mouse.

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Post by x3n » Fri Nov 16, 2007 3:30 pm

cool, I liked the steering you showed us on Wednesday.
I'm very interested how it will work with mouse-steering and in collaborating with the AI. :)

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Post by 1337 » Thu Dec 13, 2007 2:06 pm

This afternoon, I took the liberty of having a look at the steering code. And I came to the conclusion that now it is fine.

But I was able to fix the problem anyway. It was located in the initialisation of the input system. According to the Ogre tutorials on input (buffered or unbuffered), you have to set the "mouse clipping size" (whatever that means exactly). I did that just before the rendering starts and now it works.
Actually, one would have to do this every time the window size changes, so at the moment it is just a hacky fix.

The lines I added are the following:

Code: Select all

		unsigned int width, height, depth;
		int left, top;
		ogre_->getRoot()->getAutoCreatedWindow()->getMetrics(width, height, depth, left, top);

		const OIS::MouseState &ms = mouse_->getMouseState();
		ms.width = width;
		ms.height = height;
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Post by x3n » Thu Dec 13, 2007 7:18 pm

Nice :)

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Post by greenman » Fri Dec 14, 2007 5:15 pm

Great, thanks!

With my usb mouse it works fine (the acceleration is a bit too fast I think, though), but it doesn't seem to like my touchpad!?

And something else: I think key up(accelerate)/down(brake) are switched. Can anyone confirm that?

edit: I think there might be a camera problem, because the code for move_forward/backwards should be fine (had a short glance at it).

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Post by x3n » Fri Dec 14, 2007 7:26 pm

Yes, reto inverted the camera coordinates (at least that's what I've seen in the commit-mail)

User avatar
Dorian
Human Space Navy Lieutenant
Posts: 20
Joined: Mon Oct 01, 2007 9:15 am
Location: Walliswil-Wangen
Contact:

Post by Dorian » Fri Dec 14, 2007 9:58 pm

It depends on what you set the cam corrdinates in the level file (sample.oxw). Perhaps one should change this so that the steering checks for the right settings itself...
Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it. (Linus Torvalds)

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Post by 1337 » Fri Dec 14, 2007 10:24 pm

Strange, I simply copied the code from the example framework. And what do these line have to do with the camera?
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Post by x3n » Fri Dec 14, 2007 10:36 pm

I was talking about this (in rev511):
r511 wrote:- cam->setPosition(Vector3(0,0,+250));
+ cam->setPosition(Vector3(0,0,-250));

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Post by 1337 » Sat Dec 15, 2007 6:05 pm

?? I have not even seen this line yet.. so I can not help with this one.
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

nicolasc
Baron Vladimir Harkonnen
Posts: 258
Joined: Wed Nov 01, 2006 7:58 pm
Location: your mind
Contact:

Post by nicolasc » Sun Dec 16, 2007 10:55 pm

The camera should be behind the object, not in front of it and the z axis points into the screen.
BOFH Excuse #212: Of course is doesn't work. We've performed a software upgrade.

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Post by greenman » Mon Dec 17, 2007 10:10 am

Is it possible, that the steering only affects the camera at the moment? If I move the mouse I think, that I only see the same scene from a different angle?!

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Post by 1337 » Tue Dec 18, 2007 6:07 pm

That has been fixed by now.

I would like to conduct a little survey on the "invert axis" subject: Who actually likes the inverted y-axis?
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
hofzge
Roshliikhh, lower servant to the Deities
Posts: 116
Joined: Mon Oct 23, 2006 12:01 pm

Post by hofzge » Tue Dec 18, 2007 6:42 pm

It would maybe better to make e real poll about that. You can start polls by starting a new topic... just in case you didn't know. I don't think that many people will answer here.

I, for one, like uninverted mouse steering.
The sky above the port was the color of television, tuned to a dead channel.
-- William Gibson, Neuromancer

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Post by beni » Tue Dec 18, 2007 7:01 pm

The question is only what should be the standard. Many people use the inverted mouse, so this is one of the first things that have to be made settable.
"I'm Commander Shepard and this is my favorite forum on the internet."

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests