mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-16 08:27:01 +00:00
Created application class to manage editor windows, improved camera AABox orbit
This commit is contained in:
@@ -154,21 +154,12 @@ void CCamera::SetOrbit(const CVector3f& OrbitTarget, float Distance)
|
||||
}
|
||||
}
|
||||
|
||||
void CCamera::SetOrbit(const CAABox& OrbitTarget, float DistScale /*= 4.f*/)
|
||||
void CCamera::SetOrbit(const CAABox& OrbitTarget, float DistScale /*= 1.75f*/)
|
||||
{
|
||||
CVector3f Min = OrbitTarget.Min();
|
||||
CVector3f Max = OrbitTarget.Max();
|
||||
|
||||
mOrbitTarget = OrbitTarget.Center();
|
||||
|
||||
// Find largest extent
|
||||
CVector3f Extent = (Max - Min) / 2.f;
|
||||
float Dist = 0.f;
|
||||
|
||||
if (Extent.X >= Extent.Y && Extent.X >= Extent.Z) Dist = Extent.X;
|
||||
else if (Extent.Y >= Extent.X && Extent.Y >= Extent.Z) Dist = Extent.Y;
|
||||
else Dist = Extent.Z;
|
||||
|
||||
// Determine orbit radius, which should be enough to cover the entire box with some buffer room
|
||||
float Dist = OrbitTarget.Center().Distance(OrbitTarget.Max());
|
||||
mOrbitDistance = Dist * DistScale;
|
||||
|
||||
if (mMode == eOrbitCamera)
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
void SetMoveMode(ECameraMoveMode Mode);
|
||||
void SetOrbit(const CVector3f& rkOrbitTarget, float Distance);
|
||||
void SetOrbit(const CAABox& rkOrbitTarget, float DistScale = 4.f);
|
||||
void SetOrbit(const CAABox& rkOrbitTarget, float DistScale = 1.75f);
|
||||
void SetOrbitTarget(const CVector3f& rkOrbitTarget);
|
||||
void SetOrbitDistance(float Distance);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user