Spaceship Steering
Moderator: PPS-Leaders
Spaceship Steering
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.
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.
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:
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.
A webcomic of romance, sarcasm, math, and language.
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).
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).
- Dorian
- Human Space Navy Lieutenant
- Posts: 20
- Joined: Mon Oct 01, 2007 9:15 am
- Location: Walliswil-Wangen
- Contact:
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)
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.
A webcomic of romance, sarcasm, math, and language.
?? 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.
A webcomic of romance, sarcasm, math, and language.
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?
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.
A webcomic of romance, sarcasm, math, and language.
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.
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
-- William Gibson, Neuromancer
Who is online
Users browsing this forum: No registered users and 48 guests