diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index d235192817..6e9b1e5835 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -500,6 +500,22 @@ namespace MWScript } }; + template + class OpSetScale : public Interpreter::Opcode0 + { + public: + + virtual void execute (Interpreter::Runtime& runtime) + { + MWWorld::Ptr ptr = R()(runtime); + + Interpreter::Type_Float scale = runtime[0].mInteger; + runtime.pop(); + + MWBase::Environment::get().getWorld()->scaleObject(ptr,scale); + } + }; + const int numberOfAttributes = 8; const int opcodeGetAttribute = 0x2000027; diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index 6be4a13bac..2a33325933 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -619,13 +619,17 @@ namespace MWWorld scale = scale/ptr.getRefData().getBaseNode()->getScale().x; ptr.getRefData().getBaseNode()->setScale(scale,scale,scale); mPhysics->scaleObject( Class::get(ptr).getId(ptr), scale ); - /// \todo cell change for non-player ref - - //mRendering->moveObject (ptr, Ogre::Vector3 (x, y, z)); } void World::rotateObject (Ptr ptr,float x,float y,float z) { + MWWorld::Class::get(ptr).adjustRotation(ptr,x,y,z); + + ptr.getRefData().getPosition().rot[0] = x; + ptr.getRefData().getPosition().rot[0] = y; + ptr.getRefData().getPosition().rot[0] = z; + //ptr.getRefData().getBaseNode()->rotate(ptr.getRefData().getBaseNode()->get + //mPhysics->scaleObject( Class::get(ptr).getId(ptr), scale ); } void World::indexToPosition (int cellX, int cellY, float &x, float &y, bool centre) const