本文整理汇总了C++中writeFloat函数的典型用法代码示例。如果您正苦于以下问题:C++ writeFloat函数的具体用法?C++ writeFloat怎么用?C++ writeFloat使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了writeFloat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeChar
void 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);
}
}
示例2: negativeSideArea
std::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;
}
示例3: writeFloat
void 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;
}
示例4: VSIFCloseL
OGRGTMDataSource::~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;
}
示例5: writeViewBox
void 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);
}
示例6: writeFloat
std::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;
}
示例7: writeFloat
void SE_BufferOutput::writeFloatArray(float* fa, int count)
{
for(int i = 0 ; i < count ; i++)
{
writeFloat(fa[i]);
}
}
示例8: assert
void 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() );
}
}
示例9: acoshf_cmd
static 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;
}
示例10: writeFixed
void 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);
}
示例11: _s4
//--------------------------------------------------------------
void
DataStream::writeFloatBE(float n)
{
#ifdef AZURA_LITTLE_ENDIAN
_s4((_4*)&n);
#endif
writeFloat(n);
}
示例12: writeOpcode
void
RemotePluginClient::setParameter(int p, float v)
{
writeOpcode(&m_shmControl->ringBuffer, RemotePluginSetParameter);
writeInt(&m_shmControl->ringBuffer, p);
writeFloat(&m_shmControl->ringBuffer, v);
commitWrite(&m_shmControl->ringBuffer);
}
示例13: __wcstof_internal_cmd
static 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;
}
示例14: writeString
void 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);
}
示例15: sincosf_cmd
static 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;
}