3DCoatScripting  4.8.31β
You can manage 3DСoat features with help of scripting
coat::scripto::Angles Class Reference

Class for working with Euler angles: pitch, yaw, roll. More...

Public Types

typedef comms::cAngles angles_t
 

Public Member Functions

 Angles (float pitch, float yaw, float roll)
 Constructor for building angles (pitch, yaw, roll) = (0, 0, 0). More...
 
 operator Mat3 () const
 Ability for converting Angles to Mat3. More...
 
 operator Mat4 () const
 Ability for converting Angles to Mat4. More...
 
 operator Quat () const
 Ability for converting Angles to Quat. More...
 
 operator std::string () const
 Ability for converting Angles to string. More...
 
bool operator== (const Angles &b) const
 Comparison. More...
 
Anglesoperator() (int i, float v)
 Setter like array.
[ 0 ] is pitch
[ 1 ] is yaw
[ 2 ] is roll
. More...
 
float operator() (int i) const
 Getter like array. More...
 
Anglespitch (const float &v)
 Setter for pitch. More...
 
float pitch () const
 Getter for pitch. More...
 
Anglesyaw (const float &v)
 Setter for yaw. More...
 
float yaw () const
 Getter for yaw. More...
 
Anglesroll (const float &v)
 Setter for roll. More...
 
float roll () const
 Getter for roll. More...
 
Angles operator- () const
 Negation operator. More...
 
Anglesoperator+= (const Angles &b)
 
Anglesoperator-= (const Angles &b)
 
Anglesoperator*= (const float &k)
 
Anglesoperator/= (const float &k)
 
Angles operator+ (const Angles &b) const
 
Angles operator- (const Angles &b) const
 
Angles operator* (const float &k) const
 
Angles operator/ (const float &k) const
 
Anglesclamp (const Angles &min, const Angles &max)
 Clamp values to diapason [min; max]. More...
 
Angles clampCopy (const Angles &min, const Angles &max) const
 
Angleslerp (const Angles &b, float s)
 Interpolates between angles, using linear interpolation. More...
 
Angles lerpCopy (const Angles &b, float s) const
 
Anglesnormalize180 ()
 Normalize angles to 180 degree.
 
Angles normalize180Copy () const
 
Anglesnormalize360 ()
 Normalize angles to 360 degree.
 
Angles normalize360Copy () const
 
Anglesround ()
 Round angles to integer.
 
Angles roundCopy () const
 
Vec3 forward () const
 Extract a forward-vector.
 
Vec3 right () const
 Extract a right-vector.
 
Vec3 up () const
 Extract an up-vector.
 

Detailed Description

Class for working with Euler angles: pitch, yaw, roll.

angles.png
Since
4.5.32

Constructor & Destructor Documentation

coat::scripto::Angles::Angles ( float  pitch,
float  yaw,
float  roll 
)
inline

Constructor for building angles (pitch, yaw, roll) = (0, 0, 0).

Constructor by values.

Angles a( 45, 70, 80 );
Angles b = { 45, 70, 80 };

Member Function Documentation

coat::scripto::Angles::operator Mat3 ( ) const

Ability for converting Angles to Mat3.

Angles a( 45, 70, 80 );
Mat3 m = Mat3( a );
coat::scripto::Angles::operator Mat4 ( ) const

Ability for converting Angles to Mat4.

Angles a( 45, 70, 80 );
Mat4 m = Mat4( a );
coat::scripto::Angles::operator Quat ( ) const

Ability for converting Angles to Quat.

Angles a( 45, 70, 80 );
Quat m = Quat( a );
coat::scripto::Angles::operator std::string ( ) const

Ability for converting Angles to string.

Angles a( 45, 70, 80 );
string m = string( a );
bool coat::scripto::Angles::operator== ( const Angles b) const
inline

Comparison.

...
if (a == Angles( 5, 70, 80 )) { ... }
Angles& coat::scripto::Angles::operator() ( int  i,
float  v 
)
inline

Setter like array.
[ 0 ] is pitch
[ 1 ] is yaw
[ 2 ] is roll
.

Angles a( 45, 70, 80 );
// setting roll to 95
a[ 2, 95 ];
float coat::scripto::Angles::operator() ( int  i) const
inline

Getter like array.

Angles a( 45, 70, 80 );
float pitch = a[ 0 ];
float yaw = a[ 1 ];
float roll = a[ 2 ];
Angles& coat::scripto::Angles::pitch ( const float &  v)
inline

Setter for pitch.

Angles a( 45, 70, 80 );
a.pitch( 50 ).yaw( 75 ).roll( 85 );
See Also
yaw( float ), roll( float )
float coat::scripto::Angles::pitch ( ) const
inline

Getter for pitch.

Angles a( 45, 70, 80 );
float v = a.pitch();
See Also
yaw(), roll()
Angles& coat::scripto::Angles::yaw ( const float &  v)
inline

Setter for yaw.

See Also
pitch( float ), roll( float )
float coat::scripto::Angles::yaw ( ) const
inline

Getter for yaw.

See Also
pitch(), roll()
Angles& coat::scripto::Angles::roll ( const float &  v)
inline

Setter for roll.

See Also
pitch( float ), yaw( float )
float coat::scripto::Angles::roll ( ) const
inline

Getter for roll.

See Also
pitch(), yaw()
Angles coat::scripto::Angles::operator- ( ) const
inline

Negation operator.

Angles a( 45, 70, 80 );
Angles na = -a;
Angles& coat::scripto::Angles::clamp ( const Angles min,
const Angles max 
)
inline

Clamp values to diapason [min; max].

Angles a( 45, 70, 80 );
...
a.clamp( Angles( 0, 100, 0 ), Angles( 50, 200, 50 ) );
Angles coat::scripto::Angles::clampCopy ( const Angles min,
const Angles max 
) const
inline
See Also
clamp()
Angles& coat::scripto::Angles::lerp ( const Angles b,
float  s 
)
inline

Interpolates between angles, using linear interpolation.

Angles a( 45, 70, 80 );
...
a.lerp( Angles( 100 ), 0.3 );
Angles coat::scripto::Angles::lerpCopy ( const Angles b,
float  s 
) const
inline
See Also
lerp()
Angles coat::scripto::Angles::normalize180Copy ( ) const
inline
See Also
normailze180()
Angles coat::scripto::Angles::normalize360Copy ( ) const
inline
See Also
normalize360()
Angles coat::scripto::Angles::roundCopy ( ) const
inline
See Also
round()