Commit 5266da90 authored by hybrid's avatar hybrid

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
parent 54340781
...@@ -343,20 +343,20 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file) ...@@ -343,20 +343,20 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file)
} }
} }
// get the resolution for this axis // get the resolution for this axis
f32 resolutionS = 1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Y; f32 resolutionS = 1.f/Materials[i]->Texture[0].Size.Z;
f32 resolutionT = -1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Z; f32 resolutionT = 1.f/Materials[i]->Texture[0].Size.Y;
if (Materials[i]->Texture[0].Axis==1) if (Materials[i]->Texture[0].Axis==1)
{ {
resolutionS = 1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().X; resolutionS = 1.f/Materials[i]->Texture[0].Size.X;
resolutionT = -1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Z; resolutionT = 1.f/Materials[i]->Texture[0].Size.Z;
} }
else if (Materials[i]->Texture[0].Axis==2) else if (Materials[i]->Texture[0].Axis==2)
{ {
resolutionS = 1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().X; resolutionS = 1.f/Materials[i]->Texture[0].Size.X;
resolutionT = -1.f/Materials[i]->Meshbuffer->getBoundingBox().getExtent().Y; resolutionT = 1.f/Materials[i]->Texture[0].Size.Y;
} }
// use the two-way planar mapping // 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 // add bump maps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment