History: Talk:Displaying LensFlare
Source of version: 1 (current)
Copy to clipboard
!!!Errors in Code
This is a very useful class and I thank you for posting it. I'm not sure if it was developed under an older version of Ogre, but I had to make a few changes to get it to compile. I also had to make a few changes to get the proper results. Maybe I don't fully understand how the lens flare should look, but it wasn't moving around with the view as I looked around the light source. I won't make the changes to the actual code, because that would drive me nuts if someone else did that to me, so I'll just list them here.
* In Destructor: renamed removeBillboardSet() to destroyBillboardSet()
~pp~ mSceneMgr->destroyBillboardSet(mHaloSet);~/pp~
* In createLensFlare: VOIDOBJECT was not a valid QueryFlag. Changed to 0
~pp~ mBurstSet->setQueryFlags(0);~/pp~
* In update(): LightDistance was just the length of the position vector for the light. Changed to be the distance from the camera to the light.
~pp~ Vector3 camPos = mCamera->getPosition();
Real LightDistance = (camPos - mLightPosition).length();~/pp~
* In update(): The CameraVec didn't take into account the camera's position, so it was always relative to the scene's origin, not the camera. Added the camera's position.
~pp~ CameraVect = mCamera->getPosition() + (LightDistance * CameraVect);
~/pp~
((User:Moohasha|Moohasha)) 21:20, 8 April 2008 (BST)