Faxnico
18-11-2008 17:37:40
Hello.
First of all congratulations and sorry for my poor english.
I'm having some troubles in my project with the impostors that I never experienced playing the "Forest Demo".
It looks like they don't disappear at all when I come close to trees with the camera.
Here you've a picture of the problem:
I setup Paged Geometry, taken from SVN, as follow:
Then I push trees using the loader's addTree method:
And finally I update PG every frame in my loop:
Any help would be extremly appreciated.
Thank you.
Nicolò
First of all congratulations and sorry for my poor english.
I'm having some troubles in my project with the impostors that I never experienced playing the "Forest Demo".
It looks like they don't disappear at all when I come close to trees with the camera.
Here you've a picture of the problem:
I setup Paged Geometry, taken from SVN, as follow:
void CSimPagedGeometryManager::createPagedGeometry(const Forests::TBounds& stageBound, Ogre::Camera* camera)
{
m_PG = new Forests::PagedGeometry();
m_PG->setCamera(camera);
m_PG->setPageSize(250000);
m_PG->addDetailLevel<Forests::BatchPage> (9000, 3000);
m_PG->addDetailLevel<Forests::ImpostorPage> (70000, 5000);
m_PL = new Forests::TreeLoader2D(m_PG, stageBound);
m_PL->setHeightFunction(&CSimPagedGeometryManager::getTerrainHeight);
m_PL->setMaximumScale(10.0f);
m_PG->setPageLoader(m_PL);
}
Then I push trees using the loader's addTree method:
m_PL->addTree(
pgGrpInfos.m_Entities[idx],
pgGrpInfos.m_TerrOffset + (orientation * Ogre::Vector3(x, 0.0f, z)),
Ogre::Degree(Ogre::Math::UnitRandom()*360.0f),
Ogre::Math::RangeRandom(pgGrpInfos.m_ScaleRnd.x, pgGrpInfos.m_ScaleRnd.y));
And finally I update PG every frame in my loop:
void CSimPagedGeometryManager::update()
{
m_PG->update();
}
Any help would be extremly appreciated.
Thank you.
Nicolò