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


C++ VarTrack类代码示例

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


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

示例1: BeginLean

void CLeanMgr::BeginLean( eLeanDirection kDir )
{
	m_kLeanDir = kDir;

	m_fMaxLeanAngle = DEG2RAD( g_vtLeanAngle.GetFloat() );
	m_fLeanFromAngle = m_fLastLeanAngle;

	m_fStartTime = 0.0f;
	m_fEndTime = g_vtLeanOutTime.GetFloat();

	if( m_bLeanedOut )
	{
		// Send a message to the server to remove the original stimulus.

		CAutoMessage cMsg;
		cMsg.Writeuint8( MID_PLAYER_CLIENTMSG );
		cMsg.Writeuint8( CP_PLAYER_LEAN );
		cMsg.Writeuint8( PL_CENTER );
		cMsg.WriteLTVector( LTVector( 0, 0, 0) );
		g_pLTClient->SendToServer( cMsg.Read(), MESSAGE_GUARANTEED );
	}

	// If we are just begining to lean then we are not leaned out...

	m_bLeanedOut = false;
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:26,代码来源:LeanMgr.cpp

示例2: Init

LTBOOL CScatterFX::Init( SFXCREATESTRUCT* psfxCreateStruct )
{
	if( !psfxCreateStruct )
		return LTFALSE;

	CSpecialFX::Init( psfxCreateStruct );

	SCATTERCREATESTRUCT* cs = (SCATTERCREATESTRUCT*)psfxCreateStruct;

	m_vDims = cs->vDims;
	m_nBlindDataIndex = cs->nBlindDataIndex;
	m_fWidth = cs->fWidth * 0.5f;
	m_fHeight = cs->fHeight;
	m_fMaxScale = cs->fMaxScale;
	m_fTilt = cs->fTilt;
	m_fWaveRate = cs->fWaveRate;
	m_fWaveDist = cs->fWaveDist;
	m_fMaxDrawDist = cs->fMaxDrawDist;
	m_fMaxDrawDistSq = m_fMaxDrawDist * m_fMaxDrawDist;
	m_hstrTextureName = cs->hstrTextureName;
	m_bUseSaturate = cs->bUseSaturate;

	LTVector pos;
	g_pLTClient->GetObjectPos( m_hServerObject, &pos );
	AdjustBounds( pos, m_vDims );

	// setup console variables
	if( !g_cvarScatterEnable.IsInitted() )
		g_cvarScatterEnable.Init( g_pLTClient, "ScatterEnable", LTNULL, 1.0f );

	return LTTRUE;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:32,代码来源:ScatterFX.cpp

示例3: Update

void CPerformanceTest::Update(float fFrameTime)
{
	// Skip the first few samples since they skew the results...
	m_nThrowAwaySamples++;
	if (m_nThrowAwaySamples <= uint32(g_vtPerformanceThrowAwaySamples.GetFloat()))
	{
		return;
	}

	// Throw out any bogus frame times (too fast or too slow)...
	if (fFrameTime < g_vtPerformanceMinSampleFPS.GetFloat() || 
		fFrameTime > g_vtPerformanceMaxSampleFPS.GetFloat())
	{
		return;
	}

	uint32 nCurFPS = (fFrameTime > 0.0 ? int(1.0/fFrameTime) : kMaxFPS);

	m_nTotalSamples++;
	m_fTotalTime += fFrameTime;
	m_fFPSSmoothTime += fFrameTime;

	if (nCurFPS < m_nMinFPS)
	{
		m_nMinFPS = nCurFPS;
	}

	if (nCurFPS > m_nMaxFPS)
	{
		m_nMaxFPS = nCurFPS;
	}

	if (nCurFPS < m_nMinTestFPS)
	{
		m_nSamplesBelowMin++;
	}
	else if (nCurFPS > m_nMaxTestFPS)
	{
		m_nSamplesAboveMax++;
	}

	
	// Smooth out the "current" fps over kNumSmoothFrames...

	if (m_fFPSSmoothTime <= g_vtPerformanceSmoothFPSTime.GetFloat())
	{
		m_nTotalCurFPS += nCurFPS;
		m_nTotalCurFPSSamples++;
	}
	else
	{
		// Time to calculate smooth current fps
		m_nSmoothedCurFPS = (m_nTotalCurFPS / m_nTotalCurFPSSamples);

		m_nTotalCurFPS = 0;
		m_nTotalCurFPSSamples = 0;
		m_fFPSSmoothTime = 0.0f;
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:59,代码来源:PerformanceTest.cpp

示例4: DemoSave

void CHeadBobMgr::DemoSave(ILTStream *pStream)
{
	g_vtNormalHeadCantRate.Save(pStream);
	g_vtVehicleHeadCantUpRate.Save(pStream);
	g_vtVehicleHeadCantDownRate.Save(pStream);
	g_vtMaxNormalHeadCant.Save(pStream);
	g_vtMaxVehicleHeadCant.Save(pStream);
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:8,代码来源:HeadBobMgr.cpp

示例5: Init

void CLeanMgr::Init( )
{
	g_vtLeanOutTime.Init( g_pLTClient, "LeanOutTime", LTNULL, 0.5f );
	g_vtLeanCenterTime.Init( g_pLTClient, "LeanCenterTime", LTNULL, 0.5f );
	g_vtLeanRadius.Init( g_pLTClient, "LeanRadius", LTNULL, 250.0f );
	g_vtLeanAngle.Init( g_pLTClient, "LeanAngle", LTNULL, 3.0f );
	g_vtLeanCamClipDist.Init( g_pLTClient, "LeanCamClipDist", LTNULL, 20.0f );
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:8,代码来源:LeanMgr.cpp

示例6: ImplementMouseSensitivity

void CGameSettings::ImplementMouseSensitivity()
{
	if (!m_pClientDE) return;

	float nMouseSensitivity = GetFloatVar("MouseSensitivity");

	// get the mouse device name

	char strDevice[128];
	memset (strDevice, 0, 128);
    LTRESULT result = m_pClientDE->GetDeviceName (DEVICETYPE_MOUSE, strDevice, 127);
	if (result == LT_OK)
	{
		// get mouse x- and y- axis names

		char strXAxis[32];
		memset (strXAxis, 0, 32);
		char strYAxis[32];
		memset (strYAxis, 0, 32);

        LTBOOL bFoundXAxis = LTFALSE;
        LTBOOL bFoundYAxis = LTFALSE;

		DeviceObject* pList = m_pClientDE->GetDeviceObjects (DEVICETYPE_MOUSE);
		DeviceObject* ptr = pList;
		while (ptr)
		{
			if (ptr->m_ObjectType == CONTROLTYPE_XAXIS)
			{
				SAFE_STRCPY(strXAxis, "##x-axis");
                bFoundXAxis = LTTRUE;
			}

			if (ptr->m_ObjectType == CONTROLTYPE_YAXIS)
			{
				SAFE_STRCPY(strYAxis, "##y-axis");
                bFoundYAxis = LTTRUE;
			}

			ptr = ptr->m_pNext;
		}
		if (pList) m_pClientDE->FreeDeviceObjects (pList);

		if (bFoundXAxis && bFoundYAxis)
		{
			// run the console string

			char strConsole[64];
			float fBaseScale = g_vtMouseScaleBase.GetFloat();
			float fScaleIncrement = g_vtMouseScaleInc.GetFloat();

			sprintf (strConsole, "scale \"%s\" \"%s\" %f", strDevice, strXAxis, fBaseScale + ((float)nMouseSensitivity * fScaleIncrement));
			m_pClientDE->RunConsoleString (strConsole);
			sprintf (strConsole, "scale \"%s\" \"%s\" %f", strDevice, strYAxis, fBaseScale + ((float)nMouseSensitivity * fScaleIncrement));
			m_pClientDE->RunConsoleString (strConsole);
		}
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:58,代码来源:GameSettings.cpp

示例7: Init

LTBOOL CNodeController::Init(CCharacterFX* pCharacterFX)
{
	_ASSERT(pCharacterFX);
    if ( !pCharacterFX ) return LTFALSE;

	if (!g_vtLipSyncMaxRot.IsInitted())
	{
        g_vtLipSyncMaxRot.Init(g_pLTClient, "LipSyncMaxRot", NULL, 25.0f);
	}

	if (!g_vtLipSyncFreq.IsInitted())
	{
        g_vtLipSyncFreq.Init(g_pLTClient, "LipSyncFreq", NULL, 20.0f);
	}

	// Store our backpointer

	m_pCharacterFX = pCharacterFX;

	// Map all the nodes in our skeleton in the bute file to the nodes in the actual .abc model file

	int iNode = 0;
	HMODELNODE hCurNode = INVALID_MODEL_NODE;
    while ( g_pLTClient->GetNextModelNode(GetCFX()->GetServerObj(), hCurNode, &hCurNode) == LT_OK)
	{
		_ASSERT(m_cNodes < MAX_NODES);

		char szName[64] = "";
        g_pLTClient->GetModelNodeName(GetCFX()->GetServerObj(), hCurNode, szName, 64);

		ModelNode eModelNode = g_pModelButeMgr->GetSkeletonNode(m_pCharacterFX->GetModelSkeleton(), szName);

		if ( eModelNode != eModelNodeInvalid )
		{
			m_aNodes[eModelNode].eModelNode = eModelNode;
			m_aNodes[eModelNode].hModelNode = hCurNode;
		}

		m_cNodes++;
	}

	// Find our "rotor" nodes

	int cNodes = g_pModelButeMgr->GetSkeletonNumNodes(m_pCharacterFX->GetModelSkeleton());

	for ( iNode = 0 ; iNode < cNodes ; iNode++ )
	{
		if ( NODEFLAG_ROTOR & g_pModelButeMgr->GetSkeletonNodeFlags(m_pCharacterFX->GetModelSkeleton(), (ModelNode)iNode) )
		{
            AddNodeControlRotationTimed((ModelNode)iNode, LTVector(0,1,0), 40000.0f, 20000.0f);
		}
	}

    return LTTRUE;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:55,代码来源:NodeController.cpp

示例8: CreateObject

LTBOOL CMineFX::CreateObject(ILTClient* pClientDE)
{
    if (!CSpecialFX::CreateObject(pClientDE) || !m_hServerObject) return LTFALSE;

	if (!g_vtMineShit.IsInitted())
	{
        g_vtMineShit.Init(g_pLTClient, "MineShit", NULL, 0.01f);
	}

    return LTTRUE;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:11,代码来源:MineFX.cpp

示例9: CreateObject

LTBOOL CMuzzleFlashFX::CreateObject(ILTClient *pClientDE)
{
    if (!pClientDE || !CSpecialFX::CreateObject(pClientDE)) return LTFALSE;

	if (!g_vtReallyClose.IsInitted())
	{
	    g_vtReallyClose.Init(pClientDE, "MFReallyClose", NULL, 1.0f);
	}

	return ResetFX();
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:11,代码来源:MuzzleFlashFX.cpp

示例10: Init

//called to initialize a group and create the appropriate objects
bool CParticleSystemGroup::Init(IClientFXMgr* pFxMgr, HMATERIAL hMaterial, const LTRigidTransform& tObjTrans, 
								bool* pVisibleFlag, const CParticleSystemProps* pProps)
{
	//make sure our console variable is initialized
	if(!g_vtParticleBounceScale.IsInitted())
		g_vtParticleBounceScale.Init(g_pLTClient, "ParticleBounceScale", NULL, 1.0f);

	//make sure we are in a valid state
	Term();

	ObjectCreateStruct	ocs;

	// Create Particle System
	ocs.m_ObjectType	= OT_CUSTOMRENDER;
	ocs.m_Flags			|= FLAG_VISIBLE;

	if(!pProps->m_bSolid)
		ocs.m_Flags2 |= FLAG2_FORCETRANSLUCENT;

	if(!pProps->m_bTranslucentLight)
		ocs.m_Flags |= FLAG_NOLIGHT;

	//setup whether or not it is in the sky
	ocs.m_Flags2 |= GetSkyFlags(pProps->m_eInSky);

	ocs.m_Pos = tObjTrans.m_vPos;
	ocs.m_Rotation = tObjTrans.m_rRot;

	m_hCustomRender = g_pLTClient->CreateObject( &ocs );
	if( !m_hCustomRender )
		return false;

	//setup our rendering layer
	if(pProps->m_bPlayerView)
		g_pLTClient->GetRenderer()->SetObjectDepthBiasTableIndex(m_hCustomRender, eRenderLayer_Player);

	LTVector vTempBBox(1.0f, 1.0f, 1.0f);

	g_pLTClient->GetCustomRender()->SetRenderingSpace(m_hCustomRender, pProps->m_bObjectSpace ? eRenderSpace_Object : eRenderSpace_World);
	g_pLTClient->GetCustomRender()->SetVisBoundingBox(m_hCustomRender, -vTempBBox, vTempBBox);
	g_pLTClient->GetCustomRender()->SetRenderCallback(m_hCustomRender, CustomRenderCallback);
	g_pLTClient->GetCustomRender()->SetCallbackUserData(m_hCustomRender, this);

	//assign the material to the object
	g_pLTClient->GetCustomRender()->SetMaterial(m_hCustomRender, hMaterial);

	//and save our other values passed in
	m_pProps		= pProps;
	m_pFxMgr		= pFxMgr;
	m_pVisibleFlag	= pVisibleFlag;

	//success
	return true;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:55,代码来源:ParticleSystemGroup.cpp

示例11: ProcessTestingVars

void CCameraOffsetMgr::ProcessTestingVars()
{
	CameraDelta delta;

	// See if any testing vars were set...

	if (g_vtCamWeaponImpact.GetFloat() > 0.0f)
	{
		g_vtCamWeaponImpact.SetFloat(0.0f);

		switch(GetRandom(1, 3))
		{
			case 1:
			{
				delta.Pitch.fVar	= GetRandom(1, 2) == 1 ? -DEG2RAD(5.0f) : DEG2RAD(5.0f);
				delta.Pitch.fTime1	= 0.1f;
				delta.Pitch.fTime2	= 0.25f;
				delta.Pitch.eWave1	= Wave_SlowOff;
				delta.Pitch.eWave2	= Wave_SlowOff;

				g_pLTClient->CPrint("Test Impact Pitch = %.4f (in Deg = %.2f)", delta.Pitch.fVar, RAD2DEG(delta.Pitch.fVar));
			}
			break;

			case 2 :
			{
				delta.Yaw.fVar	= GetRandom(1, 2) == 1 ? -DEG2RAD(5.0f) : DEG2RAD(5.0f);
				delta.Yaw.fTime1	= 0.1f;
				delta.Yaw.fTime2	= 0.25f;
				delta.Yaw.eWave1	= Wave_SlowOff;
				delta.Yaw.eWave2	= Wave_SlowOff;

				g_pLTClient->CPrint("Test Impact Yaw = %.4f (in Deg = %.2f)", delta.Yaw.fVar, RAD2DEG(delta.Yaw.fVar));
			}
			break;

			default :
			case 3 :
			{
				delta.Roll.fVar	= GetRandom(1, 2) == 1 ? -DEG2RAD(5.0f) : DEG2RAD(5.0f);
				delta.Roll.fTime1	= 0.1f;
				delta.Roll.fTime2	= 0.25f;
				delta.Roll.eWave1	= Wave_SlowOff;
				delta.Roll.eWave2	= Wave_SlowOff;

				g_pLTClient->CPrint("Test Impact Roll = %.4f (in Deg = %.2f)", delta.Roll.fVar, RAD2DEG(delta.Roll.fVar));
			}
			break;
		}

		AddDelta(delta);
	}
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:53,代码来源:CameraOffsetMgr.cpp

示例12: GenerateRandomVelocity

// this function will return a random value that can be used for a random
// pitch/yaw velocity
float GenerateRandomVelocity()
{
	//find a random number between that range
	float fRand = GetRandom(g_vtShellMinSpinsPerSecond.GetFloat(), g_vtShellMaxSpinsPerSecond.GetFloat());


	//scale it to be either positive or negative
	if(rand() % 2 == 0)
		fRand = -fRand;

	//now map it into rotations
	return /*MATH_CIRCLE * */ fRand;
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:15,代码来源:ShellCasingFX.cpp

示例13: CheckForReinit

void CCursorMgr::CheckForReinit()
{
	// because of driver bugs, we need to wait a frame after reinitializing the renderer and
	// reinitialize the cursor
	int nCursorHackFrameDelay = (int)g_vtCursorHack.GetFloat();
	if (nCursorHackFrameDelay)
	{
		nCursorHackFrameDelay--;
		g_vtCursorHack.SetFloat((LTFLOAT)nCursorHackFrameDelay);
		if (nCursorHackFrameDelay == 1)
			Init();
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:13,代码来源:CursorMgr.cpp

示例14: Start

bool CPerformanceTest::Start(uint32 nMin /*=kDefaultMin*/, uint32 nMax /*=kDefaultMax*/)
{
	Reset();

	if (nMin < nMax)
	{
		m_nMinTestFPS = nMin;
		m_nMaxTestFPS = nMax;
	}
	else
	{
		return false;
	}

	if (!g_vtPerformanceSmoothFPSTime.IsInitted())
	{
		g_vtPerformanceSmoothFPSTime.Init(g_pLTClient, "PerformanceFPSSmoothTime", NULL, 0.5f);
	}
	if (!g_vtPerformanceMinSampleFPS.IsInitted())
	{
		g_vtPerformanceMinSampleFPS.Init(g_pLTClient, "PerformanceMinSampleFrameRate", NULL, 0.00001f);
	}
	if (!g_vtPerformanceMaxSampleFPS.IsInitted())
	{
		g_vtPerformanceMaxSampleFPS.Init(g_pLTClient, "PerformanceMaxSampleFrameRate", NULL, 1.0f);
	}
	if (!g_vtPerformanceThrowAwaySamples.IsInitted())
	{
		g_vtPerformanceThrowAwaySamples.Init(g_pLTClient, "PerformanceThrowAwaySamples", NULL, 5.0f);
	}

	return true;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:33,代码来源:PerformanceTest.cpp

示例15: Init

bool CClientFXMgr::Init(ILTClient *pClientDE, EngineTimer& timer )
{
	m_pClientDE = pClientDE;

	//setup our console variable if it isn't already
	if(!g_vtClientFXDetailLevel.IsInitted())
		g_vtClientFXDetailLevel.Init(pClientDE, "ClientFXDetailLevel", NULL, 2.0f);

	// This is the timer we will use with all calculations.  Since
	// there can be multiple clientfxmgr's, we take it from our "mgr".
	m_Timer = timer;

	return true;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:14,代码来源:ClientFXMgr.cpp


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