mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:53:51 +00:00
Scale *should* work. (no script instruction yet)
This commit is contained in:
parent
dac98b2213
commit
51b6d5cae0
4 changed files with 24 additions and 5 deletions
|
@ -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…
Reference in a new issue