16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-23 00:29:19 +02:00

feature: camera zoom

This commit is contained in:
tmj-fstate
2017-02-19 16:24:10 +01:00
parent 7e0aeb1bfa
commit 8ae135375e
7 changed files with 68 additions and 33 deletions

View File

@@ -175,14 +175,16 @@ void TGauge::Update()
*/ std::string n( "000000000" + std::to_string( static_cast<int>( std::floor( fValue ) ) ) );
if( n.length() > 10 ) { n.erase( 0, n.length() - 10 ); } // also dumb but should work for now
do
{ // pętla po submodelach potomnych i obracanie ich o kąt zależy od
// cyfry w (fValue)
if (sm->pName)
{ // musi mieć niepustą nazwę
if (sm->pName[0] >= '0')
if (sm->pName[0] <= '9')
sm->SetRotate(float3(0, 1, 0),
-36.0 * (n['0' + 10 - sm->pName[0]] - '0'));
{ // pętla po submodelach potomnych i obracanie ich o kąt zależy od cyfry w (fValue)
if( sm->pName ) {
// musi mieć niepustą nazwę
if( ( sm->pName[ 0 ] >= '0' )
&& ( sm->pName[ 0 ] <= '9' ) ) {
sm->SetRotate(
float3( 0, 1, 0 ),
-36.0 * ( n[ '0' + 9 - sm->pName[ 0 ] ] - '0' ) );
}
}
sm = sm->NextGet();
} while (sm);