I'd set up a couple of breakpoints to check the validity of your values whenever such a glitch happens, because at first sight I can't see anything in this code which could lead to the problem you're having
I am curious about one thing tho
Why are you updating your camera movement in your register function? Why not write an animator to do this?
The register function is generally not meant to do these kind of updates, it should only register your node while your animator updates movement
I don't know if this could cause any actual problems, but I'd suggest you separate the movement code from the actual camera and put it into an animator (I think you could actually move a lot of code away from this into an animator so you could just apply this to any ordinary camera)
funy scene drawing from 1.4 to 1.5 ( still a problem in 1.7
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
During development I couldn't not get the animator function to run. I could try it again and re-track why, but no one was able to figure it out. I'll see if a few brake points shows a problem, and see what lines does it, but my guess is I wont see the glitch till the irrlicht update. Maybe there will be a clue left before hand but that is a lot of stuff to look at. Never the less I'll try it.
Last edited by ulao on Sun Jan 16, 2011 12:35 am, edited 2 times in total.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
That's another good reason for writing an animatorulao wrote:During development I couldn't not get the animator function to run. I could try it again and re-track why, but no one was able to figure it out. I'll see if a few brake points shows a problem, and see what lines does it, but my guess is I wont see the glitch till the irrlicht update. Maybe there will be a clue left before hand but that is a lot of stuff to look at. Never the less I'll try it.
And debugging is the biggest (and most frustrating) part of software development, I've had my share of stuff to look at too in the past ^^
Well my intention was to get the animator to work, but just could not.
From debugging here are my Findings: ( I'll just update this from time to time, if anything jumps out at anyone please post your thoughts )
-Put a break points in the OnRegisterSceneNodefunction
Each frame seems to draw a section of the world from one side to the other.
Here is a screen shot.
-Tracked it down to the line causing the issue but nothing out of the ordinary.
If I dont run the setRotation line, I'm ok ( free from flicker ). So confusing...
Insolently this alone cause the issue. m_RealCamera->setRotation( m_RealCamera->getRotation() ); Inside or outside the OnRegisterSceneNode function. So its something to do with just calling that function. Even more interesting its only rotation , setting the position does not effect it.
At least its possible, debugging JS is a real pain in the arsAnd debugging is the biggest (and most frustrating) part of software development, I've had my share of stuff to look at too in the past ^^
From debugging here are my Findings: ( I'll just update this from time to time, if anything jumps out at anyone please post your thoughts )
-Put a break points in the OnRegisterSceneNodefunction
Each frame seems to draw a section of the world from one side to the other.
Here is a screen shot.
-Tracked it down to the line causing the issue but nothing out of the ordinary.
Code: Select all
//vector3df vTemp = m_RealCamera->getRotation();// get current rotation
m_RealCamera->setTarget( vInTarget ); //set target for temp data
//vector3df vTarget = m_RealCamera->getRotation();// get destination rotation
m_RealCamera->setRotation( vTemp ); // put it back
Insolently this alone cause the issue. m_RealCamera->setRotation( m_RealCamera->getRotation() ); Inside or outside the OnRegisterSceneNode function. So its something to do with just calling that function. Even more interesting its only rotation , setting the position does not effect it.
Last edited by ulao on Sun Jan 16, 2011 4:58 am, edited 2 times in total.
Whenever I am manipulating cameras, using camera positions, or anything of the sort, and strange things happen like flickering, jumping, shaking, generic weirdness... the first thing I try is calling UpdateAbsolutePosition() on the camera before doing anything to or with it.
Often it fixes the problem, usually for no obvious reason.
If you are desperate, you might give it a shot.
Often it fixes the problem, usually for no obvious reason.
If you are desperate, you might give it a shot.