I have been experimenting with the camera a bit and found a few bugs. Firstly, when moving in a diagonal direction on the X and Z axis, the camera twists until movement has stopped. The way I am doing it is simply updating the position every frame depending on what way it is moving.
This leads to the second bug, if it can be called so. You can use an animator for the camera but you still have to update the position of the target manually. I think either having the option of the target moving with the camera or being able to add an animator to the camera target ( preferred ) would be a much better idea.
Any chance of this being sorted out for the next version?
Camera Manipulation
This might not really be a bug. It's just positions lagging behind, because setPosition() only takes effect when ISceneNode::updateAbsolutePosition() gets called. In ISceneNode it happens in OnPostRender(). In an app loop it can get out of sync, I have not yet 100% figured out why, maybe it is kind of a bug... I had problems with this too (not camera though but other scene nodes).
You can fix this by calling camera->updateAbsolutePosition() manually after each camera->setPosition() call in your 2080. Namely in
moveBuffer.cpp
IBaseClass.cpp
isoCam.cpp
And all the twist will be gone!
(tested!)
Btw. I had problems to compile your source at first because there was no implementation of IBaseClass::showLevel3()...
You can fix this by calling camera->updateAbsolutePosition() manually after each camera->setPosition() call in your 2080. Namely in
moveBuffer.cpp
IBaseClass.cpp
isoCam.cpp
And all the twist will be gone!
(tested!)
Btw. I had problems to compile your source at first because there was no implementation of IBaseClass::showLevel3()...
Last edited by jox on Sat Jul 10, 2004 11:44 am, edited 1 time in total.
Heh, it isn't nice no. Neither's the source code, it's not meant to be. I set out from the start not to create nice code but to find out what the best structure would be for the stuff I need. That's why I'm doing a tech demo. Once I finish with the tech demo I will figure out what the best way to go about things are and write a new structure from scratch. That's because I know that many people run into problems with bad structure and I wasn't ( still not ) entirely sure what the best, most modular structure is. I am learning all the time as this is by far the biggest thing I've ever done in programming. I want to get everything right from the start.
Cheers for the fix, I will put that in. I didn't know about that, I figured something must be lagging behind a frame or two somewhere.
The showLevel3() is now redundant, I thought I had taken out all calls to it. I will change that, thanks for the heads up.
Edit: It works great, thanks a lot for that. It has been annoying me for a while now. I tried an acceleration and deceleration but it was too annoying as it overshot by a lot so I removed it.
Cheers for the fix, I will put that in. I didn't know about that, I figured something must be lagging behind a frame or two somewhere.
The showLevel3() is now redundant, I thought I had taken out all calls to it. I will change that, thanks for the heads up.
Edit: It works great, thanks a lot for that. It has been annoying me for a while now. I tried an acceleration and deceleration but it was too annoying as it overshot by a lot so I removed it.