I use this code to scale all my characters to a certain height an dont have to modfiy them in some modeler or so.
Guess the code explains itself. Would be a nice addition to ISceneNode
Code: Select all
setHeight(f32 newHeight, ISceneNode* node)
{
vector3df extent = node->getBoundingBox().getExtent();
if(extend.Y == 0)
return; //Devide by Zero
f32 scale = newHeight / extent.Y;
node->setScale(vector3df(scale,scale,scale));
}Halan