LOD Callbacks
by Thomas Bang · in Torque Game Engine · 10/02/2009 (8:59 am) · 3 replies
Is it possible to execute a callback when the LOD-Stage of a model/interior has changed?
#2
It's not the best solution but it should work.
10/03/2009 (6:52 am)
I did not found where the LODs are set. But i guess i can do it in a different way. It is possible to execute a callback when a special frame is rendered. So i can get the current LOD over animation trigger. It's not the best solution but it should work.
#3
near the end of the function before changing mCurrentDetailLevel do
As for Interiors, they do not seem to keep track of the last detail level used; they just select a detail level every on every render loop. So you'd want to add an mCurrentDetailLevel to InteriorInstance. Then find
10/03/2009 (12:41 pm)
For TS models, you should findvoid TSShapeInstance::setCurrentDetailin ts/tsShapeInstance.cc
near the end of the function before changing mCurrentDetailLevel do
// If the detail level changes...
if (dl != mCurrentDetailLevel)
{
// callback
}
mCurrentDetailLevel = dl;As for Interiors, they do not seem to keep track of the last detail level used; they just select a detail level every on every render loop. So you'd want to add an mCurrentDetailLevel to InteriorInstance. Then find
void InteriorInstance::renderObjectin interior/interiorInstance.cc. Then after the line
InteriorRenderImage* interiorImage = static_cast<InteriorRenderImage*>(sceneImage);add
if (mCurrentDetailLevel != interiorImage->mDetailLevel)
{
// do callback
}
mCurrentDetailLevel = interiorImage->mDetailLevel;
Torque 3D Owner Daniel Buckmaster