您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ F32函数代码示例

51自学网 2021-06-01 20:40:21
  C++
这篇教程C++ F32函数代码示例写得很实用,希望能帮到您。

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

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

示例1: F32

QuatF & Quat16::getQuatF( QuatF * q ) const{   q->x = F32( x ) / F32(MAX_VAL);   q->y = F32( y ) / F32(MAX_VAL);   q->z = F32( z ) / F32(MAX_VAL);   q->w = F32( w ) / F32(MAX_VAL);   return *q;}
开发者ID:03050903,项目名称:Torque3D,代码行数:8,


示例2: pos

void GFXD3D9Device::setClipRect( const RectI &inRect ) {	// We transform the incoming rect by the view    // matrix first, so that it can be used to pan   // and scale the clip rect.   //   // This is currently used to take tiled screenshots.	Point3F pos( inRect.point.x, inRect.point.y, 0.0f );   Point3F extent( inRect.extent.x, inRect.extent.y, 0.0f );   getViewMatrix().mulP( pos );   getViewMatrix().mulV( extent );     RectI rect( pos.x, pos.y, extent.x, extent.y );   // Clip the rect against the renderable size.   Point2I size = mCurrentRT->getSize();   RectI maxRect(Point2I(0,0), size);   rect.intersect(maxRect);   mClipRect = rect;   F32 l = F32( mClipRect.point.x );   F32 r = F32( mClipRect.point.x + mClipRect.extent.x );   F32 b = F32( mClipRect.point.y + mClipRect.extent.y );   F32 t = F32( mClipRect.point.y );   // Set up projection matrix,    static Point4F pt;      pt.set(2.0f / (r - l), 0.0f, 0.0f, 0.0f);   mTempMatrix.setColumn(0, pt);   pt.set(0.0f, 2.0f/(t - b), 0.0f, 0.0f);   mTempMatrix.setColumn(1, pt);   pt.set(0.0f, 0.0f, 1.0f, 0.0f);   mTempMatrix.setColumn(2, pt);   pt.set((l+r)/(l-r), (t+b)/(b-t), 1.0f, 1.0f);   mTempMatrix.setColumn(3, pt);   setProjectionMatrix( mTempMatrix );   // Set up world/view matrix   mTempMatrix.identity();      setWorldMatrix( mTempMatrix );   setViewport( mClipRect );}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:48,


示例3: mAcos

QuatF & QuatF::interpolate( const QuatF & q1, const QuatF & q2, F32 t ){   //-----------------------------------   // Calculate the cosine of the angle:   double cosOmega = q1.dot( q2 );   //-----------------------------------   // adjust signs if necessary:   F32 sign2;   if ( cosOmega < 0.0 )   {      cosOmega = -cosOmega;      sign2 = -1.0f;   }   else      sign2 = 1.0f;   //-----------------------------------   // calculate interpolating coeffs:   double scale1, scale2;   if ( (1.0 - cosOmega) > 0.00001 )   {      // standard case      double omega = mAcos(cosOmega);      double sinOmega = mSin(omega);      scale1 = mSin((1.0 - t) * omega) / sinOmega;      scale2 = sign2 * mSin(t * omega) / sinOmega;   }   else   {      // if quats are very close, just do linear interpolation      scale1 = 1.0 - t;      scale2 = sign2 * t;   }   //-----------------------------------   // actually do the interpolation:   x = F32(scale1 * q1.x + scale2 * q2.x);   y = F32(scale1 * q1.y + scale2 * q2.y);   z = F32(scale1 * q1.z + scale2 * q2.z);   w = F32(scale1 * q1.w + scale2 * q2.w);   return *this;}
开发者ID:CouleeApps,项目名称:MBExtender,代码行数:48,


示例4: setLastError

bool Win32RedBookDevice::getVolume(F32 * volume){   if(!mAcquired)   {      setLastError("Device has not been acquired");      return(false);   }   if(!mVolumeInitialized)   {      setLastError("Volume failed to initialize");      return(false);   }   U32 vol = 0;   if(mUsingMixer)   {      mixerGetControlDetails(mVolumeDeviceId, &mMixerVolumeDetails, MIXER_GETCONTROLDETAILSF_VALUE);      vol = mMixerVolumeValue.dwValue;   }   else      auxGetVolume(mAuxVolumeDeviceId, (unsigned long *)&vol);   vol &= 0xffff;   *volume = F32(vol) / 65535.f;   setLastError("");   return(true);}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:29,


示例5: LL_INFOS

/*virtual*/void LLMediaDataClient::Responder::error(U32 status, const std::string& reason){	if (status == HTTP_SERVICE_UNAVAILABLE)	{		F32 retry_timeout = mRequest->getRetryTimerDelay();				mRequest->incRetryCount();				if (mRequest->getRetryCount() < mRequest->getMaxNumRetries()) 		{			LL_INFOS("LLMediaDataClient") << *mRequest << " got SERVICE_UNAVAILABLE...retrying in " << retry_timeout << " seconds" << LL_ENDL;						// Start timer (instances are automagically tracked by			// InstanceTracker<> and LLEventTimer)			new RetryTimer(F32(retry_timeout/*secs*/), this);		}		else {			LL_INFOS("LLMediaDataClient") << *mRequest << " got SERVICE_UNAVAILABLE...retry count " 				<< mRequest->getRetryCount() << " exceeds " << mRequest->getMaxNumRetries() << ", not retrying" << LL_ENDL;		}	}	else {		std::string msg = boost::lexical_cast<std::string>(status) + ": " + reason;		LL_WARNS("LLMediaDataClient") << *mRequest << " http error(" << msg << ")" << LL_ENDL;	}}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:27,


示例6: ASSERT

//// GetNearbyWalls//// Get walls within link distance of the given position//void WallObjType::GetNearbyWalls(Team *team, const Vector &p, WallObjList &list, WallObj *filter){  ASSERT(WorldCtrl::MetreOnMap(p.x, p.z))  // What range should we search in  F32 range = F32(GetRangeStraight() + 1) * WorldCtrl::CellSize();  // Generate a unit iterator  UnitObjIter::Tactical i(NULL, UnitObjIter::FilterData(team, Relation::ALLY, p, range));  UnitObj *obj;  // Check each unit  while ((obj = i.Next()) != NULL)  {    // Is this a wall    if (WallObj *wall = Promote::Object<WallObjType, WallObj>(obj))    {      // Should we add it      if (wall != filter)      {        list.Append(wall);      }    }  }  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:31,


示例7: F32

void PGRAPH::ClearSurface(U32 mask) {    // Avoid clearing empty surfaces    if (surface.width == 0 || surface.height == 0) {        return;    }    const F32 color[4] = {        ((clear_color >> 24) & 0xFF) / 255.0f, // Red        ((clear_color >> 16) & 0xFF) / 255.0f, // Green        ((clear_color >>  8) & 0xFF) / 255.0f, // Blue        ((clear_color >>  0) & 0xFF) / 255.0f, // Alpha    };    const F32 depth = clear_depth / F32(0xFFFFFF);    const U08 stencil = clear_stencil;    if (mask & RSX_CLEAR_BIT_COLOR) {        auto* colorTarget = getColorTarget(surface.colorOffset[0]);        cmdBuffer->cmdClearColor(colorTarget, color);    }    if (mask & (RSX_CLEAR_BIT_DEPTH | RSX_CLEAR_BIT_STENCIL)) {        // TODO: Depth-exclusive or stencil-exclusive clears are unimplemented        auto* depthTarget = getDepthStencilTarget(surface.depthOffset);        cmdBuffer->cmdClearDepthStencil(depthTarget, depth, stencil);    }    // TODO: Check if cmdBuffer is empty    cmdBuffer->finalize();    cmdQueue->submit(cmdBuffer, fence);    fence->wait();    cmdBuffer->reset();}
开发者ID:zod331,项目名称:nucleus,代码行数:30,


示例8: F32

// Return a measure of a player's strength.// Right now this is roughly a kill - death / kill + death ratio// Better might be: https://secure.wikimedia.org/wikipedia/en/wiki/Elo_rating_systemF32 Statistics::getCalculatedRating(){   // Total kills = mKills + mFratricides (but we won't count mFratricides)   // Counted deaths = mDeaths - mSuicides (mSuicides are included in mDeaths and we want to ignore them)   // Use F32 here so we don't underflow with U32 math; probably not necessary   F32 deathsDueToEnemyAction   = F32(mTotalDeaths) - F32(mTotalSuicides);   F32 totalTotalKillsAndDeaths = F32(mTotalKills) + deathsDueToEnemyAction;   // Initial case: you haven't killed or died -- go out and prove yourself, lad!   if(totalTotalKillsAndDeaths == 0)      return 0;   // Standard case   else         return ((F32)mTotalKills - deathsDueToEnemyAction) / totalTotalKillsAndDeaths;}
开发者ID:AnsonX10,项目名称:bitfighter,代码行数:19,


示例9: PROFILE_SCOPE

bool StdClientProcessList::advanceTime( SimTime timeDelta ){   PROFILE_SCOPE( StdClientProcessList_AdvanceTime );   if ( doBacklogged( timeDelta ) )      return false;    bool ret = Parent::advanceTime( timeDelta );   ProcessObject *obj = NULL;   AssertFatal( mLastDelta >= 0.0f && mLastDelta <= 1.0f, "mLastDelta is not zero to one.");      obj = mHead.mProcessLink.next;   while ( obj != &mHead )   {            if ( obj->isTicking() )         obj->interpolateTick( mLastDelta );      obj = obj->mProcessLink.next;   }   for (U32 i = 0; i < UpdateInterface::all.size(); i++)   {      Component *comp = dynamic_cast<Component*>(UpdateInterface::all[i]);      if (!comp->isClientObject() || !comp->isActive())            continue;      UpdateInterface::all[i]->interpolateTick(mLastDelta);   }   // Inform objects of total elapsed delta so they can advance   // client side animations.   F32 dt = F32(timeDelta) / 1000;   // Update camera FX.   gCamFXMgr.update( dt );   obj = mHead.mProcessLink.next;   while ( obj != &mHead )   {            obj->advanceTime( dt );      obj = obj->mProcessLink.next;   }      for (U32 i = 0; i < UpdateInterface::all.size(); i++)   {      Component *comp = dynamic_cast<Component*>(UpdateInterface::all[i]);      if (comp)      {         if (!comp->isClientObject() || !comp->isActive())            continue;      }      UpdateInterface::all[i]->advanceTime(dt);   }   return ret;}
开发者ID:nev7n,项目名称:Torque3D,代码行数:60,


示例10: Mesh

//// Adjust resource display//void ResourceObj::AdjustResource(){  if (Mesh().curCycle)  {    Mesh().SetFrame((Mesh().curCycle->maxFrame - 1) * (1.0f - (F32(resource) * ResourceType()->GetResourceMaxInv())));  }}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:10,


示例11: strnew

   AppIfl::AppIfl(const char * fullPath)   {      mIflFile = strnew(fullPath);      // load in duration and names      std::ifstream is;      is.open(fullPath);      char buffer[256];      char name[256];      S32 duration;      while (is.good() && !is.eof())      {         is.getline(buffer,sizeof(buffer));         S32 num = sscanf(buffer,"%s %i",name,&duration);         if (num==1)         {            mNames.push_back(strnew(name));            mDurations.push_back(AppTime(1.0f/30.0f,0));         }         else if (num==2)         {            mNames.push_back(strnew(name));            mDurations.push_back(AppTime(F32(duration)/30.0f,0));         }      }   }
开发者ID:parhelia512,项目名称:tge-152-fork,代码行数:28,


示例12: F32

void EnergyGaugeRenderer::render(S32 energy){   // Create fade   static const F32 colors[] = {      Colors::blue.r, Colors::blue.g, Colors::blue.b, 1,   // Fade from      Colors::blue.r, Colors::blue.g, Colors::blue.b, 1,      Colors::cyan.r, Colors::cyan.g, Colors::cyan.b, 1,   // Fade to      Colors::cyan.r, Colors::cyan.g, Colors::cyan.b, 1,   };   GaugeRenderer::render(energy, Ship::EnergyMax, colors, GaugeBottomMargin, GaugeHeight, Ship::EnergyCooldownThreshold);#ifdef SHOW_SERVER_SITUATION   ServerGame *serverGame = GameManager::getServerGame();   if((serverGame && serverGame->getClientInfo(0)->getConnection()->getControlObject()))   {      S32 actDiff = static_cast<Ship *>(serverGame->getClientInfo(0)->getConnection()->getControlObject())->getEnergy();      S32 p = F32(actDiff) / Ship::EnergyMax * GaugeWidth;      glColor(Colors::magenta);      drawVertLine(xul + p, yul - SafetyLineExtend - 1, yul + GaugeHeight + SafetyLineExtend);      //Or, perhaps, just this:      //renderGauge(energy, Ship::EnergyMax, Colors::blue, Colors::cyan, GaugeBottomMargin, GaugeHeight);   }#endif}
开发者ID:LibreGames,项目名称:bitfighter,代码行数:27,


示例13: U32

  //  // Process the recycler  //  void Base::Recycler::Process()  {    // Work out how much resource is pending from refunds    U32 refund = 0;    for (UnitObjList::Iterator u(&state.GetBase().GetManager().GetRefunds()); *u; ++u)    {      refund += U32(F32((**u)->GetResourceValue() * (**u)->UnitType()->GetRecyclePercentage()));    }    Object &object = state.GetBase().GetObject();    Team *team = object.GetTeam();    U32 resource = team->GetResourceStore();    // Do we have less cash now than the limit ?    if ((resource + refund) < cash)    {      for (NList<Type>::Iterator t(&types); *t; ++t)      {        const NList<UnitObj> *units = team->GetUnitObjects((*t)->type->GetNameCrc());        if (units && units->GetCount() > (*t)->minimum)        {          // Order this unit to be recycled          UnitObj *unit = units->GetHead();          Orders::Game::ClearSelected::Generate(object);          Orders::Game::AddSelected::Generate(object, unit);          Orders::Game::Recycle::Generate(object);          state.GetBase().GetManager().AddRefund(unit);          break;        }      }    }  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:37,


示例14: F32

// strait twisty beam//void BeamRenderPlain::Setup(){  // get beam rendering class  BeamRenderPlainClass * sc = (BeamRenderPlainClass *)proto;  F32 t = paramAnim.Current().scale;  if (t <= 1)  {    offset = sc->data.vector * t;  }  Quaternion r = angle * rotation;  const Vector & p0 = particle->matrix.posit;  Vector * p = points.data, * pe = points.data + points.count - 1;  *p++ = p0;  Vector dof = offset * (1.0f / F32(points.count - 1)), off = dof;  //LOG_DIAG((""))  //LOG_DIAG((""))  //LOG_DIAG(("p: %f,%f,%f", p->x, p->y, p->z));  for (F32 h = 0; p < pe; p++, off += dof, r *= twist)  {    *p = p0 + off + r.GetRight() * sc->distance;    //LOG_DIAG(("p: %f,%f,%f", p->x, p->y, p->z));  }  *p = p0 + off;  //LOG_DIAG(("p: %f,%f,%f", p->x, p->y, p->z));}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:30,


示例15: ReadJoystick

bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask, U32 &hatMask){   if(!gJoystickInit)      return false;   S32 i;   for(i = 0; i < MaxJoystickAxes; i++)   {      ControllerElement *e = &gController.axes[i];      S32 elementValue = getElementValue(e);      S32 diff = e->maxValue - e->minValue;      if(diff != 0)      {         axes[i] = (elementValue - e->minValue) * 2 / F32(diff);         axes[i] -= 1;      }      else         axes[i] = 0;   }   buttonMask = 0;   for(i = 0; i < gController.buttons.size(); i++)   {      ControllerElement *e = &gController.buttons[i];      S32 value = getElementValue(e);      if(value)         buttonMask |= (1 << i);   }   return true;}
开发者ID:HwakyoungLee,项目名称:opentnl,代码行数:30,


示例16: F32

SFXBuffer* SFXProfile::_createBuffer(){   SFXBuffer* buffer = 0;      // Try to create through SFXDevie.      if( !mFilename.isEmpty() && SFX )   {      buffer = SFX->_createBuffer( mFilename, mDescription );      if( buffer )      {         #ifdef TORQUE_DEBUG         const SFXFormat& format = buffer->getFormat();         Con::printf( "%s SFX: %s (%i channels, %i kHz, %.02f sec, %i kb)",            mDescription->mIsStreaming ? "Streaming" : "Loaded", mFilename.c_str(),            format.getChannels(),            format.getSamplesPerSecond() / 1000,            F32( buffer->getDuration() ) / 1000.0f,            format.getDataLength( buffer->getDuration() ) / 1024 );         #endif      }   }      // If that failed, load through SFXResource.      if( !buffer )   {      Resource< SFXResource >& resource = getResource();      if( resource != NULL && SFX )      {         #ifdef TORQUE_DEBUG         const SFXFormat& format = resource->getFormat();         Con::printf( "%s SFX: %s (%i channels, %i kHz, %.02f sec, %i kb)",            mDescription->mIsStreaming ? "Streaming" : "Loading", resource->getFileName().c_str(),            format.getChannels(),            format.getSamplesPerSecond() / 1000,            F32( resource->getDuration() ) / 1000.0f,            format.getDataLength( resource->getDuration() ) / 1024 );         #endif         ThreadSafeRef< SFXStream > sfxStream = resource->openStream();         buffer = SFX->_createBuffer( sfxStream, mDescription );      }   }   return buffer;}
开发者ID:belzilep,项目名称:Torque3D,代码行数:47,


示例17: switch

    //    // Image::Notify    //    void Image::Notify(U32 crc)    {      switch (crc)      {        case 0xC3AC47E6: // "Render::PostIFace2"        {          F32 curr = Simulate();          // Calculate screen rectangle          const ClipRect &rc = cineViewPort;          ClipRect newRc;          if (absolute)          {            if (absPos.x < 0)            {              newRc.p0.x = rc.p1.x - absSize.x + absPos.x;            }            else            {              newRc.p0.x = rc.p0.x + absPos.x;            }            if (absPos.y < 0)            {              newRc.p0.y = rc.p1.y - absSize.y + absPos.y;            }            else            {              newRc.p0.y = rc.p0.y + absPos.y;            }            newRc.p1 = newRc.p0 + absSize;          }          else          {            newRc.p0.x = rc.p0.x + Utils::FtoL(pos.x * F32(rc.Width()));            newRc.p0.y = rc.p0.y + Utils::FtoL(pos.y * F32(rc.Height()));            newRc.p1.x = rc.p0.x + Utils::FtoL((pos.x + size.x) * F32(rc.Width()));            newRc.p1.y = rc.p0.y + Utils::FtoL((pos.y + size.y) * F32(rc.Height()));          }          IFace::RenderRectangle(newRc, clr, &texture, curr * IFace::data.alphaScale);          return;        }      }    }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:50,


示例18: v

void AtlasOldMesher::updateBounds(){   // Reset our bounds!   mBounds.minExtents.set(F32_MAX, F32_MAX, F32_MAX);   mBounds.maxExtents.set(-F32_MAX, -F32_MAX, -F32_MAX);   // First, iterate over our verts and our bounds.   for(S32 i=0; i<mVerts.size(); i++)   {      S16 z;      if(mVerts[i].special)         z = mVerts[i].z;      else         z = mHeight->sampleRead(mVerts[i].pos);      Point3F v(  mVerts[i].pos.x * mHeight->mSampleSpacing,                  mVerts[i].pos.y * mHeight->mSampleSpacing,                  z * mHeight->mVerticalScale);      if(i)      {         mBounds.maxExtents.setMax(v);         mBounds.minExtents.setMin(v);         if(z < mMinZ) mMinZ = z;         if(z > mMaxZ) mMaxZ = z;      }      else      {         mMaxZ = mMinZ = z;         mBounds.maxExtents = mBounds.minExtents = v;      }   }   // Calculate quantization for compression.   Point3F boxExtents(mBounds.len_x() / 2.f, mBounds.len_y() / 2.f, mBounds.len_z() / 2.f);   boxExtents.setMax(Point3F(1, 1, 1)); // Make sure we don't bottom out...   // Use (1 << 14) values in both positive and negative   // directions.  Wastes just under 1 bit, but the total range   // is [-2^14, 2^14], which is 2^15+1 values.  This is good --   // fits nicely w/ 2^N+1 dimensions of binary-triangle-tree   // vertex locations.   mCompressionFactor.x = F32(1<<14) / boxExtents.x;   mCompressionFactor.y = F32(1<<14) / boxExtents.y;   mCompressionFactor.z = F32(1<<14) / boxExtents.z;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:47,


示例19: ejectionAxis

//----------------------------------------------------------------------------// Create ring//----------------------------------------------------------------------------SplashRing Splash::createRing(){   SplashRing ring;   U32 numPoints = mDataBlock->numSegments + 1;   Point3F ejectionAxis( 0.0, 0.0, 1.0 );   Point3F axisx;   if (mFabs(ejectionAxis.z) < 0.999f)      mCross(ejectionAxis, Point3F(0, 0, 1), &axisx);   else      mCross(ejectionAxis, Point3F(0, 1, 0), &axisx);   axisx.normalize();   for( U32 i=0; i<numPoints; i++ )   {      F32 t = F32(i) / F32(numPoints);      AngAxisF thetaRot( axisx, mDataBlock->ejectionAngle * (M_PI / 180.0));      AngAxisF phiRot(   ejectionAxis, t * (M_PI * 2.0));      Point3F pointAxis = ejectionAxis;      MatrixF temp;      thetaRot.setMatrix(&temp);      temp.mulP(pointAxis);      phiRot.setMatrix(&temp);      temp.mulP(pointAxis);      Point3F startOffset = axisx;      temp.mulV( startOffset );      startOffset *= mDataBlock->startRadius;      SplashRingPoint point;      point.position = getPosition() + startOffset;      point.velocity = pointAxis * mDataBlock->velocity;      ring.points.push_back( point );   }   ring.color = mDataBlock->colors[0];   ring.lifetime = mDataBlock->ringLifetime;   ring.elapsedTime = 0.0;   ring.v = mDataBlock->texFactor * mFmod( mElapsedTime, 1.0 );   return ring;}
开发者ID:fr1tz,项目名称:terminal-overload,代码行数:50,


示例20: int

//--------------------------------------------------------------------------/// Function to draw a set of boxes blending throughout an array of colorsvoid GuiColorPickerCtrl::drawBlendRangeBox(RectI &bounds, bool vertical, U8 numColors, ColorI *colors){   GFX->setStateBlock(mStateBlock);      S32 l = bounds.point.x, r = bounds.point.x + bounds.extent.x + 4;   S32 t = bounds.point.y, b = bounds.point.y + bounds.extent.y + 4;      // Calculate increment value   S32 x_inc = int(mFloor((r - l) / F32(numColors-1)));   S32 y_inc = int(mFloor((b - t) / F32(numColors-1)));   for( U16 i = 0;i < numColors - 1; i++ )    {      // This is not efficent, but then again it doesn't really need to be. -pw      PrimBuild::begin( GFXTriangleFan, 4 );      if (!vertical)  // Horizontal (+x)      {         // First color         PrimBuild::color( colors[i] );         PrimBuild::vertex2i( l, t );         PrimBuild::vertex2i( l, b );         // Second color         PrimBuild::color( colors[i+1] );         PrimBuild::vertex2i( l + x_inc, b );         PrimBuild::vertex2i( l + x_inc, t );         l += x_inc;      }      else  // Vertical (+y)      {         // First color         PrimBuild::color( colors[i] );         PrimBuild::vertex2i( l, t );         PrimBuild::vertex2i( r, t );         // Second color         PrimBuild::color( colors[i+1] );         PrimBuild::vertex2i( r, t + y_inc );         PrimBuild::vertex2i( l, t + y_inc );         t += y_inc;      }      PrimBuild::end();   }}
开发者ID:practicing01,项目名称:Torque3D,代码行数:48,


示例21: buildTimeMap

F32 CameraSpline::advanceTime(F32 t, S32 delta_ms){   buildTimeMap();   Knot k;   value(t, &k, false);   F32 dist = getDistance(t) + k.mSpeed * (F32(delta_ms) / 1000.0f);   return getTime(dist);}
开发者ID:03050903,项目名称:Torque3D,代码行数:8,


示例22: mouseLock

void GuiSliderCtrl::onMouseDown(const GuiEvent &event){   if ( !mActive || !mAwake || !mVisible )      return;   mouseLock();   setFirstResponder();   mDepressed = true;   Point2I curMousePos = globalToLocalCoord( event.mousePoint );   F32 value;   if (getWidth() >= getHeight())      value = F32(curMousePos.x-mShiftPoint) / F32(getWidth()-mShiftExtent)*(mRange.y-mRange.x) + mRange.x;   else      value = F32(curMousePos.y) / F32(getHeight())*(mRange.y-mRange.x) + mRange.x;      _updateThumb( value, mSnap || ( event.modifier & SI_SHIFT ) );}
开发者ID:AkiraofAstra,项目名称:Torque3D,代码行数:18,


示例23: SetVolume

 // // SetVolume // // Sets the current redbook audio volume // void SetVolume(F32 volume) {   if (initialized && driver)   {     AIL_redbook_set_volume     (       driver, Clamp<S32>(MIN_VOLUME, S32((volume * F32(MAX_VOLUME)) + 0.5F), MAX_VOLUME)     );   } }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:15,


示例24: isEqualQ16

   bool isEqualQ16(const Quaternion & a, const Quaternion &b)   {         U16 MAX_VAL = 0x7fff;      // convert components to 16 bit, then test for equality      S16 x, y, z, w;      x = ((S16)(a.x() * F32(MAX_VAL))) - ((S16)(b.x() * F32(MAX_VAL)));      y = ((S16)(a.y() * F32(MAX_VAL))) - ((S16)(b.y() * F32(MAX_VAL)));      z = ((S16)(a.z() * F32(MAX_VAL))) - ((S16)(b.z() * F32(MAX_VAL)));      w = ((S16)(a.w() * F32(MAX_VAL))) - ((S16)(b.w() * F32(MAX_VAL)));      return (x==0) && (y==0) && (z==0) && (w==0);   }
开发者ID:nzchris,项目名称:ms2dtsExporterPlus,代码行数:12,


示例25: F32

////////////////////////////////////////////////////////////////////////////////// /brief  Called when the mouse is moved while a particular mouse button is///         pressed.////// /details Updates the active object's rotation so that it appears rotated///         relative to start position of the drag.//////         Right and left mouse button dragging both have the same effect.///         Drag to the left or up to rotate CCW or right or down to rotate///         CW.////// /param  button The mouse button that is pressed.///         start  The position of the mouse when the drag operation started.///         end    The current position of the mouse.}void RotateEditorMode::onDragUpdate(I32 button, const vec2& start, const vec2& end){    EditorMode::onDragUpdate(button, start, end);    if (active_entity_ && (button == GLFW_MOUSE_BUTTON_LEFT || button == GLFW_MOUSE_BUTTON_RIGHT))    {        vec2 delta = end - start;        active_entity_->getTransform().setRotation(original_rotation_ + F32(3 * (delta.x + delta.y) / editor_.getZoom()));    }}
开发者ID:seflopod,项目名称:PBJsimple,代码行数:24,


示例26: Spline

  //  // Render a spline curve  //  void Spline(CubicSpline &curve, Color c, Bool normals, U32 normalMesh)  {    const U32 STEPS = 10;    if (curve.length < 1e-4F)    {      return;    }    F32 step = curve.length / F32(STEPS);    Vector v0 = curve.Step(0.0F);    Vector v1, tangent;    for (U32 i = 1; i <= STEPS; i++)    {      v1 = curve.Step(F32(i) * step, &tangent);      // Draw the line      FatLine(v0, v1, c, 0.15F);      // Draw normals      if (normals)      {        F32 veloc = tangent.Magnitude();        Matrix m = Matrix::I;        m.posit = v1;        // Normalize        if (veloc > 1e-4)        {          tangent *= 1.0F / veloc;          m.SetFromFront(tangent);        }        Common::Display::Mesh(normalMesh, m, c); // "TerrainMarker"      }      // Swap points      v0 = v1;    }  }
开发者ID:vgck,项目名称:opendr2,代码行数:45,


示例27: UnitObjType

//// Constructor//SpyObjType::SpyObjType(const char *name, FScope *fScope) : UnitObjType(name, fScope){  // Get specific config scope  fScope = fScope->GetFunction(SCOPE_CONFIG);  // Resources to steal per second, convert to per cycle  resourceRate = Utils::FtoL(StdLoad::TypeF32(fScope, "ResourceRate", F32(GameTime::CYCLESPERSECOND), Range<F32>::positive) * GameTime::INTERVAL);  // Level to reduce power to  powerLevel = StdLoad::TypeF32(fScope, "PowerLevel", 0.5F, Range<F32>::percentage);  // Power units to steal per second, convert to per cycle  powerRate = Utils::FtoL(StdLoad::TypeF32(fScope, "PowerRate", F32(GameTime::CYCLESPERSECOND), Range<F32>::positive) * GameTime::INTERVAL);  // Time delay from being compromised to being executed  surrenderCycles = Utils::FtoL(StdLoad::TypeF32(fScope, "SurrenderDelay", 6.0F, Range<F32>::positive) * F32(GameTime::CYCLESPERSECOND));  // Load the morphing properties  properties.Load(fScope, "Properties", FALSE);}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:23,


示例28: F32

//----------------------------------------------------------------------------// Emit rings//----------------------------------------------------------------------------void Splash::emitRings( F32 dt ){   mTimeSinceLastRing += dt;   S32 numNewRings = (S32) (mTimeSinceLastRing * F32(mDataBlock->ejectionFreq));   mTimeSinceLastRing -= numNewRings / mDataBlock->ejectionFreq;   for( S32 i=numNewRings-1; i>=0; i-- )   {      F32 t = F32(i) / F32(numNewRings);      t *= dt;      t += mTimeSinceLastRing;      SplashRing ring = createRing();      updateRing( ring, t );      ringList.pushBack( ring );   }}
开发者ID:fr1tz,项目名称:terminal-overload,代码行数:23,



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


C++ F77_CALL函数代码示例
C++ F3函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。