Scale *should* work. (no script instruction yet)

actorid
gugus 13 years ago
parent dac98b2213
commit 51b6d5cae0

@ -203,8 +203,11 @@ namespace MWWorld
return "";
}
void adjustScale(float& x, float& y, float& z)
void Class::adjustScale(const MWWorld::Ptr& ptr,float& scale) const
{
}
void Class::adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const
{
}
}

@ -197,7 +197,9 @@ namespace MWWorld
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
/// (default implementation: return empty string)
virtual void adjustScale(float& x, float& y, float& z);
virtual void adjustScale(const MWWorld::Ptr& ptr,float& scale) const;
virtual void adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const;
};
}

@ -611,9 +611,21 @@ namespace MWWorld
mPhysics->moveObject (ptr.getRefData().getHandle(), Ogre::Vector3 (x, y, z));
}
void World::scaleObject (Ptr ptr, float x, float y, float z)
void World::scaleObject (Ptr ptr, float scale)
{
MWWorld::Class::get(ptr).adjustScale(ptr,scale);
ptr.getCellRef().scale = scale;
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).adjustScale(x,y,z);
}
void World::indexToPosition (int cellX, int cellY, float &x, float &y, bool centre) const

@ -222,7 +222,9 @@ namespace MWWorld
void moveObject (Ptr ptr, float x, float y, float z);
void scaleObject (Ptr ptr, float x, float y, float z);
void scaleObject (Ptr ptr, float scale);
void rotateObject (Ptr ptr,float x,float y,float z);
void indexToPosition (int cellX, int cellY, float &x, float &y, bool centre = false) const;
///< Convert cell numbers to position.

Loading…
Cancel
Save