mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Add ability to set orbit camera center outside of class.
This commit is contained in:
parent
02f991c63e
commit
4ef9981544
2 changed files with 20 additions and 0 deletions
|
@ -367,6 +367,11 @@ namespace CSVRender
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osg::Vec3d OrbitCameraController::getCenter() const
|
||||||
|
{
|
||||||
|
return mCenter;
|
||||||
|
}
|
||||||
|
|
||||||
double OrbitCameraController::getOrbitSpeed() const
|
double OrbitCameraController::getOrbitSpeed() const
|
||||||
{
|
{
|
||||||
return mOrbitSpeed;
|
return mOrbitSpeed;
|
||||||
|
@ -382,6 +387,19 @@ namespace CSVRender
|
||||||
return mPickingMask;
|
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)
|
void OrbitCameraController::setOrbitSpeed(double value)
|
||||||
{
|
{
|
||||||
mOrbitSpeed = value;
|
mOrbitSpeed = value;
|
||||||
|
|
|
@ -113,10 +113,12 @@ namespace CSVRender
|
||||||
|
|
||||||
OrbitCameraController();
|
OrbitCameraController();
|
||||||
|
|
||||||
|
osg::Vec3d getCenter() const;
|
||||||
double getOrbitSpeed() const;
|
double getOrbitSpeed() const;
|
||||||
double getOrbitSpeedMultiplier() const;
|
double getOrbitSpeedMultiplier() const;
|
||||||
unsigned int getPickingMask() const;
|
unsigned int getPickingMask() const;
|
||||||
|
|
||||||
|
void setCenter(const osg::Vec3d& center);
|
||||||
void setOrbitSpeed(double value);
|
void setOrbitSpeed(double value);
|
||||||
void setOrbitSpeedMultiplier(double value);
|
void setOrbitSpeedMultiplier(double value);
|
||||||
void setPickingMask(unsigned int value);
|
void setPickingMask(unsigned int value);
|
||||||
|
|
Loading…
Reference in a new issue