36 const float safeWidth = std::max(0.0f, width);
42 const float safeHeight = std::max(0.0f, height);
47 const bool changed = std::abs(safeWidth -
domainWidth_) > 1.0e-6f ||
123 u = std::max(0.0, std::min(1.0, u));
128 v = std::max(0.0, std::min(1.0, v));
130 float anchorX = 0.0f;
131 float anchorY = 0.0f;
146 const float newZoom = std::max(1.0f, std::min(
maxZoom(),
zoom_ * factor));
147 if (std::abs(newZoom -
zoom_) <= 1.0e-6f) {
215 u = vw > 0.0f ?
static_cast<double>((x -
centerX_) / vw) + 0.5 : 0.5;
216 v = vh > 0.0f ?
static_cast<double>((y -
centerY_) / vh) + 0.5 : 0.5;
Implements the Quantum View Camera2D component.
float domainWidth() const
Carries out domain width.
void panPhysical(float dx, float dy)
Carries out clamp center.
float textureOffsetY() const
Performs texture offset y.
float centerY() const
Carries out center y.
void setDomain(float width, float height)
Sets domain.
void normalizedFromPhysical(float x, float y, double &u, double &v) const
Returns normalized from physical.
void reset()
Resets the component to its initial state.
float textureScaleY() const
Carries out texture scale y.
float maxZoom() const
Carries out max zoom.
bool zoomAtNormalized(float factor, double u, double v)
Carries out max.
float centerX() const
Carries out center x.
void clampCenter()
Performs clamp center.
float textureOffsetX() const
Carries out max.
float textureScaleX() const
Carries out texture scale x.
float viewWidth() const
Carries out view width.
float domainHeight() const
Carries out domain height.
float zoom() const
Carries out zoom.
float viewHeight() const
Carries out view height.
void physicalFromNormalized(double u, double v, float &x, float &y) const
Carries out physical from normalized.