int Simulation :: addMesh( const std::string& filename ){ Mesh* object = new Mesh(); if( object->read( filename ) ){ return 1; // error } Vector shiftPos( 0., 0., 0. ); Vector initialVel( 0., 0., 0. ); double vertexMasses = 1.0; double constraintStiffness = 0.7; bool isFixed; if( isFirst ){ isFixed = false; isFirst = false; } else{ isFixed = true; } // bool isFixed = false; object->initDynamics( shiftPos, initialVel, vertexMasses, constraintStiffness, isFixed ); m_meshes.push_back( object ); return 0; // success }
void CCursorHandler::draw2() { if(!Show) return; int x = xpos, y = ypos; shiftPos(x, y); SDL_Rect temp_rect = genRect(40, 40, x, y); SDL_BlitSurface(help, NULL, screen, &temp_rect); //blitAt(help,x,y); }
void CCursorHandler::drawRestored() { if(!showing) return; int x = xpos, y = ypos; shiftPos(x, y); SDL_Rect temp_rect = genRect(40, 40, x, y); SDL_BlitSurface(help, nullptr, screen, &temp_rect); //blitAt(help,x,y); }
void CCursorHandler::drawWithScreenRestore() { if(!showing) return; int x = xpos, y = ypos; shiftPos(x, y); SDL_Rect temp_rect1 = genRect(40,40,x,y); SDL_Rect temp_rect2 = genRect(40,40,0,0); SDL_BlitSurface(screen, &temp_rect1, help, &temp_rect2); if (dndObject) { dndObject->moveTo(Point(x - dndObject->pos.w/2, y - dndObject->pos.h/2)); dndObject->showAll(screen); } else { currentCursor->moveTo(Point(x,y)); currentCursor->showAll(screen); } }
void CCursorHandler::draw1() { if(!Show) return; int x = xpos, y = ypos; shiftPos(x, y); SDL_Rect temp_rect1 = genRect(40,40,x,y); SDL_Rect temp_rect2 = genRect(40,40,0,0); SDL_BlitSurface(screen, &temp_rect1, help, &temp_rect2); // if (dndImage) // blitAt(dndImage, x - dndImage->w/2, y - dndImage->h/2); // else // blitAt(cursors[mode]->ourImages[number].bitmap,x,y); if (dndImage) { SDL_Rect temp_rect =genRect(40, 40, x - dndImage->w/2, y - dndImage->h/2); SDL_BlitSurface(dndImage, NULL, screen, &temp_rect); } else { SDL_Rect temp_rect = genRect(40,40,x,y); SDL_BlitSurface(cursors[mode]->ourImages[number].bitmap, NULL, screen, &temp_rect); } }