class
#include <bn_affine_bg_mat_attributes.h>
affine_bg_mat_attributes Contains the attributes which define the position and the transformation matrix of an affine background.
Constructors, destructors, conversion operators
- affine_bg_mat_attributes() defaulted constexpr
- Default constructor.
-
affine_bg_mat_attributes(const fixed_
point& position, const fixed_ size& half_dimensions, const fixed_ point& pivot_position, const affine_ mat_ attributes& mat_attributes) constexpr - Constructor.
Public functions
- auto x() const -> fixed constexpr
- Returns the horizontal absolute position of the affine background (ignoring its camera).
- void set_x(fixed x) constexpr
- Sets the horizontal absolute position of the affine background (ignoring its camera).
- auto y() const -> fixed constexpr
- Returns the absolute vertical position of the affine background (ignoring its camera).
- void set_y(fixed y) constexpr
- Sets the absolute vertical position of the affine background (ignoring its camera).
-
auto position() const -> const fixed_
point& constexpr - Returns the absolute position of the affine background (ignoring its camera).
- void set_position(fixed x, fixed y) constexpr
- Sets the absolute position of the affine background (ignoring its camera).
-
void set_position(const fixed_
point& position) constexpr - Sets the absolute position of the affine background (ignoring its camera).
- auto top_left_x() const -> fixed constexpr
- Returns the horizontal absolute top-left position of the affine background (ignoring its camera).
- void set_top_left_x(fixed top_left_x) constexpr
- Sets the horizontal absolute top-left position of the affine background (ignoring its camera).
- auto top_left_y() const -> fixed constexpr
- Returns the absolute vertical top-left position of the affine background (ignoring its camera).
- void set_top_left_y(fixed top_left_y) constexpr
- Sets the absolute vertical top-left position of the affine background (ignoring its camera).
-
auto top_left_position() const -> fixed_
point constexpr - Returns the absolute top-left position of the affine background (ignoring its camera).
- void set_top_left_position(fixed top_left_x, fixed top_left_y) constexpr
- Sets the absolute top-left position of the affine background (ignoring its camera).
-
void set_top_left_position(const fixed_
point& top_left_position) constexpr - Sets the absolute top-left position of the affine background (ignoring its camera).
-
auto half_dimensions() const -> const fixed_
size& constexpr - Returns the half of the affine background size.
-
void set_half_dimensions(const fixed_
size& half_dimensions) constexpr - Sets the half of the affine background size.
- auto pivot_x() const -> fixed constexpr
- Returns the horizontal position of the affine transformations pivot point.
- void set_pivot_x(fixed pivot_x) constexpr
- Sets the horizontal position of the affine transformations pivot point.
- auto pivot_y() const -> fixed constexpr
- Returns the vertical position of the affine transformations pivot point.
- void set_pivot_y(fixed pivot_y) constexpr
- Sets the vertical position of the affine transformations pivot point.
-
auto pivot_position() const -> const fixed_
point& constexpr - Returns the position of the affine transformations pivot point.
- void set_pivot_position(fixed pivot_x, fixed pivot_y) constexpr
- Sets the position of the affine transformations pivot point.
-
void set_pivot_position(const fixed_
point& pivot_position) constexpr - Sets the position of the affine transformations pivot point.
- auto rotation_angle() const -> fixed constexpr
- Returns the rotation angle in degrees.
- void set_rotation_angle(fixed rotation_angle) constexpr
- Sets the rotation angle in degrees.
- void set_rotation_angle_safe(fixed rotation_angle) constexpr
- Sets the rotation angle in degrees.
- auto horizontal_scale() const -> fixed constexpr
- Returns the horizontal scale.
- void set_horizontal_scale(fixed horizontal_scale) constexpr
- Sets the horizontal scale.
- auto vertical_scale() const -> fixed constexpr
- Returns the vertical scale.
- void set_vertical_scale(fixed vertical_scale) constexpr
- Sets the vertical scale.
- void set_scale(fixed scale) constexpr
- Sets the scale.
- void set_scale(fixed horizontal_scale, fixed vertical_scale) constexpr
- Sets the scale.
- auto horizontal_shear() const -> fixed constexpr
- Returns the horizontal shear.
- void set_horizontal_shear(fixed horizontal_shear) constexpr
- Sets the horizontal shear.
- auto vertical_shear() const -> fixed constexpr
- Returns the vertical shear.
- void set_vertical_shear(fixed vertical_shear) constexpr
- Sets the vertical shear.
- void set_shear(fixed shear) constexpr
- Sets the shear.
- void set_shear(fixed horizontal_shear, fixed vertical_shear) constexpr
- Sets the shear.
- auto horizontal_flip() const -> bool constexpr
- Indicates if this matrix is flipped in the horizontal axis or not.
- void set_horizontal_flip(bool horizontal_flip) constexpr
- Sets if this matrix is flipped in the horizontal axis or not.
- auto vertical_flip() const -> bool constexpr
- Indicates if this matrix is flipped in the vertical axis or not.
- void set_vertical_flip(bool vertical_flip) constexpr
- Sets if this matrix is flipped in the vertical axis or not.
-
auto mat_attributes() const -> const affine_
mat_ attributes& constexpr - Returns the attributes which define the base affine transformation matrix.
-
void set_mat_attributes(const affine_
mat_ attributes& mat_attributes) constexpr - Sets the attributes which define the base affine transformation matrix.
- auto pa_register_value() const -> int constexpr
- Returns the value to commit to the first GBA register of an affine background transformation matrix with these attributes.
- auto pb_register_value() const -> int constexpr
- Returns the value to commit to the second GBA register of an affine background transformation matrix with these attributes.
- auto pc_register_value() const -> int constexpr
- Returns the value to commit to the third GBA register of an affine background transformation matrix with these attributes.
- auto pd_register_value() const -> int constexpr
- Returns the value to commit to the fourth GBA register of an affine background transformation matrix with these attributes.
- auto dx_register_value() const -> int constexpr
- Returns the value to commit to the fifth GBA register of an affine background transformation matrix with these attributes.
- auto dy_register_value() const -> int constexpr
- Returns the value to commit to the fifth GBA register of an affine background transformation matrix with these attributes.
Friends
-
auto operator==(const affine_
bg_ mat_ attributes& a, const affine_ bg_ mat_ attributes& b) -> bool constexpr - Equal operator.
Function documentation
bn:: affine_bg_mat_attributes:: affine_bg_mat_attributes(const fixed_ point& position,
const fixed_ size& half_dimensions,
const fixed_ point& pivot_position,
const affine_ mat_ attributes& mat_attributes) constexpr
Constructor.
Parameters | |
---|---|
position | Affine background absolute position (ignoring its camera). |
half_dimensions | Half of the affine background size. |
pivot_position | Position of the affine transformations pivot point. |
mat_attributes | Attributes which define the base affine transformation matrix. |
void bn:: affine_bg_mat_attributes:: set_position(fixed x,
fixed y) constexpr
Sets the absolute position of the affine background (ignoring its camera).
Parameters | |
---|---|
x | Horizontal absolute position of the affine background. |
y | Vertical absolute position of the affine background. |
void bn:: affine_bg_mat_attributes:: set_position(const fixed_ point& position) constexpr
Sets the absolute position of the affine background (ignoring its camera).
Parameters | |
---|---|
position | Absolute position of the affine background. |
void bn:: affine_bg_mat_attributes:: set_top_left_position(fixed top_left_x,
fixed top_left_y) constexpr
Sets the absolute top-left position of the affine background (ignoring its camera).
Parameters | |
---|---|
top_left_x | Horizontal absolute top-left position of the affine background. |
top_left_y | Vertical absolute top-left position of the affine background. |
void bn:: affine_bg_mat_attributes:: set_top_left_position(const fixed_ point& top_left_position) constexpr
Sets the absolute top-left position of the affine background (ignoring its camera).
Parameters | |
---|---|
top_left_position | Absolute top-left position of the affine background. |
void bn:: affine_bg_mat_attributes:: set_pivot_position(fixed pivot_x,
fixed pivot_y) constexpr
Sets the position of the affine transformations pivot point.
Parameters | |
---|---|
pivot_x | Horizontal position of the pivot point. |
pivot_y | Vertical position of the pivot point. |
void bn:: affine_bg_mat_attributes:: set_pivot_position(const fixed_ point& pivot_position) constexpr
Sets the position of the affine transformations pivot point.
Parameters | |
---|---|
pivot_position | Position of the pivot point. |
void bn:: affine_bg_mat_attributes:: set_rotation_angle(fixed rotation_angle) constexpr
Sets the rotation angle in degrees.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in the range [0..360]. |
void bn:: affine_bg_mat_attributes:: set_rotation_angle_safe(fixed rotation_angle) constexpr
Sets the rotation angle in degrees.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in any range. |
bool operator==(const affine_ bg_ mat_ attributes& a,
const affine_ bg_ mat_ attributes& b) constexpr
Equal operator.
Parameters | |
---|---|
a | First affine_ |
b | Second affine_ |
Returns | true if the first affine_false . |