当前位置: 首页>>代码示例>>C++>>正文


C++ ColorF函数代码示例

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


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

示例1: set

//--------------------------------------------------------------------------- 
bool Sky::processArguments(int argc, const char **argv)
{
   if(argc == 0)
   {
      set(ColorF(0,0,0));
      return true;
   }
   if(argc >= 3)
   {
      set(ColorF(atof(argv[0]), atof(argv[1]), atof(argv[2])));
      if(argc == 3)
         return true;
      if(argc == 21)
      {
         const char * newDmlName = stringTable.insert( argv[3] );
         // int matTag = atoi(argv[3]);
         // if (!matTag) {
         //    Console->printf("\"%s\" not found in tag dictionary", argv[3]);
         //    return false;
         // }
         int tx[16];
         for (int i = 0; i < 16; i++)
            sscanf(argv[5 + i], "%d", &tx[i]);

         float featureAz = atof(argv[4]);
         set( newDmlName, featureAz, tx );
         return(true);
      }
   }
   Console->printf("Sky: [colR colG colB] [dmlFileName rotZ i1 ... i16]");
   return false;
}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:33,代码来源:Sky.cpp

示例2: if

void CPlayerPlugin_InteractiveEntityMonitor::PrecacheLevel()
{
	XmlNodeRef rootNode = gEnv->pSystem->LoadXmlFromFile(INTERACTIVE_ENTITY__MONITOR_DATA_FILE);
	if(rootNode)
	{
		const char* pLevelName = gEnv->pGame->GetIGameFramework()->GetLevelName();
		if(!pLevelName)
		{
			pLevelName = "default";
		}
		else if( const char * pTrim = strstr(pLevelName, "/") )
		{
			pLevelName = pTrim+1;
		}
		CGameXmlParamReader nodeDataReader(rootNode);
		XmlNodeRef levelNode = nodeDataReader.FindFilteredChild(pLevelName);
		if(!levelNode)
		{
			levelNode = nodeDataReader.FindFilteredChild("default");
		}
		if(levelNode)
		{
			ColorB color;
			if(levelNode->getAttr("color", color))
			{
				m_silhouetteInteractColor = ColorF(color.r, color.g, color.b, color.a) / 255.f;
			}
			if(levelNode->getAttr("shoot_color", color))
			{
				m_silhouetteShootColor = ColorF(color.r, color.g, color.b, color.a) / 255.f;
			}
		}
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:34,代码来源:PlayerPlugin_InteractiveEntityMonitor.cpp

示例3: SToolboxStyle

void CToolboxApplication::SetupDefaultStyle()
{
	m_toolboxStyle = SToolboxStyle();

	m_toolboxStyle.backgroundColor = ColorF(239 / 255.f, 239 / 255.f, 242 / 255.f);
	m_toolboxStyle.viewportClearColor = ColorF(0.f);

	m_toolboxStyle.toolWindowBorderColor = ColorB(214, 214, 214);

	m_toolboxStyle.delimiterColor = ColorB(150, 150, 147);
	m_toolboxStyle.delimiterSize = 5;

	m_toolboxStyle.topBarHeight = 35;
	m_toolboxStyle.infoBarHeight = 25;

	m_toolboxStyle.moverColor = ColorB(150, 150, 147);
	m_toolboxStyle.moverSize = 9;

	m_toolboxStyle.activeTabColor = ColorB(90, 142, 194);
	m_toolboxStyle.tabHeight = 20;
	m_toolboxStyle.tabWidthOffset = 25;
	m_toolboxStyle.tabPaddingX = 4;
	m_toolboxStyle.tabPaddingY = 2;
	m_toolboxStyle.tabFontSize = 16.f;
	m_toolboxStyle.tabFontColor = ColorB(51, 51, 51);
	m_toolboxStyle.activeTabFontColor = ColorB(255, 255, 255);

	m_toolboxStyle.pFont = gEnv->pCryFont->GetFont("roboto");
	m_toolboxStyle.defaultFontColor = ColorB(51, 51, 51);
}
开发者ID:PoppermostProductions,项目名称:Toolbox,代码行数:30,代码来源:Toolbox.cpp

示例4: colDefault

// ------------------------------------------------------------------------
void CInputDevice::CDebugPressedButtons::DebugRender()
{
	if (g_pInputCVars->i_debugDigitalButtons) 
	{
		static float deltaY = 15.f;
		static float startX = 50;
		static float startY = 400.f;
		static float fontSize = 1.2f;

		IRenderer* pRenderer = gEnv->pRenderer;
		if (pRenderer)
		{
			ColorF colDefault(1.f, 1.f, 0.f,1.f);
			m_textPos2d.x = startX;
			m_textPos2d.y = startY;
			pRenderer->Draw2dLabel(m_textPos2d.x, m_textPos2d.y, 1.1f, ColorF(0.f,1.f,0.f,1.f), false, "Controller's Digital Buttons Activity"); m_textPos2d.y+= deltaY;
			pRenderer->Draw2dLabel(m_textPos2d.x, m_textPos2d.y, 1.1f, ColorF(1.f,1.f,1.f,1.f), false, string().Format("CurrentFrame:[%d]", m_frameCnt)); m_textPos2d.y+= deltaY;

			for (size_t i=0, kSize=m_history.size(); i< kSize; ++i)
			{
				string s = string().Format("[%d] %s [%s]", m_history[i].frame, m_history[i].key.c_str(), m_history[i].state.c_str());
				pRenderer->Draw2dLabel(m_textPos2d.x, m_textPos2d.y, fontSize, m_history[i].color, false, s.c_str());
				m_textPos2d.y+= deltaY;
			}
			++m_frameCnt;
		}
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:29,代码来源:InputDevice.cpp

示例5: ColorF

MpViewPort3Data::MpViewPort3Data  (void)
{ 
  // 3D clipping
  clipping = false;                     // initially no 3d clipping

  cx1 = -1; cx2 = 1;                    // clip box volume
  cy1 = -1; cy2 = 1;
  cz1 = -1; cz2 = 1;

  // 3D view (camera position and focus length)
  fov = defFOV;                         // field of view angle in degree
  viewtrafo = defT;                     // view transformation matrix

  // viewbox ratios
  vbx = vby = vbz = 1.0;

  // viewport frame layout
  frame3d_color = ColorF(0,0,0);
  frame3d_width = 1;
  frame3d_style = Solid;

  // base block layout (plaster block)
  draw_base_block = false;              // set if 3D base block is drawn
  base_block_const_shade = true;        // use const shade, no lighting
  base_block_depth = 0.005;             // the base block depth (thickness)
  base_block_color = ColorF(0.8,0.8,0.8);    // color of the base block
  base_block_line_color = ColorF(0,0,0);     // color of its outlines
  base_block_line_width = 1;
  base_block_line_style = Solid;

  // back side walls
  draw_back_walls = false;                   // back side walls in 3D plots
  back_wall_const_shade = false;             // use const shade, no lighting
  back_wall_color = ColorF(0.8,0.8,0.8);     // color of the backside walls
}
开发者ID:lucafuji,项目名称:Gene-Correlation,代码行数:35,代码来源:mpviewport3d.cpp

示例6: GetEntity

void CBattleEvent::Update(SEntityUpdateContext &ctx, int updateSlot)
{
	IEntity* pEntity = GetEntity();
	if(pEntity)
	{
		Matrix34 tm = pEntity->GetWorldTM();
		tm.SetTranslation(m_worldPos);
		pEntity->SetWorldTM(tm);

		if(m_numParticles > 0 && !m_pParticleEffect)
		{
			// attach the particle effect to this entity now
			m_pParticleEffect = gEnv->pParticleManager->FindEffect(g_pGameCVars->g_battleDust_effect->GetString());
			if (m_pParticleEffect)
			{
				pEntity->LoadParticleEmitter(0, m_pParticleEffect, 0, true, true);
				Matrix34 tm = IParticleEffect::ParticleLoc(Vec3(0,0,0));
				pEntity->SetSlotLocalTM(0, tm);
			}
		}

		if(m_pParticleEffect)
		{
			SEntitySlotInfo info;
			pEntity->GetSlotInfo(0, info);
			if(info.pParticleEmitter)
			{
				SpawnParams sp;
				sp.fCountScale = (float)m_numParticles/60.0f;
				info.pParticleEmitter->SetSpawnParams(sp);
			}
		}

		if(g_pGameCVars->g_battleDust_debug != 0)
		{
			if(g_pGameCVars->g_battleDust_debug >= 2)
			{
				if(m_numParticles > 0)
				{
					gEnv->pRenderer->GetIRenderAuxGeom()->DrawSphere(m_worldPos, m_numParticles, ColorF(0.0f,1.0f,0.0f,0.2f));
				}
				else
				{
					gEnv->pRenderer->GetIRenderAuxGeom()->DrawSphere(m_worldPos, 0.5f, ColorF(1.0f,0.0f,0.0f,0.2f));
				}
			}
			else
			{
				if(m_numParticles > 0)
				{
					gEnv->pRenderer->GetIRenderAuxGeom()->DrawSphere(m_worldPos, 0.5f, ColorF(0.0f,1.0f,0.0f,0.2f));
				}
				else
				{
					gEnv->pRenderer->GetIRenderAuxGeom()->DrawSphere(m_worldPos, 0.5f, ColorF(1.0f,0.0f,0.0f,0.2f));
				}
			}
		}
	}
}
开发者ID:kitnet,项目名称:project-o,代码行数:60,代码来源:BattleDust.cpp

示例7: GetEntity

void CC4Projectile::UpdateLight(float fFrameTime, bool forceColorChange)
{
	const Matrix34& mat = GetEntity()->GetWorldTM();
	m_pLightSource->SetMatrix(mat);

	SC4ExplosiveParams* pExplosiveParams = m_pAmmoParams->pC4ExplosiveParams;

	if(pExplosiveParams->pulseBeatsPerSecond > 0.f)
	{
		float fNewPulseTimer = m_pulseTimer + (fFrameTime * pExplosiveParams->pulseBeatsPerSecond);

		float timerScaledToWavelength = fNewPulseTimer * gf_PI;
		timerScaledToWavelength = (float)__fsel(timerScaledToWavelength - gf_PI2, timerScaledToWavelength - gf_PI2, timerScaledToWavelength);

		float finalMult = sinf(timerScaledToWavelength) * 0.5f + 0.5f;

		finalMult *= 1.0f - pExplosiveParams->pulseMinColorMultiplier;
		finalMult += pExplosiveParams->pulseMinColorMultiplier;
		m_pulseTimer = fNewPulseTimer;
		
		CDLight& light = m_pLightSource->GetLightProperties();
		light.SetLightColor(ColorF(m_armed && m_OnSameTeam ? pExplosiveParams->armedLightColour * finalMult : pExplosiveParams->disarmedLightColour * finalMult));
	}
	else if(forceColorChange)
	{
		CDLight& light = m_pLightSource->GetLightProperties();
		light.SetLightColor(ColorF(m_armed && m_OnSameTeam ? pExplosiveParams->armedLightColour : pExplosiveParams->disarmedLightColour));
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:29,代码来源:C4Projectile.cpp

示例8: ResetScene

		/// <summary>
		/// カメラ、ライト、フォグ、画質の設定を初期設定に戻します。
		/// </summary>
		/// <returns>
		/// なし
		/// </returns>
		inline void ResetScene()
		{
			SetAmbientLight(ColorF(0.1));

			SetAmbientLightForward(ColorF(0.1));

			SetLight(0, Light::Default());

			for (uint32 i = 1; i <= MaxLightIndex; ++i)
			{
				SetLight(i, Light::None());
			}

			SetLightForward(0, Light::Default());

			for (uint32 i = 1; i <= MaxLightIndexForward; ++i)
			{
				SetLightForward(i, Light::None());
			}

			SetFog(Fog::None());

			SetFogForward(Fog::None());

			SetCamera(Camera());

			SetAntiAliasing(AntiAliasing::Default);

			SetLightBufferQuality(100);
		}
开发者ID:7th-Douji,项目名称:Siv3D-Reference,代码行数:36,代码来源:Graphics3D.hpp

示例9: CHANGED_NETWORK_STATE

void CNetPlayerInput::DoSetState(const SSerializedPlayerInput& input )
{
	m_newInterpolation |= (input.position != m_curInput.position) || (input.deltaMovement != m_curInput.deltaMovement);

	const bool wasSprinting = m_curInput.sprint;

	m_curInput = input;
	CHANGED_NETWORK_STATE(m_pPlayer,  CPlayer::ASPECT_INPUT_CLIENT );

	if(wasSprinting != input.sprint)
	{
		SInputEventData inputEventData( SInputEventData::EInputEvent_Sprint, m_pPlayer->GetEntityId(), CCryName("sprint"), input.sprint ? eAAM_OnPress : eAAM_OnRelease, 0.f );
		m_pPlayer->StateMachineHandleEventMovement( SStateEventPlayerInput( &inputEventData ) );
	}

	// not having these set seems to stop a remote avatars rotation being reflected
	m_curInput.aiming = true;
	m_curInput.allowStrafing = true;
	m_curInput.usinglookik = true;

	IAIActor* pAIActor = CastToIAIActorSafe(m_pPlayer->GetEntity()->GetAI());
	if (pAIActor)
		pAIActor->GetState().bodystate=input.bodystate;

	CMovementRequest moveRequest;
	moveRequest.SetStance( (EStance)m_curInput.stance );

	if(IsDemoPlayback())
	{
		Vec3 localVDir(m_pPlayer->GetViewQuatFinal().GetInverted() * m_curInput.lookDirection);
		Ang3 deltaAngles(asinf(localVDir.z),0,atan2_tpl(-localVDir.x,localVDir.y));
		moveRequest.AddDeltaRotation(deltaAngles*gEnv->pTimer->GetFrameTime());
	}

	moveRequest.SetPseudoSpeed(CalculatePseudoSpeed());
	moveRequest.SetAllowStrafing(input.allowStrafing);

	m_pPlayer->GetMovementController()->RequestMovement(moveRequest);

#if !defined(_RELEASE)
	// debug..
	if (g_pGameCVars->g_debugNetPlayerInput & 1)
	{
		IPersistantDebug * pPD = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug();
		pPD->Begin( string("net_player_input_") + m_pPlayer->GetEntity()->GetName(), true );
		pPD->AddSphere( moveRequest.GetLookTarget(), 0.5f, ColorF(1,0,1,1), 1.0f );
		//			pPD->AddSphere( moveRequest.GetMoveTarget(), 0.5f, ColorF(1,1,0,1), 1.0f );

		Vec3 wp(m_pPlayer->GetEntity()->GetWorldPos() + Vec3(0,0,2));
		pPD->AddDirection( wp, 1.5f, m_curInput.deltaMovement, ColorF(1,0,0,1), 1.0f );
		pPD->AddDirection( wp, 1.5f, m_curInput.lookDirection, ColorF(0,1,0,1), 1.0f );
	}
#endif
}
开发者ID:aronarts,项目名称:FireNET,代码行数:54,代码来源:NetPlayerInput.cpp

示例10: ColorF

void GuiColorPickerCtrl::resetProfileSettings()
{
	mPickColor = mPickColorCopy;
	mBaseColor = mBaseColorCopy;
	colorWhite = ColorF(1.,1.,1.);
	colorWhiteBlend = ColorF(1.,1.,1.,.75);
	colorBlack = ColorF(.0,.0,.0);
	colorAlpha = ColorF(0.0f, 0.0f, 0.0f, 0.0f);
	colorAlphaW = ColorF(1.0f, 1.0f, 1.0f, 0.0f);

	Parent::resetProfileSettings();
}
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:12,代码来源:guiColorPicker.cpp

示例11: mDegToRad

// This function is meant to be used with a button to put everything back to default settings.
void GuiMaterialPreview::resetViewport()
{
   // Reset the camera's orientation.
   mCameraRot.set( mDegToRad(30.0f), 0, mDegToRad(-30.0f) );
   mCameraPos.set(0.0f, 1.75f, 1.25f);
   mOrbitDist = 5.0f;
   mOrbitPos = mModel->getShape()->center;

   // Reset the viewport's lighting.
   GuiMaterialPreview::mFakeSun->setColor( ColorF( 1.0f, 1.0f, 1.0f ) );
   GuiMaterialPreview::mFakeSun->setAmbient( ColorF( 0.5f, 0.5f, 0.5f ) );
   GuiMaterialPreview::mFakeSun->setDirection( VectorF( 0.0f, 0.707f, -0.707f ) );
}
开发者ID:Azaezel,项目名称:Torque3D,代码行数:14,代码来源:guiMaterialPreview.cpp

示例12: GuiGradientSwatchCtrl

void GuiGradientCtrl::reInitSwatches( GuiGradientCtrl::PickMode )
{
	//liable to crash in the guiEditor, needs fix
	for( S32 i = 0;i < mColorRange.size(); i++ ) 
	{
		if(mColorRange[i].swatch != NULL)
		{
			mColorRange[i].pos = mColorRange[i].swatch->getPosition().x;
			mColorRange[i].color = mColorRange[i].swatch->getColor();
			mColorRange[i].swatch->deleteObject();
			mColorRange[i].swatch = NULL;
		}
	}
	
	for( S32 i = 0;i < mAlphaRange.size(); i++ ) 
	{
		if(mAlphaRange[i].swatch != NULL)
		{
			mAlphaRange[i].pos = mAlphaRange[i].swatch->getPosition().x;
			mAlphaRange[i].color = mAlphaRange[i].swatch->getColor();
			mAlphaRange[i].swatch->deleteObject();
			mAlphaRange[i].swatch = NULL;
		}
	}
	
	S32 b = mBlendRangeBox.extent.y - mSwatchFactor;

   if( mDisplayMode == pHorizColorRange )
	{
		for( S32 i = 0;i < mColorRange.size(); i++ ) 
		{
			mColorRange[i].swatch = new GuiGradientSwatchCtrl();
			mColorRange[i].swatch->registerObject();
			addObject(mColorRange[i].swatch);
			mColorRange[i].swatch->setPosition( Point2I( mColorRange[i].pos, b ) );// needs to be adjusted
			mColorRange[i].swatch->setColor(ColorF(mColorRange[i].color));
		}
	}

   else if( mDisplayMode == pHorizAlphaRange )
	{
		for( S32 i = 0;i < mAlphaRange.size(); i++ ) 
		{
			mAlphaRange[i].swatch = new GuiGradientSwatchCtrl();
			mAlphaRange[i].swatch->registerObject();
			addObject(mAlphaRange[i].swatch);
			mAlphaRange[i].swatch->setPosition( Point2I( mAlphaRange[i].pos, b ) );// needs to be adjusted
			mAlphaRange[i].swatch->setColor(ColorF(mAlphaRange[i].color));
		}
	}
}
开发者ID:03050903,项目名称:Torque3D,代码行数:51,代码来源:guiGradientCtrl.cpp

示例13: setExtent

//--------------------------------------------------------------------------
GuiColorPickerCtrl::GuiColorPickerCtrl()
{
   setExtent(140, 30);
   mDisplayMode = pPallet;
   mBaseColor = ColorF(1.,.0,1.);
   mPickColor = ColorF(.0,.0,.0);
   mSelectorPos = Point2I(0,0);
   mMouseDown = mMouseOver = false;
   mActive = true;
   mPositionChanged = false;
   mSelectorGap = 1;
   mActionOnMove = false;
	mShowReticle = true;
}
开发者ID:practicing01,项目名称:Torque3D,代码行数:15,代码来源:guiColorPicker.cpp

示例14: localVDir

void CNetPlayerInput::DoSetState(const SSerializedPlayerInput& input )
{
	m_curInput = input;
	m_pPlayer->GetGameObject()->ChangedNetworkState( INPUT_ASPECT );

	CMovementRequest moveRequest;
	moveRequest.SetStance( (EStance)m_curInput.stance );

	if(IsDemoPlayback())
	{
		Vec3 localVDir(m_pPlayer->GetViewQuatFinal().GetInverted() * m_curInput.lookDirection);
		Ang3 deltaAngles(asin(localVDir.z),0,cry_atan2f(-localVDir.x,localVDir.y));
		moveRequest.AddDeltaRotation(deltaAngles*gEnv->pTimer->GetFrameTime());
	}
	//else
	{
		moveRequest.SetLookTarget( m_pPlayer->GetEntity()->GetWorldPos() + 10.0f * m_curInput.lookDirection );
		moveRequest.SetAimTarget(moveRequest.GetLookTarget());
	}

	float pseudoSpeed = 0.0f;
	if (m_curInput.deltaMovement.len2() > 0.0f)
	{
		pseudoSpeed = m_pPlayer->CalculatePseudoSpeed(m_curInput.sprint);
	}
	moveRequest.SetPseudoSpeed(pseudoSpeed);
	moveRequest.SetAllowStrafing(true);

	float lean=0.0f;
	if (m_curInput.leanl)
		lean-=1.0f;
	if (m_curInput.leanr)
		lean+=1.0f;
	moveRequest.SetLean(lean);

	m_pPlayer->GetMovementController()->RequestMovement(moveRequest);

	// debug..
	if (g_pGameCVars->g_debugNetPlayerInput & 1)
	{
		IPersistantDebug * pPD = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug();
		pPD->Begin( string("net_player_input_") + m_pPlayer->GetEntity()->GetName(), true );
		pPD->AddSphere( moveRequest.GetLookTarget(), 0.5f, ColorF(1,0,1,1), 1.0f );
		//			pPD->AddSphere( moveRequest.GetMoveTarget(), 0.5f, ColorF(1,1,0,1), 1.0f );

		Vec3 wp(m_pPlayer->GetEntity()->GetWorldPos() + Vec3(0,0,2));
		pPD->AddDirection( wp, 1.5f, m_curInput.deltaMovement, ColorF(1,0,0,1), 1.0f );
		pPD->AddDirection( wp, 1.5f, m_curInput.lookDirection, ColorF(0,1,0,1), 1.0f );
	}
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:50,代码来源:NetPlayerInput.cpp

示例15: ColorF

void CModel::Draw(const Float3 pos, const Float3 size, const Float3 rota, MODE mode, double alpha)
{
	for (auto& node : model->nodes)
	{
		if (mode == MODE::TEX_ALPHA)
			node.mesh.scale(size).rotate(rota).translate(pos).draw(*texture, ColorF(1, 1, 1, alpha), *CLoad::TextureAlphaRenderer);

		else if (mode == MODE::TEX_NORMAL)
			node.mesh.scale(size).rotate(rota).translate(pos).draw(*texture, ColorF(1, 1, 1, alpha));

		else if (mode == MODE::MATERIAL)
			node.mesh.scale(size).rotate(rota).translate(pos).draw(node.material.diffuse.col);
	}
}
开发者ID:kagakububutyou,项目名称:Siv3D,代码行数:14,代码来源:Model.cpp


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