这篇教程C++ writeFloat函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中writeFloat函数的典型用法代码示例。如果您正苦于以下问题:C++ writeFloat函数的具体用法?C++ writeFloat怎么用?C++ writeFloat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了writeFloat函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: writeCharvoid PhysicObject::savePhysProperties(FILE* f) { writeChar(isEnabledPhysics(), f); if (!isEnabledPhysics()) return; writeFloat(getMass(), f); writeVector(getAngularFactor(), f); writeVector(getLinearFactor(), f); //writeVector(getLinearVelocity(), f); writeChar(isTrigger(), f); writeChar(getCollisionShapeType(), f); writeChar(isEnableDeactivation(), f); writeFloat(getFriction(), f); writeFloat(getRestitution(), f); writeFloat(getLinearDumping(), f); writeFloat(getAngularDumping(), f); // save custom collision shape if (getCollisionShapeType() == CST_CUSTOM) { if (getCollisionShape() == NULL) Log::error("Can't save custom col. shape. (shape is NULL) id=%s", objectID.c_str()); writeChar(getCollisionShape()->getCollisionShapeType() , f); getCollisionShape()->save(f); } // save constraints writeChar(getConstrains().size(), f); for (unsigned int i = 0; i < getConstrains().size(); i++) { writeChar(getConstrains().at(i)->getType(), f); getConstrains().at(i)->save(f); }}
开发者ID:muhaos,项目名称:MHEngine,代码行数:31,
示例2: negativeSideAreastd::ostream& ProcFile::writeOutputPortals(std::ostream& str, ProcEntity& entity){ str << (boost::format("interAreaPortals { /* numAreas = */ %i /* numIAP = */ %i") % entity.numAreas % interAreaPortals.size()) << std::endl << std::endl; str << "/* interAreaPortal format is: numPoints positiveSideArea negativeSideArea ( point) ... */" << std::endl; for (std::size_t i = 0; i < interAreaPortals.size(); ++i) { const ProcInterAreaPortal& iap = interAreaPortals[i]; const ProcWinding& w = iap.side->winding; str << (boost::format("/* iap %i */ %i %i %i ") % i % w.size() % iap.area0 % iap.area1); str << "( "; for (std::size_t j = 0; j < w.size(); ++j) { writeFloat(str, w[j].vertex[0]); writeFloat(str, w[j].vertex[1]); writeFloat(str, w[j].vertex[2]); } str << ") "; str << std::endl; } str << "}" << std::endl<< std::endl; return str;}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:32,
示例3: writeFloatvoid DataOutputStream::writeVec4(const osg::Vec4& v){ writeFloat(v.x()); writeFloat(v.y()); writeFloat(v.z()); writeFloat(v.w()); if (_verboseOutput) std::cout<<"read/writeVec4() ["<<v<<"]"<<std::endl;}
开发者ID:BackupTheBerlios,项目名称:eu07-svn,代码行数:8,
示例4: VSIFCloseLOGRGTMDataSource::~OGRGTMDataSource(){ if (fpTmpTrackpoints != NULL) VSIFCloseL( fpTmpTrackpoints ); if (fpTmpTracks != NULL) VSIFCloseL( fpTmpTracks ); WriteWaypointStyles(); AppendTemporaryFiles(); if( fpOutput != NULL ) { /* Adjust header counters */ VSIFSeekL(fpOutput, NWPTS_OFFSET, SEEK_SET); writeInt(fpOutput, numWaypoints); writeInt(fpOutput, numTrackpoints); VSIFSeekL(fpOutput, NTK_OFFSET, SEEK_SET); writeInt(fpOutput, numTracks); /* Adjust header bounds */ VSIFSeekL(fpOutput, BOUNDS_OFFSET, SEEK_SET); writeFloat(fpOutput, maxlon); writeFloat(fpOutput, minlon); writeFloat(fpOutput, maxlat); writeFloat(fpOutput, minlat); VSIFCloseL( fpOutput ); } if (papoLayers != NULL) { for( int i = 0; i < nLayers; i++ ) delete papoLayers[i]; CPLFree( papoLayers ); } if (pszName != NULL) CPLFree( pszName ); if (pszTmpTracks != NULL) { VSIUnlink( pszTmpTracks ); CPLFree( pszTmpTracks ); } if (pszTmpTrackpoints != NULL) { VSIUnlink( pszTmpTrackpoints ); CPLFree( pszTmpTrackpoints ); } if (poGTMFile != NULL) delete poGTMFile;}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:56,
示例5: writeViewBoxvoid writeViewBox(const char* value, FILE* out) { float x, y, w, h; if (sscanf(value, "%f %f %f %f", &x, &y, &w, &h) != 4) { fprintf(stderr, "Unable to parse /"%s/" as a viewBox value/n", value); throw ErrBadAttribute; } writeFloat(x, out); writeFloat(y, out); writeFloat(w, out); writeFloat(h, out);}
开发者ID:Peter-Washington,项目名称:gnupoc-package,代码行数:11,
示例6: writeFloatstd::ostream& ProcFile::writeShadowTriangles(std::ostream& str, const Surface& tri){ // emit this chain str << (boost::format("/* numVerts = */ %i /* noCaps = */ %i /* noFrontCaps = */ %i /* numIndexes = */ %i /* planeBits = */ %i") % tri.vertices.size() % tri.numShadowIndicesNoCaps % tri.numShadowIndicesNoFrontCaps % tri.indices.size() % tri.shadowCapPlaneBits); str << std::endl; // verts std::size_t col = 0; for (std::size_t i = 0 ; i < tri.vertices.size(); ++i) { str << "( "; writeFloat(str, tri.shadowVertices[i][0]); writeFloat(str, tri.shadowVertices[i][1]); writeFloat(str, tri.shadowVertices[i][2]); str << " )"; if (++col == 5) { col = 0; str << std::endl; } } if (col != 0) { str << std::endl; } // indexes col = 0; for (std::size_t i = 0 ; i < tri.indices.size(); ++i) { str << (boost::format("%i ") % (str, tri.indices[i])); if (++col == 18 ) { col = 0; str << std::endl; } } if (col != 0) { str << std::endl; } return str;}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:52,
示例7: writeFloatvoid SE_BufferOutput::writeFloatArray(float* fa, int count){ for(int i = 0 ; i < count ; i++) { writeFloat(fa[i]); }}
开发者ID:huhuhu1092,项目名称:test-server,代码行数:7,
示例8: assertvoid BranchState::writeFloat( Token::Argument& argument ){ assert( argument.type() == Token::Argument::FLOAT_REGISTER ); if( argument.content() == Token::Argument::REGISTER ) { writeFloat( argument.regNumber(), argument.fields() ); } else if( argument.content() == Token::Argument::ALIAS ) { std::map< std::string, State >::iterator i = m_floats.find( argument.alias() ); if( i == m_floats.end() ) { State newState; m_floats[ argument.alias() ] = newState; i = m_floats.find( argument.alias() ); // this could be retrieved directly, but I've had issues with inserting into maps and retrieving the iterator in the same operation assert( i != m_floats.end() ); } updateDependency( argument, i->second, Alias::FLOAT, i->first, ((i->second.fields() & ~argument.fields()) != 0) ); i->second.setFields( i->second.fields() | argument.fields() ); }}
开发者ID:jsvennevid,项目名称:openvcl,代码行数:27,
示例9: acoshf_cmdstatic TACommandVerdict acoshf_cmd(TAThread thread,TAInputStream stream){ float x, res; // Prepare x = readFloat(&stream); errno = 0; START_TARGET_OPERATION(thread); // Execute res = acoshf(x); END_TARGET_OPERATION(thread); // Response writeFloat(thread, res); writeInt(thread, errno); sendResponse(thread); return taDefaultVerdict;}
开发者ID:levenkov,项目名称:olver,代码行数:25,
示例10: writeFixedvoid writeFixed(const char* value, FILE* out) { float f; if (sscanf(value, "%f", &f) != 1) { fprintf(stderr, "Unable to parse /"%s/" as a floating point value/n", value); throw ErrBadAttribute; } writeFloat(f, out);}
开发者ID:Peter-Washington,项目名称:gnupoc-package,代码行数:8,
示例11: _s4 //-------------------------------------------------------------- void DataStream::writeFloatBE(float n) {#ifdef AZURA_LITTLE_ENDIAN _s4((_4*)&n);#endif writeFloat(n); }
开发者ID:kyuu,项目名称:azura,代码行数:9,
示例12: writeOpcodevoidRemotePluginClient::setParameter(int p, float v){ writeOpcode(&m_shmControl->ringBuffer, RemotePluginSetParameter); writeInt(&m_shmControl->ringBuffer, p); writeFloat(&m_shmControl->ringBuffer, v); commitWrite(&m_shmControl->ringBuffer);}
开发者ID:GomesMarcos,项目名称:dssi-vst,代码行数:8,
示例13: __wcstof_internal_cmdstatic TACommandVerdict __wcstof_internal_cmd(TAThread thread,TAInputStream stream){ wchar_t* st, *endptr; size_t size; float res; size = readInt(&stream); st = (wchar_t*)ta_alloc_memory(size * sizeof(wchar_t) + 1); readWCharArray(&stream, st, &size); st[size] = '/0'; START_TARGET_OPERATION(thread); errno = 0; res = __wcstof_internal(st, &endptr, 0); END_TARGET_OPERATION(thread); writeFloat(thread, res); writeInt(thread, (int)( endptr - st)); writeInt(thread, errno); ta_dealloc_memory(st); sendResponse(thread); return taDefaultVerdict;}
开发者ID:levenkov,项目名称:olver,代码行数:58,
示例14: writeStringvoid BoneVertex::writeToFile(FILE *fp){ if (! childListCompiled) compileChildList(); writeString(fp, getName()); float posx, posy, posz; float angle; float axisx, axisy, axisz; posx = initialPosition.x; posy = initialPosition.y; posz = initialPosition.z; angle = initialAngle; axisx = initialAxis.x; axisy = initialAxis.y; axisz = initialAxis.z; writeFloat(fp, posx); writeFloat(fp, posy); writeFloat(fp, posz); writeFloat(fp, angle); writeFloat(fp, axisx); writeFloat(fp, axisy); writeFloat(fp, axisz); writeInt(fp, children); for (int i=0; i<children; i++) child[i]->writeToFile(fp);}
开发者ID:philippedax,项目名称:vreng,代码行数:31,
示例15: sincosf_cmdstatic TACommandVerdict sincosf_cmd(TAThread thread,TAInputStream stream){ float x, s, c; x = readFloat(&stream); START_TARGET_OPERATION(thread); sincosf(x, &s, &c); END_TARGET_OPERATION(thread); writeFloat(thread, s); writeFloat(thread, c); sendResponse(thread); return taDefaultVerdict;}
开发者ID:levenkov,项目名称:olver,代码行数:18,
示例16: outvoid EntityTemplateInterpreter::generateTestByteCode() { std::ofstream out("autoGenerated.tpl", std::ofstream::binary); writeByte(0xB0, out); writeByte(0x01, out);writeString("size", out); writeByte(0x02, out);writeString("testFloat", out); writeByte(0x03, out);writeString("testString", out); writeByte(0x04, out);writeString("I AM SUCH A STRING", out); writeByte(0x05, out);writeString("testInt", out); writeByte(0x06, out);writeString("ball.png", out); writeByte(0x07, out);writeString("fancy", out); writeByte(0xB1, out); writeVec2(glm::vec2(100,100), out); //Size writeByte(0x01, out); writeFloat(33.544f, out); //testFloat writeByte(0x02, out); writeByte(0xD5, out);writeByte(0x04, out); //testString writeByte(0x03, out); writeVec3(glm::vec3(349,43,435), out); //testInt writeByte(0x05, out); writeByte(0xB2, out); writeByte(0xC0, out); //TextureComponent writeByte(0xD5, out); writeByte(0x06, out); writeUint16(5, out); writeUint16(1, out); writeUint16(3, out); writeUint16(1, out); writeByte(0xC1, out); //ScriptComponent writeByte(0xD5, out); writeByte(0x07, out); writeByte(0xC2, out); //MoveComponent writeFloat(20.f, out); //Acc writeFloat(4.f, out); //Damping writeFloat(20.f, out); //Mass writeFloat(4.f, out); //Deacc writeByte(0xC3, out); //CollisionComponent writeUint16(1, out); //Box Count writeFloat(20.f, out); //x writeFloat(4.f, out); //y writeFloat(20.f, out); //w writeFloat(4.f, out); //h writeByte(0xD5, out); writeByte(0xA7, out); //Trigger Name}
开发者ID:EmeraldGit,项目名称:elias_broschin_tup,代码行数:49,
示例17: writeUInt64void BaseSerializedObj::writeFloatArray(float array[], uint64_t s){ writeUInt64(s); uint64_t i = 0; while ( i!=s ) { writeFloat(array[i]); i++; }}
开发者ID:alexator,项目名称:nSerializer,代码行数:10,
示例18: writeIntvoid DataOutputStream::writeFloatArray(const osg::FloatArray* a){ int size = a->getNumElements(); writeInt(size); for(int i =0; i<size ;i++){ writeFloat((*a)[i]); } if (_verboseOutput) std::cout<<"read/writeFloatArray() ["<<size<<"]"<<std::endl;}
开发者ID:BackupTheBerlios,项目名称:eu07-svn,代码行数:10,
示例19: serialize // ---------------------------------------------------------------------- std::vector<char>* PolygonTopologyPacket:: serialize( void ) throw() { std::vector<char> *b = (static_cast<SpyglassPacket*>(this))->serialize(); int standardsize = b->size()-1; length_ = get_size(); b->resize(length_+1); writeChar( length_, b, 0); writeChar( polType_, b, standardsize+1 ); int size = polygon_.size(); for (int i=0; i<size; ++i) { shawn::Vec pos = polygon_.front(); writeFloat(pos.x(), b, standardsize+2+i*8); writeFloat(pos.y(), b, standardsize+6+i*8); polygon_.pop_front(); } return b; }
开发者ID:MarcStelzner,项目名称:shawn,代码行数:22,
示例20: storeSensorsZeroToEEPROMvoid storeSensorsZeroToEEPROM() { // Store accel data to EEPROM writeFloat(accelOneG, ACCEL_1G_ADR); // Accel Cal writeFloat(accelScaleFactor[XAXIS], XAXIS_ACCEL_SCALE_FACTOR_ADR); writeFloat(runTimeAccelBias[XAXIS], XAXIS_ACCEL_BIAS_ADR); writeFloat(accelScaleFactor[YAXIS], YAXIS_ACCEL_SCALE_FACTOR_ADR); writeFloat(runTimeAccelBias[YAXIS], YAXIS_ACCEL_BIAS_ADR); writeFloat(accelScaleFactor[ZAXIS], ZAXIS_ACCEL_SCALE_FACTOR_ADR); writeFloat(runTimeAccelBias[ZAXIS], ZAXIS_ACCEL_BIAS_ADR);}
开发者ID:IHA-Quadro,项目名称:Drone,代码行数:12,
示例21: memsetEDLL int AoscMessage::getBytes(byte *data, int sizemax){ int size=0; memset(data, 0, sizemax); size+=writeString(pattern, data, sizemax); format[0]=','; { Anode *n=lchild; char *f=&format[1]; while(n) { if(n->isCI(&AoscString::CI)) *(f++)='s'; else if(n->isCI(&AoscInteger::CI)) *(f++)='i'; else if(n->isCI(&AoscFloat::CI)) *(f++)='f'; else if(n->isCI(&AoscColor::CI)) *(f++)='r'; else if(n->isCI(&AoscBitmap::CI)) *(f++)='j'; n=n->prev; } *f=0; } size+=writeString(format, data+size, sizemax-size); { Anode *n=lchild; while(n) { if(n->isCI(&AoscString::CI)) size+=writeString(((AoscString *)n)->value, data+size, sizemax-size); else if(n->isCI(&AoscInteger::CI)) size+=writeInt(((AoscInteger *)n)->value, data+size, sizemax-size); else if(n->isCI(&AoscFloat::CI)) size+=writeFloat(((AoscFloat *)n)->value, data+size, sizemax-size); else if(n->isCI(&AoscColor::CI)) size+=writeInt(((AoscColor *)n)->value, data+size, sizemax-size); else if(n->isCI(&AoscBitmap::CI)) size+=writeBitmap(((AoscBitmap *)n)->value, data+size, sizemax-size); n=n->prev; } } return size;}
开发者ID:RaymondLiao,项目名称:elektronika,代码行数:45,
示例22: tanf_cmdstatic TACommandVerdict tanf_cmd(TAThread thread,TAInputStream stream){ float x, res; x = readFloat(&stream); START_TARGET_OPERATION(thread); errno = 0; res = tanf(x); END_TARGET_OPERATION(thread); writeInt(thread, errno); writeFloat(thread, res); sendResponse(thread); return taDefaultVerdict;}
开发者ID:levenkov,项目名称:olver,代码行数:19,
示例23: lgammaf_r_cmdstatic TACommandVerdict lgammaf_r_cmd(TAThread thread,TAInputStream stream){ float x, res; int signp; x = readFloat(&stream); START_TARGET_OPERATION(thread); errno = 0; res = lgammaf_r(x, &signp); END_TARGET_OPERATION(thread); writeInt(thread, errno); writeFloat(thread, res); writeInt(thread, signp); sendResponse(thread); return taDefaultVerdict;}
开发者ID:levenkov,项目名称:olver,代码行数:21,
示例24: mainint main(void){ // create memory system with 256 words and a direct-mapped cache // with 8 sets and a block size of 4 words. void *a = initializeMemorySystem(SIZE, 1, 4, 8, 1, 1); if (a == NULL) { fprintf(stderr, "initializeMemorySystem failed!/n"); exit(-1); } int i; // initialize the array for (i = 0; i < SIZE; i++) { writeFloat(a, 0, i, ((float) i) + .5); } // now sum it float sum = 0.0; float sum2 = 0.0; for (i = 0; i < SIZE; i++) { float tmp = readFloat(a, 0, i); //printf("%d %f/n", i, tmp); sum += tmp; sum2 += (((float) i) + .5); } printf("sum is %f (should be %f)/n", sum, sum2); // print stats printf("/n"); printStatistics(a); printf("/n"); return 0;}
开发者ID:michaelatremblay,项目名称:school,代码行数:39,
注:本文中的writeFloat函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ writeImage函数代码示例 C++ writeFile函数代码示例 |