some work for rotation/scaling

actorid
gugus 13 years ago
parent 51b6d5cae0
commit 77084b27c0

@ -500,6 +500,22 @@ namespace MWScript
}
};
template<class R>
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;

@ -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

Loading…
Cancel
Save