Changeset 4298 in orxonox.OLD for orxonox/branches/physics/src/subprojects/particles/framework.cc
- Timestamp:
- May 26, 2005, 2:03:33 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/subprojects/particles/framework.cc
r4297 r4298 48 48 bool Framework::draw(float dt) 49 49 { 50 51 52 50 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 53 51 glLoadIdentity(); // Reset the view … … 94 92 if (mouse1Down) 95 93 { 96 int mX = event.button.x; 97 int mY = event.button.y; 98 int wH = GraphicsEngine::getInstance()->getResolutionY(); 99 int wW = GraphicsEngine::getInstance()->getResolutionX(); 100 Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) )); 101 // PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z); 102 p2 = tmpV-M; 103 p2.y = -p2.y; 104 rotAxis = p1.cross(p2); 105 // PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z); 106 107 // in case that there is no rotation-axis defined 108 if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0) 94 /* 95 int mX = event.button.x; 96 int mY = event.button.y; 97 int wH = GraphicsEngine::getInstance()->getResolutionY(); 98 int wW = GraphicsEngine::getInstance()->getResolutionX(); 99 Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) )); 100 // PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z); 101 p2 = tmpV-M; 102 p2.y = -p2.y; 103 rotAxis = p1.cross(p2); 104 // PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z); 105 106 // in case that there is no rotation-axis defined 107 if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0) 109 108 { 110 111 112 113 114 115 116 117 118 119 109 rotAxis.normalize(); 110 // PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z, rotAngle); 111 112 rotAngle = angleRad (p1, p2); 113 rotQ = Quaternion (rotAngle, rotAxis); 114 rotQ = rotQ * rotQlast; 115 rotQ.matrix (matQ); 116 // dir = rotQ.apply(dir); 117 // dir.normalize(); 118 // PRINTF(0)("rotAxis: %f, %f, %f, %f\n", dir.x, dir.y, dir.z, rotAngle); 120 119 } 121 rotQlast = rotQ; 122 p1 = p2; 120 rotQlast = rotQ; 121 p1 = p2; 122 */ 123 123 124 124 } … … 172 172 { 173 173 case SDLK_x: 174 174 175 175 break; 176 176 case SDLK_c:
Note: See TracChangeset
for help on using the changeset viewer.