void PovrayMaker::addSphere(double x, double y,double z, double r, double c) { textOut <<QString("sphere")<<"\n" <<QString("{")<<"\n" <<QString(" <%1, %2, %3>, %4").arg(x).arg(z).arg(y).arg(r)<<"\n"; if(c) pigment(c); checkBorder(x,y,z); checkBorder(r); }
// do-step in FAController void RLRBController::updateModel(RLPlayer*& p1, RLPlayer*& opp, int bestAct, int oppBestAct) { checkBorder(p1); int m_dist = abs(opp->getPos()[0] - p1->getPos()[0]); p1->getAct()->setDist(m_dist); double rwd = p1->updateHealth(opp->getAct()); }
void PovrayMaker::addCone(double x, double y,double z,double r,double x1, double y1,double z1, double r1, double c, int open) { textOut <<QString("cone")<<"\n" <<QString("{")<<"\n" <<QString(" <%1, %2, %3>, %4").arg(x).arg(z).arg(y).arg(r)<<"\n" <<QString(" <%1, %2, %3>, %4").arg(x1).arg(z1).arg(y1).arg(r1)<<"\n"; if(open) textOut<<QString(" %1").arg(open)<<"\n"; // Remove end caps if(c) pigment(c); checkBorder(x,y,z); checkBorder(x1,y1,z1); checkBorder(r,r1); }
void lawnmower(void) { srand(time(NULL)); border_t check; while(1) { turtle("fd", rand()%RANDMOVE_MAX, NOP); check = checkBorder(); switch (check) { case INSIDE: turtle("sh", rand()%360, NOP); break; case NORTH: turtle("sh", 90 +rand()%RANDTURN_MAX, NOP); break; case EAST: turtle("sh", 180 +rand()%RANDTURN_MAX, NOP); break; case SOUTH: turtle("sh", (270 +rand()%RANDTURN_MAX)%360, NOP); break; case WEST: turtle("sh", rand()%RANDTURN_MAX, NOP); break; } } }
void PovrayMaker::addRadial(double r, double phi,double theta, double c) { double x1=r*cos(phi)*sin(theta); double y1=r*sin(phi)*sin(theta); double z1=r*cos(theta); // addCone(0,0,0,0,x1, y1, z1, scale*0.025, c); addSphere(x1, y1, z1, scale*0.075, c); checkBorder(x1,y1,z1); }
int Snake::move() { _lastChain = _snake.back(); if (!_eated) _snake.pop_back(); else --_eated; _dir %= 4; _snake.push_front(std::pair<int, int>((this->*ptr[_dir])())); if (!checkBorder() || !checkCannibalism()) return (1); return (0); }
/*virtual*/ void h_Robot::move() { // Probe its nearby environment QVector<qreal> sensorsIntensities = getSensors(); // Run the controller neuralNet->run(sensorsIntensities, maxSensorIntensity); // Update position updatePosition(); // Prevent the robot from leaving the world checkBorder(s->rob.borderMode); }
HRESULT TimgFilterOutput::process(TffPict &pict,uint64_t dstcsp,unsigned char *dst[4],int dstStride[4],LONG &dstSize,const ToutputVideoSettings *cfg) { checkBorder(pict); if ( !convert || convert->dx!=pict.rectFull.dx || convert->dy!=pict.rectFull.dy || old_cspOptionsRgbInterlaceMode != cfg->cspOptionsRgbInterlaceMode || old_highQualityRGB != cfg->highQualityRGB || old_dithering != cfg->dithering || old_outputLevelsMode != cfg->cspOptionsOutputLevelsMode || old_inputLevelsMode != cfg->cspOptionsInputLevelsMode || old_IturBt != cfg->cspOptionsIturBt) { old_highQualityRGB = cfg->highQualityRGB; old_dithering = cfg->dithering; old_cspOptionsRgbInterlaceMode = cfg->cspOptionsRgbInterlaceMode; old_outputLevelsMode = cfg->cspOptionsOutputLevelsMode; old_inputLevelsMode = cfg->cspOptionsInputLevelsMode; old_IturBt = cfg->cspOptionsIturBt; if (convert) { delete convert; } vramBenchmark.init(); convert=new Tconvert(deci,pict.rectFull.dx,pict.rectFull.dy,dstSize); } stride_t cspstride[4] = {0,0,0,0}; unsigned char *cspdst[4] = {0,0,0,0}; const TcspInfo *outcspInfo=csp_getInfo(dstcsp); for (int i=0; i<4; i++) { cspstride[i]=dstStride[0]>>outcspInfo->shiftX[i]; if (i==0) { cspdst[i]=dst[i]; } else { cspdst[i]=cspdst[i-1]+cspstride[i-1]*(pict.rectFull.dy>>outcspInfo->shiftY[i-1]); } } if (convert->m_wasChange) { vramBenchmark.onChange(); } uint64_t cspret=convert->convert(pict, (dstcsp ^ (cfg->flip ? FF_CSP_FLAGS_VFLIP : 0)) | ((!pict.film && (pict.fieldtype & FIELD_TYPE::MASK_INT)) ? FF_CSP_FLAGS_INTERLACED : 0), cspdst, cspstride, vramBenchmark.get_vram_indirect()); vramBenchmark.update(); return cspret?S_OK:E_FAIL; }
void StretchableSprite2D::SetBorder(const IntRect& border) { border_ = border; auto drawSize = drawRect_.Size(); checkBorder(border_.left_, drawSize.x_); checkBorder(border_.right_, drawSize.x_); checkBorder(border_.left_ + border_.right_, drawSize.x_); checkBorder(border_.bottom_, drawSize.y_); checkBorder(border_.top_, drawSize.y_); checkBorder(border_.bottom_ + border_.top_, drawSize.y_); }
void sgbBorderEnableFunc(int value) { sgbBordersEnabled = value; checkBorder(); }
void customBorderEnableFunc(int value) { customBordersEnabled = value; checkBorder(); }