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

C++ VarTrack类代码示例

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

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



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


示例16: Init

bool CHUDSubtitles::Init()
{
    g_pLTClient->RegisterConsoleProgram("TestSubtitle", TestSubtitleFn);

	if (!g_vtAdjustedRadius.IsInitted())
	{
		g_vtAdjustedRadius.Init(g_pLTClient, "SubtitleSoundRadiusPercent", NULL, 0.77f);
	}


	UpdateLayout();

	return true;

}
开发者ID:Arc0re,项目名称:lithtech,代码行数:15,代码来源:HUDSubtitles.cpp


示例17: UpdateData

// Change in focus
void    CFolderJoin::OnFocus(LTBOOL bFocus)
{
	if (bFocus)
	{
		// Reset other values...
		bDblClick = LTFALSE;

		m_nNumServers       = 0;
		m_nNumServersListed = 0;
		m_nVersionFilter = (int)g_vtNetVersionFilter.GetFloat();
		m_nGameFilter = (int)g_vtNetGameFilter.GetFloat();
		m_nPopFilter = (int)g_vtNetPopFilter.GetFloat();
		m_nServerSort = (int)g_vtNetServerSortKey.GetFloat();
		m_nPlayerSort = (int)g_vtNetPlayerSortKey.GetFloat();

        bFrameDelay = LTTRUE;
		m_szPassword[0] = LTNULL;

		nOldIndex = -1;

		HSTRING hStr = g_pLTClient->FormatString(IDS_STATUS_CONNECTING);
		SetDummyStatusState(hStr, 500, FSS_GETSERVICES);
		g_pLTClient->FreeString(hStr);
		

        UpdateData(LTFALSE);
	}
	else
	{
		UpdateData();

		g_vtNetVersionFilter.WriteFloat((float)m_nVersionFilter);
		g_vtNetGameFilter.WriteFloat((float)m_nGameFilter);
		g_vtNetPopFilter.WriteFloat((float)m_nPopFilter);
		g_vtNetServerSortKey.WriteFloat((float)m_nServerSort);
		g_vtNetPlayerSortKey.WriteFloat((float)m_nPlayerSort);

		SetState(FSS_IDLE);
		GetGameSpyClientMgr()->Term();
        bFrameDelay = LTTRUE;
		m_pServerList->RemoveAllControls();
		m_pPlayerList->RemoveAllControls();
		m_pOptionList->RemoveAllControls();
        SetCurGameServerHandle(LTNULL);

	}
	CBaseFolder::OnFocus(bFocus);
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:49,代码来源:FolderJoin.cpp


示例18: Update

LTBOOL CSteamFX::Update()
{
    if (m_bWantRemove) return LTFALSE;

	// Debugging aid...

	if (s_cvarTweak.GetFloat() > 0)
	{
		TweakSystem();
	}

	// Start/stop steam sound if necessary...

	if (m_hServerObject)
	{
        uint32 dwUserFlags;
        g_pLTClient->GetObjectUserFlags(m_hServerObject, &dwUserFlags);

		if (!(dwUserFlags & USRFLG_VISIBLE))
		{
			if ((m_dwLastUserFlags & USRFLG_VISIBLE))
			{
				StopSound();
			}
		}
		else  // visible
		{
			if (!(m_dwLastUserFlags & USRFLG_VISIBLE))
			{
				StartSound();
			}
		}

		m_dwLastUserFlags = dwUserFlags;

		// Make sure the sound is in the correct place (in case we are getting
		// keyframed)...

		if (m_hSound)
		{
            LTVector vPos;
            g_pLTClient->GetObjectPos(m_hServerObject, &vPos);
            g_pLTClient->SetSoundPosition(m_hSound, &vPos);
		}


		// Update the steam velocity based on our current rotation (again
		// for keyframing)...

        LTRotation rRot;
        g_pLTClient->GetObjectRotation(m_hServerObject, &rRot);

        LTVector vU, vR, vF;
        g_pLTClient->GetRotationVectors(&rRot, &vU, &vR, &vF);

		m_Steam.SetDriftVel(vF * (m_cs.fVel * 0.75f), vF * m_cs.fVel);
	}

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


示例19: PlayImpactSound

void CWeaponFX::PlayImpactSound()
{
	IMPACTFX* pImpactFX = m_pAmmo->pImpactFX;

	if (IsLiquid(m_eCode))
	{
		pImpactFX = m_pAmmo->pUWImpactFX;
	}

	if (!pImpactFX) return;


	if (m_pAmmo->eType == VECTOR)
	{
		if ((m_nDetailLevel == RS_LOW) && GetRandom(1, 2) != 1) return;
		else if ((m_nDetailLevel == RS_MED) && GetRandom(1, 3) == 1) return;
	}

	char* pSnd = GetImpactSound(m_eSurfaceType, m_nAmmoId);
    LTFLOAT fSndRadius = (LTFLOAT) pImpactFX->nSoundRadius;

	if (pSnd)
	{
		uint32 dwFlags = 0;
		float fPitchShift = 1.0f;
		if (g_cvarImpactPitchShift.GetFloat() > 0.0f)
		{
			dwFlags |= PLAYSOUND_CTRL_PITCH;
		}

        uint8 nVolume = IsLiquid(m_eCode) ? 50 : 100;
		g_pClientSoundMgr->PlaySoundFromPos(m_vPos, pSnd, fSndRadius,
			SOUNDPRIORITY_MISC_LOW, dwFlags, nVolume, fPitchShift);
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:35,代码来源:WeaponFX.cpp


示例20: CreateObject

LTBOOL CParticleSystemFX::CreateObject(ILTClient *pClientDE)
{
    if (!pClientDE ) return LTFALSE;

	if (m_cs.hstrTextureName)
	{
		m_pTextureName = pClientDE->GetStringData(m_cs.hstrTextureName);
	}

    LTBOOL bRet = CBaseParticleSystemFX::CreateObject(pClientDE);

	if (bRet && m_hObject && m_hServerObject)
	{
        LTRotation rRot;
		g_pLTClient->GetObjectRotation(m_hServerObject, &rRot);
		g_pLTClient->SetObjectRotation(m_hObject, &rRot);

        uint32 dwUserFlags;
		g_pCommonLT->GetObjectFlags(m_hServerObject, OFT_User, dwUserFlags);
		if (!(dwUserFlags & USRFLG_VISIBLE))
		{
			g_pCommonLT->SetObjectFlags(m_hObject, OFT_Flags, 0, FLAG_VISIBLE);
		}
	}

    s_cvarTweak.Init(g_pLTClient, "TweakParticles", NULL, 0.0f);

	return bRet;
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:29,代码来源:ParticleSystemFX.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ VarVector类代码示例发布时间:2022-05-31
下一篇:
C++ VarSet类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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