noFreak
20-11-2007 22:47:04
I want to continue this post http://www.ogre3d.org/phpBB2/viewtopic.php?t=37112.
I have had the same problem. At first i have stepped the
method and have detected that in following code
But why this method ever and ever return zero???
I have stepped the constructor from pagedGeometry and the
PagedGeometry::pageSize = pageSize; in both of following has no effect...
But I think this behaviour depends on my linker warnings:
1>PagedGeometry.lib(TreeLoader3D.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Generating code
1>Finished generating code
1>Embedding manifest...
1>PagedGeometry.lib(TreeLoader3D.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
And i can only note this behavior when i use the release version of the PagedGeometry.lib. When I use the _d.lib in my solution theres no Problem ... any idea?
I have had the same problem. At first i have stepped the
mTrees->addDetailLevel<BatchPage>(150, 30);
method and have detected that in following code
template <class PageType> inline void GeometryPageManager::initPages(const TBounds& bounds)
{
// Calculate grid size, if left is Real minimum, it means that bounds are infinite
// scrollBuffer is used as a flag. If it is allocated than infinite bounds are used
// !!! Two cases are required because of the way scrolling is implemented
// if it is redesigned it would allow to use the same functionality.
if(bounds.width() < 0.00001)
{
// In case of infinite bounds bounding rect needs to be calculated in a different manner, since
// it represents local bounds, which are shifted along with the player's movements around the world.
geomGridX = (2 * farTransDist / mainGeom->getPageSize()) + 4;
gridBounds.top = 0;
gridBounds.left = 0;
gridBounds.right = geomGridX * mainGeom->getPageSize();
gridBounds.bottom = geomGridX * mainGeom->getPageSize();
// Allocate scroll buffer (used in scrolling the grid)
scrollBuffer = new GeometryPage *[geomGridX];
which is called by addDetailLevel()
, everytime the method mainGeom->getPageSize()
was called, the return value was zero. And at this you can find the crash, a divided by zero "error":
geomGridX = (2 * farTransDist / mainGeom->getPageSize()) + 4;
But why this method ever and ever return zero???
I have stepped the constructor from pagedGeometry and the
void PagedGeometry::setPageSize(Real size)
method and have detected that the assignment PagedGeometry::pageSize = pageSize; in both of following has no effect...
//Method
void PagedGeometry::setPageSize(Real size)
{
if (!managerList.empty())
OGRE_EXCEPT(0, "PagedGeometry::setPageSize() cannot be called after detail levels have been added. Call removeDetailLevels() first.", "PagedGeometry::setPageSize()");
pageSize = size;
}
//Constructor
PagedGeometry::PagedGeometry(Camera* cam, const Real pageSize)
{
//Setup camera and scene manager
if (cam){
sceneCam = cam;
sceneMgr = sceneCam->getSceneManager();
oldCamPos = sceneCam->getDerivedPosition();
} else {
sceneCam = NULL;
sceneMgr = NULL;
oldCamPos = Vector3::ZERO;
}
//Init. timer
timer.reset();
lastTime = 0;
//Setup page size / bounds
PagedGeometry::pageSize = pageSize;
m_bounds = TBounds(0, 0, 0, 0);
//Misc.
pageLoader = NULL;
}
But I think this behaviour depends on my linker warnings:
1>PagedGeometry.lib(TreeLoader3D.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Generating code
1>Finished generating code
1>Embedding manifest...
1>PagedGeometry.lib(TreeLoader3D.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
And i can only note this behavior when i use the release version of the PagedGeometry.lib. When I use the _d.lib in my solution theres no Problem ... any idea?