3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
coat::scripto::Angles Class Reference

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

#include <SAngles.h>

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...
 
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. More...
 
Angles normalize180Copy () const
 
Anglesnormalize360 ()
 Normalize angles to 360 degree. More...
 
Angles normalize360Copy () const
 
Anglesround ()
 Round angles to integer. More...
 
Angles roundCopy () const
 
Vec3 forward () const
 Extract a forward-vector. More...
 
Vec3 right () const
 Extract a right-vector. More...
 
Vec3 up () const
 Extract an up-vector. More...
 

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 };

References pitch(), and yaw().

Referenced by operator-().

Member Function Documentation

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 ) );

References clampCopy().

Angles coat::scripto::Angles::clampCopy ( const Angles min,
const Angles max 
) const
inline
See Also
clamp()

Referenced by clamp().

Vec3 coat::scripto::Angles::forward ( ) const

Extract a forward-vector.

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 );

References lerpCopy().

Angles coat::scripto::Angles::lerpCopy ( const Angles b,
float  s 
) const
inline
See Also
lerp()

Referenced by lerp().

Angles& coat::scripto::Angles::normalize180 ( )
inline

Normalize angles to 180 degree.

Angles coat::scripto::Angles::normalize180Copy ( ) const
inline
See Also
normailze180()
Angles& coat::scripto::Angles::normalize360 ( )
inline

Normalize angles to 360 degree.

Angles coat::scripto::Angles::normalize360Copy ( ) const
inline
See Also
normalize360()
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 );
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::operator- ( ) const
inline

Negation operator.

Angles a( 45, 70, 80 );
Angles na = -a;

References Angles().

bool coat::scripto::Angles::operator== ( const Angles b) const
inline

Comparison.

...
if (a == Angles( 5, 70, 80 )) { ... }
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()

Referenced by Angles().

Vec3 coat::scripto::Angles::right ( ) const

Extract a right-vector.

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::round ( )
inline

Round angles to integer.

Angles coat::scripto::Angles::roundCopy ( ) const
inline
See Also
round()
Vec3 coat::scripto::Angles::up ( ) const

Extract an up-vector.

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()

Referenced by Angles().


The documentation for this class was generated from the following files: