• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ReadFloat函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ReadFloat函数的典型用法代码示例。如果您正苦于以下问题:C++ ReadFloat函数的具体用法?C++ ReadFloat怎么用?C++ ReadFloat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ReadFloat函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ReadUInt

void KfmEvent::Read( istream & in, unsigned int version ) {
    id = ReadUInt(in);
    type = ReadUInt(in);
    if ( type != 5 ) {
        unk_float = ReadFloat(in);
        event_strings.resize(ReadUInt(in));
        for ( vector<KfmEventString>::iterator it = event_strings.begin(); it != event_strings.end(); it++ ) it->Read(in, version);
        unk_int3 = ReadUInt(in);
    };
};
开发者ID:europop,项目名称:morrgraphext,代码行数:10,代码来源:kfm.cpp


示例2: ASSERT

void Serializer::InitForReading(void *data, int data_size)
{
   ASSERT(mode==SERIALIZE_NONE);
   
   mode=SERIALIZE_READ;
   buffer=data;
   buffer_size=data_size;

   ReadFloat(ver);   //shrugs
}
开发者ID:ChadGoulding,项目名称:MindMap,代码行数:10,代码来源:Serialize.cpp


示例3: ProcessTriangles

static void ProcessTriangles()
{
	int numvertices;
	float x, y, z;

	numvertices = ReadInt();

	glBegin(GL_TRIANGLES);
	while (numvertices)
	{
		x = ReadFloat();
		y = ReadFloat();
		z = ReadFloat();

		glVertex3f(x, y, z);
		numvertices--;
	}
	glEnd();
}
开发者ID:brycekelleher,项目名称:bsp,代码行数:19,代码来源:draw.cpp


示例4: readTeleopForwards

float readTeleopForwards()
{
  TFileHandle hFileHandle;
  TFileIOResult nIoResult;
  float result=0;
  short nFileSize=sizeof(baseHeading);
  OpenRead(hFileHandle, nIoResult, TELEOPFORWARDSDAT, nFileSize);
  ReadFloat(hFileHandle, nIoResult, result);
  Close(hFileHandle, nIoResult);
  return result;
}
开发者ID:BatteryPoweredPicklejarHeads,项目名称:Pickles_2012-2013_Code,代码行数:11,代码来源:PickleCompassDriver.c


示例5: ReadType

//-----------------------------------------------------------------------------------------------
Vector2 ResourceStream::ReadVector2()
{
	Vector2 returnValue;

	if( m_internalFormat == RESOURCE_STREAM_FORMAT_BINARY )
	{
		ReadType( returnValue );
		// DEBUGGING - { int q = 5; } //ConsolePrintf( "ReadVector2 at offset %d, value was (%g,%g)\n", m_currentReadOffset, returnValue.x, returnValue.y );
		return returnValue;
	}

	ReadExpectedToken( "Vector2" );
	ReadExpectedToken( '(' );
	returnValue.x = ReadFloat();
	ReadExpectedToken( ',' );
	returnValue.y = ReadFloat();
	ReadExpectedToken( ')' );

	return returnValue;
}
开发者ID:SquirrelEiserloh,项目名称:Rules-of-Enragement,代码行数:21,代码来源:ResourceStream.cpp


示例6: ReadInt

/// Read SMFHeader head from file
void CSMFMapFile::ReadMapHeader(SMFHeader& head, CFileHandler& file)
{
	file.Read(head.magic,sizeof(head.magic));

	head.version = ReadInt(file);
	head.mapid = ReadInt(file);
	head.mapx = ReadInt(file);
	head.mapy = ReadInt(file);
	head.squareSize = ReadInt(file);
	head.texelPerSquare = ReadInt(file);
	head.tilesize = ReadInt(file);
	head.minHeight = ReadFloat(file);
	head.maxHeight = ReadFloat(file);
	head.heightmapPtr = ReadInt(file);
	head.typeMapPtr = ReadInt(file);
	head.tilesPtr = ReadInt(file);
	head.minimapPtr = ReadInt(file);
	head.metalmapPtr = ReadInt(file);
	head.featurePtr = ReadInt(file);
	head.numExtraHeaders = ReadInt(file);
}
开发者ID:sprunk,项目名称:spring,代码行数:22,代码来源:SMFMapFile.cpp


示例7: ReadInt

/*
===================
idRestoreGame::ReadContactInfo
===================
*/
void idRestoreGame::ReadContactInfo( contactInfo_t &contactInfo ) {
	ReadInt( (int &)contactInfo.type );
	ReadVec3( contactInfo.point );
	ReadVec3( contactInfo.normal );
	ReadFloat( contactInfo.dist );
	ReadInt( contactInfo.contents );
	ReadMaterial( contactInfo.material );
	ReadInt( contactInfo.modelFeature );
	ReadInt( contactInfo.trmFeature );
	ReadInt( contactInfo.entityNum );
	ReadInt( contactInfo.id );
}
开发者ID:RobertBeckebans,项目名称:fhDOOM,代码行数:17,代码来源:SaveGame.cpp


示例8: ReadPoint

/******************************************************************************
 * read point information and load it
 * point information will be read as x,y,z float coordinates
 *****************************************************************************/
int ReadPoint(point *p)
{
	if (!ReadFloat(&p->x))
	{
		PrintError("Number expected");
		return 0;
	}
	SkipWhitespace();
	if (!ReadFloat(&p->y))
	{
		PrintError("Number expected");
		return 0;
	}
	SkipWhitespace();
	if (!ReadFloat(&p->z))
	{
		PrintError("Number expected");
		return 0;
	}
	return 1;
}
开发者ID:brownman,项目名称:wired,代码行数:25,代码来源:RollerCoasterLoader.c


示例9: GotoChunk

void L3DS::ReadMap(const LChunk &chunk, LMap& map)
{
    LChunk child;
    char str[20];
    GotoChunk(chunk);
    child = ReadChunk();
    while (child.end <= chunk.end)
    {
        switch (child.id)
        {
        case INT_PERCENTAGE:
            map.strength = ReadPercentage(child);
            break;
        case MAT_MAPNAME:
            ReadASCIIZ(str, 20);
            strcpy(map.mapName, str);
            break;
        case MAT_MAP_TILING:
            map.tiling = ReadShort();
            break;
        case MAT_MAP_USCALE:
            map.uScale = ReadFloat();
            break;
        case MAT_MAP_VSCALE:
            map.vScale = ReadFloat();
            break;
        case MAT_MAP_UOFFSET:
            map.uOffset = ReadFloat();
            break;
        case MAT_MAP_VOFFSET:
            map.vOffset = ReadFloat();
            break;
        case MAT_MAP_ANG:
            map.angle = ReadFloat();
            break;
        }
        SkipChunk(child);
        child = ReadChunk();
    }
}
开发者ID:marcusl,项目名称:OpenSG,代码行数:40,代码来源:OSG3DSLoader.cpp


示例10: ReadFloat

void VFSPlugin_LWO::read_diff(long length)
{
	//	Get a ptr to the last surface (hence the current one)
	Material *m = m_vb->GetMaterial();

	//	Read the diffuse value
	m->diffuse = ReadFloat();

	//	Read the envelope
	long vxlength;
	long envelope = ReadVariableLength(&vxlength);
	length -= (vxlength + sizeof(float)*3);
}
开发者ID:christhomas,项目名称:fusionengine,代码行数:13,代码来源:VFSPlugin_LWO.cpp


示例11: if

//---------------------------------------------------------------------
//  Read all parameters
//---------------------------------------------------------------------
int CNeedleMark::Read(SStream *stream, Tag tag)
{ if (0 == mgg) gtfo("<CNeedleMark: need mother gauge");
  switch (tag)  {
    case 'bmap':
      nedl.SetGauge(mgg);
      nedl.ReadBMAP(stream);
      return TAG_READ;
    //--- rotation center --------------
    case 'rotc':
      nedl.ReadROTC(stream);
      return TAG_READ;
    //--- minimum value ----------------
    case 'dmin':
      ReadFloat(&dmin, stream);
      return TAG_READ;
    //--- maximum value ----------------
    case 'dmax':
      ReadFloat(&dmax, stream);
      return TAG_READ;
    //--- Clamp values -----------------
    case 'clmp':
      ReadFloat(&dmin,stream);
      ReadFloat(&dmax,stream);
      return TAG_READ;
    //--- Current value ----------------
		case 'sang':
    case 'dval':
      ReadFloat(&dval,stream);
			SaveValue(dval);
      return TAG_READ;
    //--- Knob -------------------------
    case 'knob':
      ReadKNOB(stream);
      return TAG_READ;

  }
  WARNINGLOG("CNeedleMark: tag %s unknowned",TagToString(tag));
  return TAG_IGNORED;
}
开发者ID:PierrotG,项目名称:FlyLegacy,代码行数:42,代码来源:GaugeComponents.cpp


示例12: ReadModel

/*
================
idRestoreGame::ReadRenderEntity
================
*/
void idRestoreGame::ReadRenderEntity( renderEntity_t &renderEntity ) {
	int i;
	int index;
	ReadModel( renderEntity.hModel );
	ReadInt( renderEntity.entityNum );
	ReadInt( renderEntity.bodyId );
	ReadBounds( renderEntity.bounds );
	// callback is set by class's Restore function
	renderEntity.callback = NULL;
	renderEntity.callbackData = NULL;
	ReadInt( renderEntity.suppressSurfaceInViewID );
	ReadInt( renderEntity.suppressShadowInViewID );
	ReadInt( renderEntity.suppressShadowInLightID );
	ReadInt( renderEntity.allowSurfaceInViewID );
	ReadVec3( renderEntity.origin );
	ReadMat3( renderEntity.axis );
	ReadMaterial( renderEntity.customShader );
	ReadMaterial( renderEntity.referenceShader );
	ReadSkin( renderEntity.customSkin );
	ReadInt( index );
	renderEntity.referenceSound = gameSoundWorld->EmitterForIndex( index );
	for( i = 0; i < MAX_ENTITY_SHADER_PARMS; i++ ) {
		ReadFloat( renderEntity.shaderParms[ i ] );
	}
	for( i = 0; i < MAX_RENDERENTITY_GUI; i++ ) {
		ReadUserInterface( renderEntity.gui[ i ] );
	}
	// idEntity will restore "cameraTarget", which will be used in idEntity::Present to restore the remoteRenderView
	renderEntity.remoteRenderView = NULL;
	renderEntity.joints = NULL;
	renderEntity.numJoints = 0;
	ReadFloat( renderEntity.modelDepthHack );
	ReadBool( renderEntity.noSelfShadow );
	ReadBool( renderEntity.noShadow );
	ReadBool( renderEntity.noDynamicInteractions );
	ReadBool( renderEntity.weaponDepthHack );
	ReadInt( renderEntity.forceUpdate );
}
开发者ID:revelator,项目名称:Revelation-Engine,代码行数:43,代码来源:SaveGame.cpp


示例13: ParseColor

/*************
 * DESCRIPTION: read a color
 * INPUT:       color   pointer to color
 * OUTPUT:      -
 *************/
static void ParseColor(HANDLER_DATA *data, COLOR *color)
{
	CHUNK chunk;
	UBYTE c[3];

	BeginChunk(data, &chunk);

	switch (chunk.id)
	{
		case ID_COLOR1:
				ReadFloat(data, &color->r, 1);
				ReadFloat(data, &color->g, 1);
				ReadFloat(data, &color->b, 1);
				break;

		case ID_COLOR255:
				ReadChunkBytes(data, &c, 3);
				color->r = c[0]/255.0f;
				color->g = c[1]/255.0f;
				color->b = c[2]/255.0f;
				break;
	}
	EndChunk(data, &chunk);
}
开发者ID:Kalamatee,项目名称:RayStorm,代码行数:29,代码来源:3ds.cpp


示例14: LoadStatsFile

/* EXPORT->LoadStatsFile: load the statistics file output by HERest */
void LoadStatsFile(char *statfile,HMMSet *hset,Boolean otrace)
{
   Source src;
   char hname[256];
   int i,idx,count,N,lnum = 0;
   float x;
   HMMDef *hmm;
   MLink ml;
   LabId hmmId;
   double occSum = 0.0;
   long occN = 0;
   StateInfo *si;
   Boolean bin=FALSE;

   if(InitSource(statfile,&src,NoFilter)<SUCCESS)
      HError(7210,"LoadStatsFile: Can't open file %s", statfile);
   while(ReadInt(&src,&idx,1,bin)) {
      ++lnum;
      if (!ReadString(&src,hname) || !ReadInt(&src,&count,1,bin))
         HError(7250,"LoadStatsFile: Format error in file %s line %d",
                statfile,lnum);

      /* look up hname and find num states N */
      if ((hmmId = GetLabId(hname,FALSE))==NULL)
         HError(7251,"LoadStatsFile: unknown name %s at line %d",
                hname,lnum);
      if ((ml = FindMacroName(hset,'l',hmmId))==NULL)
         HError(7251,"LoadStatsFile: unknown model %s at line %d",
                hname,lnum);
      hmm = (HMMDef *) ml->structure;
      N = hmm->numStates;
      for (i=2; i<N; i++) {
         if (!ReadFloat(&src,&x,1,bin))
            HError(7250,"LoadStatsFile: Float format error file %s line %d\n",
                   statfile,lnum);
         si = hmm->svec[i].info;
         si->stateCounter = count;/* load the # of times the state occurred */
         memcpy(&(si->hook),&x,sizeof(float)); /* !! */
         occSum += x; ++occN;
      }
   }
   CloseSource(&src);
   if (otrace || (trace & T_OCC)) {
      printf("  Stats loaded for %d models\n",lnum);
      printf("  Mean Occupation Count = %f\n",occSum/occN);
      fflush(stdout);
   }
}
开发者ID:deardaniel,项目名称:PizzaTest,代码行数:49,代码来源:HUtil.c


示例15: ReadMat3

/*
================
idRestoreGame::ReadRenderLight
================
*/
void idRestoreGame::ReadRenderLight( renderLight_t &renderLight ) {
    int index;
    int i;

    ReadMat3( renderLight.axis );
    ReadVec3( renderLight.origin );

    ReadInt( renderLight.suppressLightInViewID );
    ReadInt( renderLight.allowLightInViewID );
    ReadBool( renderLight.noShadows );
    ReadBool( renderLight.pointLight );
    ReadBool( renderLight.parallel );

    ReadVec3( renderLight.lightRadius );
    ReadVec3( renderLight.lightCenter );

    ReadVec3( renderLight.target );
    ReadVec3( renderLight.right );
    ReadVec3( renderLight.up );
    ReadVec3( renderLight.start );
    ReadVec3( renderLight.end );

    ReadBool( renderLight.ambient );	// sikk - Ambient Light Flag
// ---> sikk - Ambient Light Color
    ReadVec3( renderLight.ambColor_X_Neg );
    ReadVec3( renderLight.ambColor_X_Pos );
    ReadVec3( renderLight.ambColor_Y_Neg );
    ReadVec3( renderLight.ambColor_Y_Pos );
    ReadVec3( renderLight.ambColor_Z_Neg );
    ReadVec3( renderLight.ambColor_Z_Pos );
// <--- sikk - Ambient Light Color
    ReadVec3( renderLight.ambRotation );	// sikk - Ambient Light Rotation

    // only idLight has a prelightModel and it's always based on the entityname, so we'll restore it there
    // ReadModel( renderLight.prelightModel );
    renderLight.prelightModel = NULL;

    ReadInt( renderLight.lightId );

    ReadMaterial( renderLight.shader );

    for( i = 0; i < MAX_ENTITY_SHADER_PARMS; i++ ) {
        ReadFloat( renderLight.shaderParms[ i ] );
    }

    ReadInt( index );
    renderLight.referenceSound = gameSoundWorld->EmitterForIndex( index );
}
开发者ID:RobertBeckebans,项目名称:Sikkpin-Breadcrumps-src,代码行数:53,代码来源:SaveGame.cpp


示例16: fd

void Wheel::LoadFile(std::string filename) {
  std::ifstream fd(filename.c_str());

  _size_x = ReadFloat(&fd);
  _size_y = ReadFloat(&fd);

  _max_motor_torque = ReadFloat(&fd);
  _side_damping     = ReadFloat(&fd);
  _linear_damping   = ReadFloat(&fd);
  _density          = ReadFloat(&fd);
  _friction         = ReadFloat(&fd);

  fd.close();
}
开发者ID:jsj2008,项目名称:racing,代码行数:14,代码来源:car.cpp


示例17: ParseMapping

/*************
 * DESCRIPTION: read mapping coordinates of object
 * INPUT:       -
 * OUTPUT:      -
 *************/
static void ParseMapping(HANDLER_DATA *data)
{
	// read number of mapping coordinates
	ReadWord(data, (WORD *)&data->mapcount, 1);

	if (data->mapcount == 0)
		return;

	data->mapping = new VECT2D[data->mapcount]; // Allocate memory
	if (!data->mapping)
	{
		data->err = ERR_MEM;
		return;
	}
	ReadFloat(data, (float *)data->mapping, data->mapcount*2); // Read mapping coordinates
}
开发者ID:Kalamatee,项目名称:RayStorm,代码行数:21,代码来源:3ds.cpp


示例18: ReadVector

void ReadVector(TiXmlElement *element, Point3 &v)
{
    double x = (double) v.x;
    double y = (double) v.y;
    double z = (double) v.z;
    element->QueryDoubleAttribute( "x", &x );
    element->QueryDoubleAttribute( "y", &y );
    element->QueryDoubleAttribute( "z", &z );
    v.x = (float) x;
    v.y = (float) y;
    v.z = (float) z;
    
    float f=1;
    ReadFloat( element, f );
    v *= f;
}
开发者ID:varunk08,项目名称:raytracing,代码行数:16,代码来源:xmlload.cpp


示例19: ReadColor

void ReadColor(TiXmlElement *element, Color &c)
{
    double r = (double) c.r;
    double g = (double) c.g;
    double b = (double) c.b;
    element->QueryDoubleAttribute( "r", &r );
    element->QueryDoubleAttribute( "g", &g );
    element->QueryDoubleAttribute( "b", &b );
    c.r = (float) r;
    c.g = (float) g;
    c.b = (float) b;
    
    float f=1;
    ReadFloat( element, f );
    c *= f;
}
开发者ID:varunk08,项目名称:raytracing,代码行数:16,代码来源:xmlload.cpp


示例20: _pm_checkPacketId

size_t Particle::deserialize(const Buffer& _src, size_t _offset)
{
	_offset = _pm_checkPacketId(_src, _offset);

	_offset = ReadString16(_src, _offset, _pf_particleName);
	_offset = ReadFloat(_src, _offset, _pf_x);
	_offset = ReadFloat(_src, _offset, _pf_y);
	_offset = ReadFloat(_src, _offset, _pf_z);
	_offset = ReadFloat(_src, _offset, _pf_offsetX);
	_offset = ReadFloat(_src, _offset, _pf_offsetY);
	_offset = ReadFloat(_src, _offset, _pf_offsetZ);
	_offset = ReadFloat(_src, _offset, _pf_particleSpeed);
	_offset = ReadInt32(_src, _offset, _pf_numOfParticles);
	_pf_initialized = true;
	return _offset;
}
开发者ID:TRocket,项目名称:gnuCraft,代码行数:16,代码来源:msg_0x3f_particle_stc.cpp



注:本文中的ReadFloat函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ReadFromFile函数代码示例发布时间:2022-05-30
下一篇:
C++ ReadFile函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap