5#ifndef __IRR_DIMENSION2D_H_INCLUDED__
6#define __IRR_DIMENSION2D_H_INCLUDED__
55 return ! (*
this == other);
62 return !(*
this == other);
151 bool requirePowerOfTwo=
true,
152 bool requireSquare=
false,
154 u32 maxValue = 0)
const
158 if (requirePowerOfTwo)
162 if (!larger && i!=1 && i!=(
u32)
Width)
177 if ((larger && (i>j)) || (!larger && (i<j)))
183 if ( maxValue > 0 && i > maxValue)
186 if ( maxValue > 0 && j > maxValue)
198 f32 inv = (1.0f - d);
Specifies a 2 dimensional size.
Definition dimension2d.h:21
dimension2d< T > getOptimalSize(bool requirePowerOfTwo=true, bool requireSquare=false, bool larger=true, u32 maxValue=0) const
Get the optimal size according to some properties.
Definition dimension2d.h:150
f32 Width
Definition dimension2d.h:204
dimension2d< T > operator/(const T &scale) const
Divide width and height by scalar.
Definition dimension2d.h:82
dimension2d< T > & operator/=(const T &scale)
Divide width and height by scalar.
Definition dimension2d.h:74
T getArea() const
Get area.
Definition dimension2d.h:130
dimension2d(const dimension2d< U > &other)
Use this constructor only where you are sure that the conversion is valid.
Definition dimension2d.h:33
dimension2d< T > operator+(const dimension2d< T > &other) const
Add two dimensions.
Definition dimension2d.h:110
dimension2d< T > & set(const T &width, const T &height)
Set to new values.
Definition dimension2d.h:66
bool operator!=(const dimension2d< T > &other) const
Inequality operator.
Definition dimension2d.h:53
f32 Height
Definition dimension2d.h:206
dimension2d(const T &width, const T &height)
Constructor with width and height.
Definition dimension2d.h:26
dimension2d< T > getInterpolated(const dimension2d< T > &other, f32 d) const
Get the interpolated dimension.
Definition dimension2d.h:196
dimension2d< T > & operator-=(const dimension2d< T > &other)
Subtract a dimension from this one.
Definition dimension2d.h:116
dimension2d< T > & operator+=(const dimension2d< T > &other)
Add another dimension to this one.
Definition dimension2d.h:102
bool operator==(const dimension2d< T > &other) const
Equality operator.
Definition dimension2d.h:46
dimension2d< T > operator-(const dimension2d< T > &other) const
Subtract one dimension from another.
Definition dimension2d.h:124
dimension2d< T > operator*(const T &scale) const
Multiply width and height by scalar.
Definition dimension2d.h:96
dimension2d()
Default constructor for empty dimension.
Definition dimension2d.h:24
dimension2d< T > & operator*=(const T &scale)
Multiply width and height by scalar.
Definition dimension2d.h:88
2d vector template class with lots of operators and methods.
Definition vector2d.h:22
Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.
Definition aabbox3d.h:15
bool equals(const f64 a, const f64 b, const f64 tolerance=ROUNDING_ERROR_f64)
returns if a equals b, taking possible rounding errors into account
Definition irrMath.h:185
dimension2d< s32 > dimension2di
Typedef for an integer dimension.
Definition dimension2d.h:217
dimension2d< u32 > dimension2du
Typedef for an unsigned integer dimension.
Definition dimension2d.h:212
dimension2d< f32 > dimension2df
Typedef for an f32 dimension.
Definition dimension2d.h:210
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33
float f32
32 bit floating point variable.
Definition irrTypes.h:104
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58