5#ifndef NIRT_DIMENSION2D_HPP_INCLUDED
6#define NIRT_DIMENSION2D_HPP_INCLUDED
8#include <nirtcpp/core/engine/nirt_types.hpp>
9#include <nirtcpp/core/engine/irrMath.hpp>
55 return ! (*
this ==
other);
62 return !(*
this ==
other);
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Specifies a 2 dimensional size.
Definition dimension2d.hpp:21
dimension2d< T > operator-(const dimension2d< T > &other) const
Subtract one dimension from another.
Definition dimension2d.hpp:124
dimension2d< T > operator+(const dimension2d< T > &other) const
Add two dimensions.
Definition dimension2d.hpp:110
dimension2d< T > & operator*=(const T &scale)
Multiply width and height by scalar.
Definition dimension2d.hpp:88
dimension2d< T > & operator/=(const T &scale)
Divide width and height by scalar.
Definition dimension2d.hpp:74
T getArea() const
Get area.
Definition dimension2d.hpp:130
dimension2d< T > operator/(const T &scale) const
Divide width and height by scalar.
Definition dimension2d.hpp:82
T Height
Height of the dimension.
Definition dimension2d.hpp:206
bool operator!=(const dimension2d< T > &other) const
Inequality operator.
Definition dimension2d.hpp:53
bool operator==(const dimension2d< T > &other) const
Equality operator.
Definition dimension2d.hpp:46
dimension2d< T > & operator-=(const dimension2d< T > &other)
Subtract a dimension from this one.
Definition dimension2d.hpp:116
dimension2d()
Default constructor for empty dimension.
Definition dimension2d.hpp:24
dimension2d< T > operator*(const T &scale) const
Multiply width and height by scalar.
Definition dimension2d.hpp:96
T Width
Width of the dimension.
Definition dimension2d.hpp:204
dimension2d(const dimension2d< U > &other)
Use this constructor only where you are sure that the conversion is valid.
Definition dimension2d.hpp:33
dimension2d< T > & set(const T &width, const T &height)
Set to new values.
Definition dimension2d.hpp:66
dimension2d< T > & operator+=(const dimension2d< T > &other)
Add another dimension to this one.
Definition dimension2d.hpp:102
dimension2d(const T &width, const T &height)
Constructor with width and height.
Definition dimension2d.hpp:26
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.hpp:150
dimension2d< T > getInterpolated(const dimension2d< T > &other, f32 d) const
Get the interpolated dimension.
Definition dimension2d.hpp:196
bool equals(const T a, const T b, const T tolerance=roundingError< T >())
returns if a equals b, taking possible rounding errors into account
Definition irrMath.hpp:243
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110