42 lines
1,023 B
C++
42 lines
1,023 B
C++
|
#include "externals.hh"
|
||
|
#include "utilities.hh"
|
||
|
|
||
|
|
||
|
void disableButton( )
|
||
|
{
|
||
|
ImGui::PushStyleColor( ImGuiCol_Button , ImColor( .3f , .3f , .3f ) );
|
||
|
ImGui::PushStyleColor( ImGuiCol_ButtonHovered , ImColor( .3f , .3f , .3f ) );
|
||
|
ImGui::PushStyleColor( ImGuiCol_ButtonActive , ImColor( .3f , .3f , .3f ) );
|
||
|
}
|
||
|
|
||
|
/*----------------------------------------------------------------------------*/
|
||
|
|
||
|
void updateAngle(
|
||
|
__rw__ float& initial ,
|
||
|
__rd__ const float delta
|
||
|
)
|
||
|
{
|
||
|
initial = fmod( initial + delta + 540 , 360 ) - 180;
|
||
|
}
|
||
|
|
||
|
void anglesToMatrix(
|
||
|
__rd__ float const* angles ,
|
||
|
__wr__ float* matrix )
|
||
|
{
|
||
|
float c[3] , s[3];
|
||
|
for ( int i = 0 ; i < 3 ; i ++ ) {
|
||
|
const float a = M_PI * angles[ i ] / 180;
|
||
|
c[i] = cos( a );
|
||
|
s[i] = sin( a );
|
||
|
}
|
||
|
matrix[0] = c[1]*c[2];
|
||
|
matrix[1] = s[0]*s[1]*c[2] - c[0]*s[2];
|
||
|
matrix[2] = s[0]*s[2] + c[0]*s[1]*c[2];
|
||
|
matrix[3] = c[1]*s[2];
|
||
|
matrix[4] = c[0]*c[2] + s[0]*s[1]*s[2];
|
||
|
matrix[5] = c[0]*s[1]*s[2] - s[0]*c[2];
|
||
|
matrix[6] = -s[1];
|
||
|
matrix[7] = s[0]*c[1];
|
||
|
matrix[8] = c[0]*c[1];
|
||
|
}
|