class
#include <bn_sprite_affine_mat_ptr.h>
sprite_affine_mat_ptr std::shared_ptr like smart pointer that retains shared ownership of a sprite affine transformation matrix.
Several sprite_
The sprite affine transformation matrix is released when the last remaining sprite_
Public static functions
-
static auto create() -> sprite_
affine_ mat_ ptr - Creates an identity affine transformation matrix.
-
static auto create(const affine_
mat_ attributes& attributes) -> sprite_ affine_ mat_ ptr - Creates an affine transformation matrix with the specified attributes.
-
static auto create_optional() -> optional<sprite_
affine_ mat_ ptr> - Creates an identity affine transformation matrix.
-
static auto create_optional(const affine_
mat_ attributes& attributes) -> optional<sprite_ affine_ mat_ ptr> - Creates an affine transformation matrix with the specified attributes.
Constructors, destructors, conversion operators
-
sprite_affine_mat_ptr(const sprite_
affine_ mat_ ptr& other) - Copy constructor.
-
sprite_affine_mat_ptr(sprite_
affine_ mat_ ptr&& other) noexcept - Move constructor.
- ~sprite_affine_mat_ptr()
- Releases the referenced sprite affine transformation matrix if no more sprite_
affine_ mat_ ptr objects reference to it.
Public functions
-
auto operator=(const sprite_
affine_ mat_ ptr& other) -> sprite_ affine_ mat_ ptr& - Copy assignment operator.
-
auto operator=(sprite_
affine_ mat_ ptr&& other) -> sprite_ affine_ mat_ ptr& noexcept - Move assignment operator.
- auto id() const -> int
- Returns the internal id.
- auto rotation_angle() const -> fixed
- Returns the rotation angle in degrees.
- void set_rotation_angle(fixed rotation_angle)
- Sets the rotation angle in degrees.
- void set_rotation_angle_safe(fixed rotation_angle)
- Sets the rotation angle in degrees.
- auto horizontal_scale() const -> fixed
- Returns the horizontal scale.
- void set_horizontal_scale(fixed horizontal_scale)
- Sets the horizontal scale.
- auto vertical_scale() const -> fixed
- Returns the vertical scale.
- void set_vertical_scale(fixed vertical_scale)
- Sets the vertical scale.
- void set_scale(fixed scale)
- Sets the scale.
- void set_scale(fixed horizontal_scale, fixed vertical_scale)
- Sets the scale.
- auto horizontal_shear() const -> fixed
- Returns the horizontal shear.
- void set_horizontal_shear(fixed horizontal_shear)
- Sets the horizontal shear.
- auto vertical_shear() const -> fixed
- Returns the vertical shear.
- void set_vertical_shear(fixed vertical_shear)
- Sets the vertical shear.
- void set_shear(fixed shear)
- Sets the shear.
- void set_shear(fixed horizontal_shear, fixed vertical_shear)
- Sets the shear.
- auto horizontal_flip() const -> bool
- Indicates if this matrix is flipped in the horizontal axis or not.
- void set_horizontal_flip(bool horizontal_flip)
- Sets if this matrix is flipped in the horizontal axis or not.
- auto vertical_flip() const -> bool
- Indicates if this matrix is flipped in the vertical axis or not.
- void set_vertical_flip(bool vertical_flip)
- Sets if this matrix is flipped in the vertical axis or not.
-
auto attributes() const -> const affine_
mat_ attributes& - Returns the attributes of this matrix.
-
void set_attributes(const affine_
mat_ attributes& attributes) - Sets the attributes of this matrix.
- auto identity() const -> bool
- Indicates if this matrix is equal to the identity matrix or not.
- auto flipped_identity() const -> bool
- Indicates if this matrix is equal to the identity matrix or not, ignoring flip attributes.
-
void swap(sprite_
affine_ mat_ ptr& other) - Exchanges the contents of this sprite_
affine_ mat_ ptr with those of the other one.
Friends
-
void swap(sprite_
affine_ mat_ ptr& a, sprite_ affine_ mat_ ptr& b) - Exchanges the contents of a sprite_
affine_ mat_ ptr with those of another one. -
auto operator==(const sprite_
affine_ mat_ ptr& a, const sprite_ affine_ mat_ ptr& b) -> bool defaulted - Default equal operator.
Function documentation
static sprite_ affine_ mat_ ptr bn:: sprite_affine_mat_ptr:: create()
Creates an identity affine transformation matrix.
Returns | The requested sprite_ |
---|
static sprite_ affine_ mat_ ptr bn:: sprite_affine_mat_ptr:: create(const affine_ mat_ attributes& attributes)
Creates an affine transformation matrix with the specified attributes.
Parameters | |
---|---|
attributes | affine_ |
Returns | The requested sprite_ |
static optional<sprite_ affine_ mat_ ptr> bn:: sprite_affine_mat_ptr:: create_optional()
Creates an identity affine transformation matrix.
Returns | The requested sprite_ |
---|
static optional<sprite_ affine_ mat_ ptr> bn:: sprite_affine_mat_ptr:: create_optional(const affine_ mat_ attributes& attributes)
Creates an affine transformation matrix with the specified attributes.
Parameters | |
---|---|
attributes | affine_ |
Returns | The requested sprite_ |
bn:: sprite_affine_mat_ptr:: sprite_affine_mat_ptr(const sprite_ affine_ mat_ ptr& other)
Copy constructor.
Parameters | |
---|---|
other | sprite_ |
bn:: sprite_affine_mat_ptr:: sprite_affine_mat_ptr(sprite_ affine_ mat_ ptr&& other) noexcept
Move constructor.
Parameters | |
---|---|
other | sprite_ |
sprite_ affine_ mat_ ptr& bn:: sprite_affine_mat_ptr:: operator=(const sprite_ affine_ mat_ ptr& other)
Copy assignment operator.
Parameters | |
---|---|
other | sprite_ |
Returns | Reference to this. |
sprite_ affine_ mat_ ptr& bn:: sprite_affine_mat_ptr:: operator=(sprite_ affine_ mat_ ptr&& other) noexcept
Move assignment operator.
Parameters | |
---|---|
other | sprite_ |
Returns | Reference to this. |
void bn:: sprite_affine_mat_ptr:: set_rotation_angle(fixed rotation_angle)
Sets the rotation angle in degrees.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in the range [0..360]. |
void bn:: sprite_affine_mat_ptr:: set_rotation_angle_safe(fixed rotation_angle)
Sets the rotation angle in degrees.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in any range. |
void bn:: sprite_affine_mat_ptr:: swap(sprite_ affine_ mat_ ptr& other)
Exchanges the contents of this sprite_
Parameters | |
---|---|
other | sprite_ |
void swap(sprite_ affine_ mat_ ptr& a,
sprite_ affine_ mat_ ptr& b)
Exchanges the contents of a sprite_
Parameters | |
---|---|
a | First sprite_ |
b | Second sprite_ |