OGRECave / ogre-pagedgeometry

Paged Geometry is a component for rendering of dense vegetation
https://ogrecave.github.io/ogre-pagedgeometry/
21 stars 7 forks source link

1.11 Update (2) #6

Closed Belsnickle closed 5 years ago

Belsnickle commented 5 years ago

Second attempt. Used change log to fix all instances of .isNull correctly. One thing I am not sure about is how I handle subMeshList in BatchedGeometry.cpp. Example1 now exits without a crash.

After I closed my original pull request for my fork the OGRECave repository was updated for MINGW builds. I tried committing the changes to my fork but I ended up commits ahead and behind and not "even". I ended up deleting my fork and then forking again. Is there something I am missing to update forks to keep the "even" tag?

Belsnickle commented 5 years ago

Sorry the try and catch statement should not be in BatchedGeometry::clear(). The function should remain unchanged from the master branch. I was crashing in the statement and forgot to remove the try/catch after debugging.

Belsnickle commented 5 years ago

While moving through the forest I encountered a crash. I have been able to reproduce this crash by moving around the one of the four edges of the forest created in Example1. Interestingly this crash doesn't seem to happen when supplying 0 for the y position of the trees instead of using the getTerrainHeight fuction. Ogre::Node->setPosition asserts "Invalid vector supplied as parameter". Traced back to line 347 of BatchedGeometry.cpp.

m_pSceneNode = m_pParentSceneNode->createChildSceneNode(m_vecCenter);

When watching the variables the value is {...} in Visual Studio. What does this mean?

Call stack:

>   Project2.exe!Forests::BatchedGeometry::build() Line 347 C++
    Project2.exe!Forests::BatchPage::build() Line 127   C++
    Project2.exe!Forests::GeometryPageManager::_loadPage(Forests::GeometryPage * page) Line 879 C++
    Project2.exe!Forests::GeometryPageManager::update(unsigned long deltaTime, Ogre::Vector<3,float> & camPos, Ogre::Vector<3,float> & camSpeed, bool & enableCache, Forests::GeometryPageManager * prevManager) Line 574   C++
    Project2.exe!Forests::PagedGeometry::update() Line 247  C++
    Project2.exe!rayTech::frameStarted(const Ogre::FrameEvent & evt) Line 240   C++
    OgreMain_d.dll!Ogre::Root::_fireFrameStarted(Ogre::FrameEvent & evt) Line 723   C++
    OgreMain_d.dll!Ogre::Root::_fireFrameStarted() Line 785 C++
    OgreMain_d.dll!Ogre::Root::renderOneFrame() Line 873    C++
    Project2.exe!WinMain(HINSTANCE__ * hInst, HINSTANCE__ * __formal, char * strCmdLine, int __formal) Line 22  C++
paroj commented 5 years ago

After I closed my original pull request for my fork the OGRECave repository was updated for MINGW builds. I tried committing the changes to my fork but I ended up commits ahead and behind and not "even". I ended up deleting my fork and then forking again. Is there something I am missing to update forks to keep the "even" tag?

git fetch origin
git reset --hard origin/master
git push -f

however this will discard all your local changes. Read up git rebase for keeping your changes.

paroj commented 5 years ago

Interestingly this crash doesn't seem to happen when supplying 0 for the y position of the trees instead of using the getTerrainHeight fuction.

while this is unrelated to this PR, the assertion is triggered as you supply NaN for the y postion. You probably commented out the (broken) terrain loading in Sample1. Therefore there is no terrain intersection.

Belsnickle commented 5 years ago

while this is unrelated to this PR, the assertion is triggered as you supply NaN for the y postion. You probably commented out the (broken) terrain loading in Sample1. Therefore there is no terrain intersection.

I changed the first sample to use a volume terrain.

When running position.y = 0 (for tree height) I can't reproduce a crash. When using position.y = getTerrainHeight(x,z) the trees are put on the terrain and when going around the edges of the forest it crashes every time in a certain spot near one of the four corners.

paroj commented 5 years ago

manually merged the uncritical parts.