mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 04:49:54 +00:00
28 lines
654 B
C++
28 lines
654 B
C++
#include "mouselookevent.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
#include "../mwbase/world.hpp"
|
|
|
|
#include "../mwworld/player.hpp"
|
|
|
|
#include <OIS/OIS.h>
|
|
#include <OgreCamera.h>
|
|
#include <OgreSceneNode.h>
|
|
|
|
using namespace OIS;
|
|
using namespace MWInput;
|
|
|
|
void MouseLookEvent::event(Type type, int index, const void *p)
|
|
{
|
|
if (type != EV_MouseMove || mDisabled) {
|
|
return;
|
|
}
|
|
|
|
MouseEvent *arg = (MouseEvent*)(p);
|
|
|
|
float x = arg->state.X.rel * sensX;
|
|
float y = arg->state.Y.rel * sensY;
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
world->rotateObject(world->getPlayer().getPlayer(), -y, 0.f, -x, true);
|
|
}
|