mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-02 09:45:33 +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 "";
|
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
|
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
|
||||||
/// (default implementation: return 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));
|
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
|
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 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;
|
void indexToPosition (int cellX, int cellY, float &x, float &y, bool centre = false) const;
|
||||||
///< Convert cell numbers to position.
|
///< Convert cell numbers to position.
|
||||||
|
|
Loading…
Reference in a new issue