Changed from bbox extent to stored texture size for planar mapping ratio.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2190 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-02-02 22:10:42 +00:00
parent 543407812f
commit 5266da908a
1 changed files with 7 additions and 7 deletions

View File

@ -343,20 +343,20 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file)
}
}
// get the resolution for this axis
f32 resolutionS = 1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Y;
f32 resolutionT = -1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Z;
f32 resolutionS = 1.f/Materials[i]->Texture[0].Size.Z;
f32 resolutionT = 1.f/Materials[i]->Texture[0].Size.Y;
if (Materials[i]->Texture[0].Axis==1)
{
resolutionS = 1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().X;
resolutionT = -1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Z;
resolutionS = 1.f/Materials[i]->Texture[0].Size.X;
resolutionT = 1.f/Materials[i]->Texture[0].Size.Z;
}
else if (Materials[i]->Texture[0].Axis==2)
{
resolutionS = 1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().X;
resolutionT = -1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Y;
resolutionS = 1.f/Materials[i]->Texture[0].Size.X;
resolutionT = 1.f/Materials[i]->Texture[0].Size.Y;
}
// use the two-way planar mapping
SceneManager->getMeshManipulator()->makePlanarTextureMapping(Materials[i]->Meshbuffer, resolutionS, resolutionT, Materials[i]->Texture[0].Axis);
SceneManager->getMeshManipulator()->makePlanarTextureMapping(Materials[i]->Meshbuffer, resolutionS, resolutionT, Materials[i]->Texture[0].Axis, Materials[i]->Texture[0].Center);
}
// add bump maps