Added distance parameter to SetAngles.

This commit is contained in:
Leonardo Zide 2019-08-15 17:41:32 -07:00
parent 7c81198e7d
commit 1fef25a740
3 changed files with 4 additions and 4 deletions

View file

@ -1027,7 +1027,7 @@ void lcCamera::SetViewpoint(const lcVector3& Position)
UpdatePosition(1);
}
void lcCamera::SetAngles(float Latitude, float Longitude)
void lcCamera::SetAngles(float Latitude, float Longitude, float Distance)
{
mPosition = lcVector3(0, -1, 0);
mTargetPosition = lcVector3(0, 0, 0);
@ -1038,7 +1038,7 @@ void lcCamera::SetAngles(float Latitude, float Longitude)
lcVector3 SideVector = lcMul(lcVector3(-1, 0, 0), LongitudeMatrix);
lcMatrix33 LatitudeMatrix = lcMatrix33FromAxisAngle(SideVector, LC_DTOR * Latitude);
mPosition = lcMul(mPosition, LatitudeMatrix);
mPosition = lcMul(mPosition, LatitudeMatrix) * Distance;
mUpVector = lcMul(mUpVector, LatitudeMatrix);
ChangeKey(mPositionKeys, mPosition, 1, false);

View file

@ -287,7 +287,7 @@ public:
void SetViewpoint(lcViewpoint Viewpoint);
void SetViewpoint(const lcVector3& Position);
void GetAngles(float& Latitude, float& Longitude, float& Distance) const;
void SetAngles(float Latitude, float Longitude);
void SetAngles(float Latitude, float Longitude, float Distance);
char m_strName[81];

View file

@ -367,7 +367,7 @@ void View::SetCameraAngles(float Latitude, float Longitude)
mCamera->CopySettings(OldCamera);
}
mCamera->SetAngles(Latitude, Longitude);
mCamera->SetAngles(Latitude, Longitude, 1.0f);
ZoomExtents();
Redraw();
}