1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 21:45:32 +00:00

Add ability to set orbit camera center outside of class.

This commit is contained in:
Aesylwinn 2016-04-03 16:30:50 -04:00
parent 02f991c63e
commit 4ef9981544
2 changed files with 20 additions and 0 deletions

View file

@ -367,6 +367,11 @@ namespace CSVRender
{
}
osg::Vec3d OrbitCameraController::getCenter() const
{
return mCenter;
}
double OrbitCameraController::getOrbitSpeed() const
{
return mOrbitSpeed;
@ -382,6 +387,19 @@ namespace CSVRender
return mPickingMask;
}
void OrbitCameraController::setCenter(const osg::Vec3d& value)
{
osg::Vec3d eye, center, up;
getCamera()->getViewMatrixAsLookAt(eye, center, up);
mCenter = value;
mDistance = (eye - mCenter).length();
getCamera()->setViewMatrixAsLookAt(eye, mCenter, up);
mInitialized = true;
}
void OrbitCameraController::setOrbitSpeed(double value)
{
mOrbitSpeed = value;

View file

@ -113,10 +113,12 @@ namespace CSVRender
OrbitCameraController();
osg::Vec3d getCenter() const;
double getOrbitSpeed() const;
double getOrbitSpeedMultiplier() const;
unsigned int getPickingMask() const;
void setCenter(const osg::Vec3d& center);
void setOrbitSpeed(double value);
void setOrbitSpeedMultiplier(double value);
void setPickingMask(unsigned int value);