Nasty Little Bug (Again)


25-01-2009 15:20:57

Err, Umm, Yep I know I complain A LOT!!
But here is another little but a nasty crasher bug which you may never realise unless Hydrax is used in an editor and instantiated more then once during the lifetime of the application....

You remember a line in Hydrax::create() as:

(Line 142, Hydrax.cpp)

Umm, where is the corresponding:


in Hydrax::remove?????

since the listener stays active, when i terminate the scene and reload another scene with a Hydrax object in it, RenderSytem still tries to inform the old and deleted hydrax object...and bang, crash....

I fixed it by adding a corresponding removeListener() in Hydrax::remove(), I suggest you do the same :)

Keep up the good work...



25-01-2009 22:00:09

Good catch!
Thanks :)

P.D.: I'm going to download the latest version of your editor and trying to understand the because of the reflection problem(I think I know what's happend, a problem with a parameter in RttManager due to the world scale differences).



25-01-2009 22:13:25

BTW I made a little test, drag and drop the TreeNode to under SceneManager node, which puts the tree completely in the water (it'll disappear from your view but just select tree entity under treenode and press "F" to focus on it) and all transparent leaves are now not so transparent a pic below:

I hope you can find a solution to it too :)



25-01-2009 22:26:57

Custom hydrax depth maps based on textures(for transluscent objects inside the water) is a feature planned for the 0.5 version, but probably will be aplaced to 0.6, because is a little complex and, before that, I want to change the underwater depth calculation approach.(And doing it like crysis approach)

With this feature, you're going to be able to do something like:
Hydrax::MaterialManager::addHydraxTextureDepthTechnique(const Ogre::String& texName, Ogre::Technique* tech)

I'll add some examples of how to create the hydrax deph textures for the objects, so.. don't worry!


05-02-2009 08:14:10

Hi Xavyiy,

Found another little bug, same category. You should probably check your source and update it so that ALL LISTENERS MUST BE REMOVED WHEN THE LISTENING CLASS DESTROYED :)

Ok, this time it is RttManager, in initialize() it installs a Reflection Listener as following:

if (!mPlanesSceneNode)
mPlanesSceneNode = mHydrax->getSceneManager()->getRootSceneNode()->createChildSceneNode();

now, when the user wants to remove hydrax and delete it, boom a crash traced back to :

bool SceneManager::fireRenderQueueStarted(uint8 id, const String& invocation)

where the RenderQueueListeners are called (of course this time with a <Bad Ptr> since its deleted).

so, fix is (I may be doing wrong so correct me): (in void RttManager::removeAll())

if (mPlanesSceneNode)
mPlanesSceneNode = 0;

Stealth, :D


05-02-2009 14:42:25

Fixed ;)