Problem with Moving Child Camera...

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
MynithiX
Posts: 26
Joined: Thu Oct 11, 2012 4:06 pm
Location: Germany

Problem with Moving Child Camera...

Post by MynithiX »

Hey guys.
I want to make a helicopter which is flying in a Circle around a rock, and a FPS-Camera inside this helicopter.
This works so far, but the problem is that the FPS-Camera rotates itself.

There is a point at the rock, which turns itself. The Camera and the Helicopter are childs from this point.
I hope you guys understand what I mean, because I don't want to confrontate you with my yet untidy code :D

Thx, Mynithix

By the way, basic C++ problem because I'm a noob.
I have a main.cpp with the game.h(eader). In the header there is a void menu(){} but I've got a second file menu.cpp where void menu(){isFilled();} So, what can I do to use the menu.cpp?
Two things are infinite: the stupidity of the humans and universe. I'm just not sure if the universe is really infinite!
YOLO
NemoStein
Posts: 17
Joined: Mon Aug 11, 2008 12:04 am

Re: Problem with Moving Child Camera...

Post by NemoStein »

Couldn't you make the helicopter rotate, instead of the node which the two (helicopter and camera) are children?
Camera and helicopter will follow the node, but only the helicopter will spin...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Problem with Moving Child Camera...

Post by CuteAlien »

You mean - you want to walk around inside the helicopter while it is flying? Pretty tricky and interesting problem :-) And sorry, I haven't tried doing that yet, but could be you have to write your own camera-animator code for that.

About the c++ problem - you can't have 2 implementations of the same function - that is simply impossible. What you can have is a declaration and an implementation. Basically your header has to look like that instead:

Code: Select all

 
extern void menu();
 
That tells the compiler then that there is a menu function which will be implemented somewhere else.
Then again you usually do not that have many simple c-style functions when programming c++. It's more common to put stuff into classes.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
MynithiX
Posts: 26
Joined: Thu Oct 11, 2012 4:06 pm
Location: Germany

Re: Problem with Moving Child Camera...

Post by MynithiX »

Hm, currently I just need to be able to 'turn my head'. Is this as tricky as walking around? :D
Two things are infinite: the stupidity of the humans and universe. I'm just not sure if the universe is really infinite!
YOLO
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Problem with Moving Child Camera...

Post by CuteAlien »

I think you shouldn't use a FPS camera in that case. FPS camera is just for walking around. You can use Maya-camera maybe. Or just a normal camera and then add your own animator to it for rotating around (in short that should update your camera position to the helicopter, and then you have to control the target values of the camera based on input).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply