Moving Objects (Elevator)

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
Yellow_Yackets
Posts: 29
Joined: Thu Oct 25, 2007 5:58 pm
Location: Florida
Contact:

Moving Objects (Elevator)

Post by Yellow_Yackets »

Hello,

I created a very simple elevator that goes up and down. I added to the meta selector.

When the elevator is not moving and i get on it with a FPS camera, I don't fall down, But when the elevator is moving up i fall down. Is like i get throw the object.

My collisions are good with every object in the scene, even with the elevator. I just have problems with moving objects. I can't stay on them when they are moving.

A better example of my problem is that if i cerate a game where i have to get on a car, the car will move but FPS camera will stay at the same place.

How can i solve this?
Y_Y
fireside
Posts: 158
Joined: Thu Dec 01, 2005 10:55 pm

Post by fireside »

You could set the scene node as the parent of the camera scene node, but you'd have to use something to set it and release it when it stopped moving. I have no idea if that would actually work, but there is a function. Otherwise you'd have to use physics.
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Re:

Post by PI »

...Or moving the player with a very small vector towards the elevator when standing on it! That will help! ;)

Cheers,
PI
Yellow_Yackets
Posts: 29
Joined: Thu Oct 25, 2007 5:58 pm
Location: Florida
Contact:

Re:

Post by Yellow_Yackets »

I tried that and it gave me a strange results. The camera move like crazy and i still fall from the elevator. :cry:

is there another way to do it?
Y_Y
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

How about...


1) get the absolute position of the elevator.


2) set the camera position to the evelator's absolute position.

though i think setting the parent of the camera to the elevator is a better solution.
Morgawr
Posts: 95
Joined: Wed Sep 26, 2007 7:04 pm

Post by Morgawr »

In a theoretical way (since I'm not good with 3D stuff), you could just check that, when the camera is inside the elevator, the distance between the camera itself and the lowest part of the elevator is a fixed amount, making so that if the elevator coordinates change, call a function that modifies the camera coordinates as well, keeping it at the same distance.

Don't know if it's possible and if I've been clear enough but in theory it could work.
Yellow_Yackets
Posts: 29
Joined: Thu Oct 25, 2007 5:58 pm
Location: Florida
Contact:

Post by Yellow_Yackets »

I'll try that later, because i have almost no time to test the elevator, but i will and i will post the results...

By the way, is there a website that has irrlitch demos other than the ones on the irrlicht website? Im not talking about game demos, i am talking about code snips demos, for example:

"This is how you can create a FPS camera. Click here Download"

I think that would help me al LOT, because the code is there and i just have to study it and create it my own way.
Y_Y
Post Reply