|
(Note that these are not member symbols.)
|
| constexpr bool | operator== (Angle left, Angle right) |
| | Overload of == operator to compare two angle values.
|
| constexpr bool | operator!= (Angle left, Angle right) |
| | Overload of != operator to compare two angle values.
|
| constexpr bool | operator< (Angle left, Angle right) |
| | Overload of < operator to compare two angle values.
|
| constexpr bool | operator> (Angle left, Angle right) |
| | Overload of > operator to compare two angle values.
|
| constexpr bool | operator<= (Angle left, Angle right) |
| | Overload of <= operator to compare two angle values.
|
| constexpr bool | operator>= (Angle left, Angle right) |
| | Overload of >= operator to compare two angle values.
|
| constexpr Angle | operator- (Angle right) |
| | Overload of unary - operator to negate an angle value.
|
| constexpr Angle | operator+ (Angle left, Angle right) |
| | Overload of binary + operator to add two angle values.
|
| constexpr Angle & | operator+= (Angle &left, Angle right) |
| | Overload of binary += operator to add/assign two angle values.
|
| constexpr Angle | operator- (Angle left, Angle right) |
| | Overload of binary - operator to subtract two angle values.
|
| constexpr Angle & | operator-= (Angle &left, Angle right) |
| | Overload of binary -= operator to subtract/assign two angle values.
|
| constexpr Angle | operator* (Angle left, float right) |
| | Overload of binary * operator to scale an angle value.
|
| constexpr Angle | operator* (float left, Angle right) |
| | Overload of binary * operator to scale an angle value.
|
| constexpr Angle & | operator*= (Angle &left, float right) |
| | Overload of binary *= operator to scale/assign an angle value.
|
| constexpr Angle | operator/ (Angle left, float right) |
| | Overload of binary / operator to scale an angle value.
|
| constexpr Angle & | operator/= (Angle &left, float right) |
| | Overload of binary /= operator to scale/assign an angle value.
|
| constexpr float | operator/ (Angle left, Angle right) |
| | Overload of binary / operator to compute the ratio of two angle values.
|
| constexpr Angle | operator% (Angle left, Angle right) |
| | Overload of binary % operator to compute modulo of an angle value.
|
| constexpr Angle & | operator%= (Angle &left, Angle right) |
| | Overload of binary %= operator to compute/assign remainder of an angle value.
|
| constexpr Angle | operator""_deg (long double angle) |
| | User defined literal for angles in degrees, e.g. 10.5_deg.
|
| constexpr Angle | operator""_deg (unsigned long long int angle) |
| | User defined literal for angles in degrees, e.g. 90_deg.
|
| constexpr Angle | operator""_rad (long double angle) |
| | User defined literal for angles in radians, e.g. 0.1_rad.
|
| constexpr Angle | operator""_rad (unsigned long long int angle) |
| | User defined literal for angles in radians, e.g. 2_rad.
|
Represents an angle value.
sf::Angle encapsulates an angle value in a flexible way. It allows for defining an angle value either as a number of degrees or radians. It also works the other way around. You can read an angle value as either a number of degrees or radians.
By using such a flexible interface, the API doesn't impose any fixed type or unit for angle values and lets the user choose their own preferred representation.
Angle values support the usual mathematical operations. You can add or subtract two angles, multiply or divide an angle by a number, compare two angles, etc.
Usage example:
Represents an angle value.
Definition Angle.hpp:35
constexpr float asRadians() const
Return the angle's value in radians.
friend constexpr Angle radians(float angle)
Construct an angle value from a number of radians.
friend constexpr Angle degrees(float angle)
Construct an angle value from a number of degrees.
constexpr float asDegrees() const
Return the angle's value in degrees.
constexpr Angle radians(float angle)
Construct an angle value from a number of radians.
constexpr Angle degrees(float angle)
Construct an angle value from a number of degrees.
| Angle sf::Angle::wrapUnsigned |
( |
| ) |
const |
|
nodiscardconstexpr |
Wrap to a range such that 0° <= angle < 360°
Similar to a modulo operation, this returns a copy of the angle constrained to the range [0°, 360°) == [0, Tau) == [0, 2*Pi). The resulting angle represents a rotation which is equivalent to *this.
The name "unsigned" originates from the similarity to unsigned integers:
| signed | unsigned |
| char | [-128, 128) | [0, 256) |
| Angle | [-180°, 180°) | [0°, 360°) |
- Returns
- Unsigned angle, wrapped to [0°, 360°)
- See also
- wrapSigned