Exemple #1
0
Angle &Angle::clampDegrees(float mag) {
    _degrees = getDegrees(-180.f);
    if (_degrees >= mag)
        setDegrees(mag);
    if (_degrees <= -mag)
        setDegrees(-mag);

    return *this;
}
Exemple #2
0
 /** \brief Constructor - sets the initial angle.
  * \param angle Accepts either radians or degrees
  * \param rad If true, the constructor sets the angle as radians. Else, degrees.
  */
 Angle::Angle(double angle, bool rad)
 {
     if (!rad)
         setDegrees(angle);
     else
         setRadians(angle);
 }
Exemple #3
0
Angle &Angle::operator=(float degrees) {
	setDegrees(degrees);

	return *this;
}
Exemple #4
0
Angle &Angle::operator-=(float degrees) {
	setDegrees(_degrees - degrees);

	return *this;
}
Exemple #5
0
Angle &Angle::operator-=(const Angle &a) {
	setDegrees(_degrees - a._degrees);

	return *this;
}
Exemple #6
0
 /// Set angle by radians
 void Angle::setRadians(qreal _angle)
 {
   setDegrees(_angle * 180.0 / M_PI);
 }
Exemple #7
0
 Angle::Angle(qreal _angle)
 {
   setDegrees(_angle);
 }
Exemple #8
0
AMAngle::AMAngle(const AMAngle& angle)
{
	setDegrees(angle.getDegrees());
}
Exemple #9
0
/// sets the angle from another AMAngle
void AMAngle::setAngle(AMAngle &angle)
{
	setDegrees(angle.degrees());// arbitarary, could do radians as well
}