mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Added distance parameter to SetAngles.
This commit is contained in:
parent
7c81198e7d
commit
1fef25a740
3 changed files with 4 additions and 4 deletions
|
@ -1027,7 +1027,7 @@ void lcCamera::SetViewpoint(const lcVector3& Position)
|
||||||
UpdatePosition(1);
|
UpdatePosition(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcCamera::SetAngles(float Latitude, float Longitude)
|
void lcCamera::SetAngles(float Latitude, float Longitude, float Distance)
|
||||||
{
|
{
|
||||||
mPosition = lcVector3(0, -1, 0);
|
mPosition = lcVector3(0, -1, 0);
|
||||||
mTargetPosition = lcVector3(0, 0, 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);
|
lcVector3 SideVector = lcMul(lcVector3(-1, 0, 0), LongitudeMatrix);
|
||||||
lcMatrix33 LatitudeMatrix = lcMatrix33FromAxisAngle(SideVector, LC_DTOR * Latitude);
|
lcMatrix33 LatitudeMatrix = lcMatrix33FromAxisAngle(SideVector, LC_DTOR * Latitude);
|
||||||
mPosition = lcMul(mPosition, LatitudeMatrix);
|
mPosition = lcMul(mPosition, LatitudeMatrix) * Distance;
|
||||||
mUpVector = lcMul(mUpVector, LatitudeMatrix);
|
mUpVector = lcMul(mUpVector, LatitudeMatrix);
|
||||||
|
|
||||||
ChangeKey(mPositionKeys, mPosition, 1, false);
|
ChangeKey(mPositionKeys, mPosition, 1, false);
|
||||||
|
|
|
@ -287,7 +287,7 @@ public:
|
||||||
void SetViewpoint(lcViewpoint Viewpoint);
|
void SetViewpoint(lcViewpoint Viewpoint);
|
||||||
void SetViewpoint(const lcVector3& Position);
|
void SetViewpoint(const lcVector3& Position);
|
||||||
void GetAngles(float& Latitude, float& Longitude, float& Distance) const;
|
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];
|
char m_strName[81];
|
||||||
|
|
||||||
|
|
|
@ -367,7 +367,7 @@ void View::SetCameraAngles(float Latitude, float Longitude)
|
||||||
mCamera->CopySettings(OldCamera);
|
mCamera->CopySettings(OldCamera);
|
||||||
}
|
}
|
||||||
|
|
||||||
mCamera->SetAngles(Latitude, Longitude);
|
mCamera->SetAngles(Latitude, Longitude, 1.0f);
|
||||||
ZoomExtents();
|
ZoomExtents();
|
||||||
Redraw();
|
Redraw();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue