diff --git a/src/Client/GUI/CM2MeshFileLoader.cpp b/src/Client/GUI/CM2MeshFileLoader.cpp index 297ed20..ebe4a04 100644 --- a/src/Client/GUI/CM2MeshFileLoader.cpp +++ b/src/Client/GUI/CM2MeshFileLoader.cpp @@ -211,7 +211,7 @@ if(M2Vertices.size()>0) for(u32 i=0;igetMaterial().MaterialType=video::EMT_TRANSPARENT_ALPHA_CHANNEL; } +IMB->recalculateBoundingBox(); Mesh->addMeshBuffer(IMB); IMB->drop(); //std::cout << "Mesh now has "<getMeshBufferCount()<<" Buffers\n"; } - +Device->getSceneManager()->getMeshManipulator()->flipSurfaces(Mesh); //Fix inverted surfaces after the rotation +Device->getSceneManager()->getMeshManipulator()->recalculateNormals(Mesh,true);//just to be sure aniMesh= new SAnimatedMesh(); aniMesh->addMesh(Mesh); Mesh->drop(); diff --git a/src/Client/GUI/DrawObject.cpp b/src/Client/GUI/DrawObject.cpp index e08ab5a..b46521b 100644 --- a/src/Client/GUI/DrawObject.cpp +++ b/src/Client/GUI/DrawObject.cpp @@ -55,9 +55,6 @@ void DrawObject::_Init(void) scene::IAnimatedMesh *mesh = _smgr->getMesh(modelfile.c_str()); if(mesh) { - rotation.X = 270.0f; // M2 models are stored "lying on the side" - this puts them standing - // ok, this f*cks up the text scene node, but shouldnt be such a problem right now, - // until the M2-loader has been corrected so far that this line can be removed cube = _smgr->addAnimatedMeshSceneNode(mesh); //video::ITexture *tex = _device->getVideoDriver()->getTexture("data/misc/square.jpg"); //cube->setMaterialTexture(0, tex); diff --git a/src/Client/GUI/SceneWorld.cpp b/src/Client/GUI/SceneWorld.cpp index e778fcc..2c95c4a 100644 --- a/src/Client/GUI/SceneWorld.cpp +++ b/src/Client/GUI/SceneWorld.cpp @@ -303,7 +303,7 @@ void SceneWorld::UpdateTerrain(void) if(doodad) { doodad->setPosition(core::vector3df(-d->x, d->z, -d->y)); - doodad->setRotation(core::vector3df(270-d->ox, -d->oy-90, -d->oz)); // +270 solves M2 models lying on the side + doodad->setRotation(core::vector3df(-d->ox, -d->oy-90, -d->oz)); // +270 solves M2 models lying on the side } } }