removed some redundant code, added some comments

actorid
greye 13 years ago
parent 38b06aee6c
commit 5018db3332

@ -28,6 +28,8 @@ namespace MWRender
bool mVanityModeEnabled;
void controlFlip();
/// Updates sound manager listener data
void updateListener();
public:
@ -35,11 +37,17 @@ namespace MWRender
Player (Ogre::Camera *camera, Ogre::SceneNode* mNode);
/// Set where the player is looking at. Uses Morrowind (euler) angles
/// \return true if player object needs to bo rotated physically
bool setRotation(const Ogre::Vector3 &rot);
/// \return true if player object needs to bo rotated physically
bool adjustRotation(const Ogre::Vector3 &rot);
std::string getHandle() const;
/// Attach camera to object
/// \note there is no protection from attaching the same camera to
/// several different objects
void attachTo(const MWWorld::Ptr &);
void toggleViewMode() {

@ -85,6 +85,10 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
void moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position);
void scaleObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& scale);
/// Rotates object accordingly to its type
/// \param adjust indicates should rotation be set or adjusted
/// \return true if object needs to be rotated physically
bool rotateObject (const MWWorld::Ptr& ptr, Ogre::Vector3 &rot, bool adjust = false);
void setWaterHeight(const float height);

@ -140,19 +140,18 @@ namespace MWWorld
const ESM::Position& pos,
bool adjustPlayerPos)
{
MWBase::Environment::get().getWorld()->getPlayer().setCell (cell);
bool hasWater = cell->cell->data.flags & cell->cell->HasWater;
mPhysics->setCurrentWater(hasWater, cell->cell->water);
MWBase::World *world = MWBase::Environment::get().getWorld();
world->getPlayer().setCell(cell);
MWWorld::Ptr player = world->getPlayer().getPlayer();
if (adjustPlayerPos) {
world->moveObject(player, pos.pos[0], pos.pos[1], pos.pos[2]);
world->rotateObject(player, pos.rot[0], pos.rot[1], pos.rot[2]);
}
world->getPlayer().setCell(cell);
MWMechanics::MechanicsManager *mechMgr =
MWBase::Environment::get().getMechanicsManager();

Loading…
Cancel
Save