Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
class CMine { public: static tbModel* mModel; tbObject Objekt; bool bCollision; float fCollStartTime, fRotSpeed; int iIndex, iVelocity, iRotDirX, iRotDirY, iRotDirZ; static int Counter; int iToggle; float fRange, fRotTest; // Konstruktor CMine(tbVector3 vPos, float fCollStartTime, float fTime) { iIndex = Counter; Counter++; // Überprüfungs Variable bool bRunning = true; // Variablen der Klasse Intialisieren this->Objekt.m_vPosition = vPos; this->fRotSpeed = TB_DEG_TO_RAD(tbFloatRandom(25.0f, 40.0f)); this->iVelocity = tbIntRandom(150,250); this->bCollision = false; this->fCollStartTime = fCollStartTime; iToggle = 0; fRange = 0.0f; fRotTest = 30.0f; // Rotationrichtungen festlegen while(bRunning == true) { this->iRotDirX = tbIntRandom(-1,1); if(iRotDirX == -1 || iRotDirX == 1) bRunning = false; } bRunning = true; while(bRunning == true) { this->iRotDirY = tbIntRandom(-1,1); if(iRotDirY == -1 || iRotDirY == 1) bRunning = false; } bRunning = true; while(bRunning == true) { this->iRotDirZ = tbIntRandom(-1,1); if(this->iRotDirZ == (-1) || this->iRotDirZ == 1) bRunning = false; } this->Objekt.m_vRotation.x = (float)(this->fRotSpeed * this->iRotDirX); this->Objekt.m_vRotation.y = (float)(this->fRotSpeed * this->iRotDirY); this->Objekt.m_vRotation.z = (float)(this->fRotSpeed * this->iRotDirZ); } // Konstruktor // dann kommen noch ein paar Methoden |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 |
for(int iX = 0; iX < ADM_OF_X_AXE; iX++) { for(int iY = 0; iY < ADM_OF_Y_Z_AXE; iY++) { for(int iZ = 0; iZ < ADM_OF_Y_Z_AXE; iZ++) { this->MineArray[iX][iY][iZ] = new CMine(tbVector3(iX * RASTER_OF_PLANE_X, iY * RASTER_OF_PLANE_Y_Z, iZ * RASTER_OF_PLANE_Y_Z), 0.5f, fTime); } } } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
myModell::myModell(Engine *p) : parent(p), next(NULL), previous(NULL), g_pownTextur(NULL), g_pIndexBuffer(NULL), licht(NULL), vertices(NULL), Index(NULL), VertexDecl(NULL), binary(NULL)cpp] Dieser Block erscheint mir völlig sinnlos: [cpp]// Rotationrichtungen festlegen while(bRunning == true) { this->iRotDirX = tbIntRandom(-1,1); if(iRotDirX == -1 || iRotDirX == 1) bRunning = false; } bRunning = true; while(bRunning == true) { this->iRotDirY = tbIntRandom(-1,1); if(iRotDirY == -1 || iRotDirY == 1) bRunning = false; } bRunning = true; while(bRunning == true) { this->iRotDirZ = tbIntRandom(-1,1); if(this->iRotDirZ == (-1) || this->iRotDirZ == 1) bRunning = false; } |
Zitat
C-/C++-Quelltext
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 // Rotationrichtungen festlegen while(bRunning == true) { this->iRotDirX = tbIntRandom(-1,1); if(iRotDirX == -1 || iRotDirX == 1) bRunning = false; } bRunning = true; while(bRunning == true) { this->iRotDirY = tbIntRandom(-1,1); if(iRotDirY == -1 || iRotDirY == 1) bRunning = false; } bRunning = true; while(bRunning == true) { this->iRotDirZ = tbIntRandom(-1,1); if(this->iRotDirZ == (-1) || this->iRotDirZ == 1) bRunning = false; }
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 |
int iAdd = 1; this->iRotDirZ = tbIntRandom(-1,1); if(this->iRotDirZ == 0) { this->iRotDirZ += iAdd; iAdd *= -1; } |
C-/C++-Quelltext |
|
1 2 3 |
this->iRotDirZ = tbIntRandom(-1,1); if(this->iRotDirZ == 0) this->iRotDirZ = -1; |
Werbeanzeige