Known bugs: when camera begins to move it stops for a sec and then moves smoothly. I dont know how to remove that stucking up at the start of the movement. Also for the first move camera moves not to the direction that it should.
Note for newbies: vEngine is pointer to video engine object that holds ICameraSceneNode and other irrlicht goodies
Last edited by roxaz on Mon Mar 05, 2007 7:31 pm, edited 1 time in total.
as far as i know ICameraSceneNode has same virtual OnEvent() just like IEventReceiver. The whole idea was about how to make cam move towards - backwards, left - right depending on where cam is looking at
simple added camera moves just using key controls and it moves in 3d space so if you look up - it moves up. my cam is better for gravity - enabled scene. it doesnt jump when you press forward and look up. got idea?
oh well, i see for now. The idea is not bad, but you shoud better use PressedDown state of the keys rather than just an input key event. This should make the moving smooth.
yea, thats true. i have improved my code a bit (check the 1st post), now it knows how to move to all directions (W+A; W+D; S+A; S+D). Still movement isnt smooth, i cant find where problem is...
Your code is over-complicated for what you are trying to do. There is a lot of unnecessary if logic in there. Seems like this would work just fine and the camera movement would be smooth [but starts and stops would be quite abrupt].
[Edit: partial code cut and moved to post below]
Last edited by vitek on Tue Mar 06, 2007 10:13 pm, edited 1 time in total.
I don't know what you are doing wrong, I've tested the code and it is smooth as butter. The only way it would not be smooth is if you are getting a very bad frame rate, and there isn't any amount of camera movement smoothing that can fix that.
i have 30 fps (framerate limiter), its ok i think. maybe you understood me wrong when i said that movement isnt smooth. just movement is ok, but when i start to move or when i switch moving directory from forward to forward-left lets say, it stops after first movement and then continues to move on.
but when i start to move or when i switch moving directory from forward to forward-left lets say, it stops after first movement and then continues to move on.
No, it does not. I don't know what you're doing, but using the code I posted above the camera does not stop at all when you switch from holding W to holding W+A [unless you release W].
As I mentioned in my previous posts, starts and stops would be abrupt. This is because the camera doesn't do acceleration to smoothly transition from stopped [no key down] to moving [any WASD key combination] and vice-versa. Of course that can easily be fixed, but I don't really care to add it...