本文整理汇总了C++中VEC_SET函数的典型用法代码示例。如果您正苦于以下问题:C++ VEC_SET函数的具体用法?C++ VEC_SET怎么用?C++ VEC_SET使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VEC_SET函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VEC_COPY
void CGibFX::CreateBloodSpray()
{
CSFXMgr* psfxMgr = g_pGameClientShell->GetSFXMgr();
if (!psfxMgr) return;
BSCREATESTRUCT sc;
VEC_COPY(sc.vPos, m_vPos);
sc.vPos.y += 30.0f;
VEC_SET(sc.vVel, 0.0f, -20.0f, 0.0f);
VEC_SET(sc.vInitialScale, GetRandom(2.0f, 4.0f), GetRandom(2.0f, 4.0f), 1.0f);
VEC_SET(sc.vFinalScale, GetRandom(0.5f, 0.8f), GetRandom(0.5f, 0.8f), 1.0f);
sc.dwFlags = FLAG_VISIBLE | FLAG_SPRITEBIAS | FLAG_NOLIGHT;
sc.fLifeTime = 0.5f;
sc.fInitialAlpha = 1.0f;
sc.fFinalAlpha = 0.0f;
sc.nType = OT_SPRITE;
char* pBloodFiles[] =
{
"Sprites\\BloodSplat1.spr",
"Sprites\\BloodSplat2.spr",
"Sprites\\BloodSplat3.spr",
"Sprites\\BloodSplat4.spr"
};
sc.pFilename = pBloodFiles[GetRandom(0,3)];
CSpecialFX* pFX = psfxMgr->CreateSFX(SFX_SCALE_ID, &sc);
if (pFX) pFX->Update();
}
示例2: CBaseParticleSystemFX
CRainFX::CRainFX() : CBaseParticleSystemFX()
{
m_bFirstUpdate = DTRUE;
m_nParticlesAdded = 0;
m_fTimeLen = 0.0f;
m_fLastTime = 0.0f;
m_fNextUpdate = 0.01f;
m_dwFlags = 0;
m_fLifetime = 1.0f;
m_fAreaDensity = 0.0f;
m_bGravity = DTRUE;
m_fSpread = 0.0f;
m_fTimeLimit = 0.0f;
VEC_SET(m_vColor1, 200, 255, 255);
VEC_SET(m_vColor2, 40, 50, 50);
/*
VEC_SET(m_vColor[0], 255, 255, 255);
VEC_SET(m_vColor[1], 200, 200, 200);
VEC_SET(m_vColor[2], 150, 150, 150);
VEC_SET(m_vColor[3], 100, 100, 100);
VEC_SET(m_vColor[4], 50, 50, 50);
VEC_SET(m_vColor[5], 50, 50, 50);
*/
VEC_INIT(m_vMinOffset);
VEC_INIT(m_vMaxOffset);
VEC_INIT(m_vMinVel);
VEC_INIT(m_vMaxVel);
VEC_INIT(m_vDims);
VEC_INIT(m_vDirection);
}
示例3: VEC_MAG
void CDeathFX::CreateVehicleDeathFX()
{
CSFXMgr* psfxMgr = g_pGameClientShell->GetSFXMgr();
if (!psfxMgr) return;
GIBCREATESTRUCT gib;
m_pClientDE->AlignRotation(&(gib.rRot), &m_vDir, LTNULL);
LTFLOAT fDamage = VEC_MAG(m_vDir);
VEC_COPY(gib.vPos, m_vPos);
VEC_SET(gib.vMinVel, 50.0f, 100.0f, 50.0f);
VEC_MULSCALAR(gib.vMinVel, gib.vMinVel, fDamage);
VEC_SET(gib.vMaxVel, 100.0f, 200.0f, 100.0f);
VEC_MULSCALAR(gib.vMaxVel, gib.vMaxVel, fDamage);
gib.fLifeTime = 20.0f;
gib.fFadeTime = 7.0f;
gib.nGibFlags = 0;
gib.bRotate = LTTRUE;
gib.eModelId = m_eModelId;
gib.eModelStyle = m_eModelStyle;
gib.nCode = m_eCode;
gib.bSubGibs = LTTRUE;
SetupGibTypes(gib);
psfxMgr->CreateSFX(SFX_GIB_ID, &gib);
}
示例4: B2BaseClass
Explosion::Explosion() : B2BaseClass()
{
m_hstrSkinName = DNULL;
m_hstrModelName = DNULL;
m_hstrSound = DNULL;
m_fSoundRadius = 1000.0f;
m_fDamageRadius = 200.0f;
m_fMaxDamage = 50.0f;
m_fMinScale = 0.1f;
m_fMaxScale = 1.0f;
m_fDuration = 1.5f;
m_bCreateSmoke = DTRUE;
m_hModel = DNULL;
m_fLastDamageTime = 0.0f;
m_bCreateLight = DTRUE;
m_hLight = DNULL;
m_hShockwave = DNULL;
m_fMinLightRadius = 100.0f;
m_fMaxLightRadius = 300.0f;
VEC_SET(m_vLightColor, 1.0f, 0.5f, 0.0f);
m_bCreateShockwave = DTRUE;
m_hstrShockwaveSprite = DNULL;
VEC_SET(m_vShockwaveScaleMin, 0.1f, 0.1f, 1.0f);
VEC_SET(m_vShockwaveScaleMax, 1.0f, 1.0f, 1.0f);
m_fShockwaveDuration = 0.0f;
m_bCreateMark = DFALSE;
m_bAddSparks = DFALSE;
m_fStartTime = 0.0f;
m_fDelay = 0.0f;
m_bFirstUpdate = DFALSE;
VEC_INIT(m_vRotation);
}
示例5: CClientSFX
PolyGrid::PolyGrid() : CClientSFX()
{
VEC_SET(m_vDims, 32.0f, 32.0f, 0.0f);
VEC_SET(m_vColor1, 50.0f, 50.0f, 200.0f);
VEC_SET(m_vColor2, 0.0f, 0.0f, 220.0f);
m_fXScaleMin = 15.0f;
m_fXScaleMax = 15.0f;
m_fYScaleMin = 15.0f;
m_fYScaleMax = 15.0f;
m_fXScaleDuration = 10.0f;
m_fYScaleDuration = 10.0f;
m_fXPan = 10.0f;
m_fYPan = 10.0f;
m_hstrSurfaceSprite = DNULL;
m_fAlpha = 0.7f;
m_nPlasmaType = 1;
m_bSetup = DFALSE;
m_dwNumPolies = 160;
m_nRingRate[0] = 50;
m_nRingRate[1] = 10;
m_nRingRate[2] = 30;
m_nRingRate[3] = 20;
}
示例6: VEC_SET
void CGibFX::CreateLingeringSmoke(int nIndex)
{
CSFXMgr* psfxMgr = g_pGameClientShell->GetSFXMgr();
if (!psfxMgr) return;
CGameSettings* pSettings = g_pInterfaceMgr->GetSettings();
if (!pSettings) return;
uint8 nDetailLevel = pSettings->SpecialFXSetting();
if (nDetailLevel == RS_LOW) return;
SMCREATESTRUCT sm;
char* pTexture = "Sprites\\SmokeTest.spr";
VEC_SET(sm.vColor1, 100.0f, 100.0f, 100.0f);
VEC_SET(sm.vColor2, 125.0f, 125.0f, 125.0f);
VEC_SET(sm.vMinDriftVel, -10.0f, 25.0f, -10.0f);
VEC_SET(sm.vMaxDriftVel, 10.0f, 50.0f, 10.0f);
LTFLOAT fVolumeRadius = 10.0f;
LTFLOAT fLifeTime = GetRandom(m_fLifeTime * 0.75f, m_fLifeTime);
LTFLOAT fRadius = 1500;
LTFLOAT fParticleCreateDelta = 0.1f;
LTFLOAT fMinParticleLife = 1.0f;
LTFLOAT fMaxParticleLife = 5.0f;
uint8 nNumParticles = 3;
LTBOOL bIgnoreWind = LTFALSE;
if (IsLiquid(m_eCode))
{
GetLiquidColorRange(m_eCode, &sm.vColor1, &sm.vColor2);
pTexture = DEFAULT_BUBBLE_TEXTURE;
fRadius = 750.0f;
bIgnoreWind = LTTRUE;
fMinParticleLife = 1.0f;
fMaxParticleLife = 1.5f;
}
sm.vPos = m_Emitters[nIndex].m_vPos;
sm.hServerObj = m_hGib[nIndex];
sm.fVolumeRadius = fVolumeRadius;
sm.fLifeTime = fLifeTime;
sm.fRadius = fRadius;
sm.fParticleCreateDelta = fParticleCreateDelta;
sm.fMinParticleLife = fMinParticleLife;
sm.fMaxParticleLife = fMaxParticleLife;
sm.nNumParticles = nNumParticles;
sm.bIgnoreWind = bIgnoreWind;
sm.hstrTexture = m_pClientDE->CreateString(pTexture);
psfxMgr->CreateSFX(SFX_SMOKE_ID, &sm);
m_pClientDE->FreeString(sm.hstrTexture);
}
示例7: INIT_OBJECTCREATESTRUCT
void CProjectile::AddSparks(DVector vPos, DVector vNormal, DFLOAT fDamage, HOBJECT hObject)
{
CServerDE* pServerDE = BaseClass::GetServerDE();
if (!pServerDE) return;
ObjectCreateStruct ocStruct;
INIT_OBJECTCREATESTRUCT(ocStruct);
VEC_COPY(ocStruct.m_Pos, vPos);
HCLASS hClass = pServerDE->GetClass("CClientSparksSFX");
CClientSparksSFX *pSpark = DNULL;
if (hClass)
{
pSpark = (CClientSparksSFX *)pServerDE->CreateObject(hClass, &ocStruct);
}
if (pSpark)
{
DVector vColor1, vColor2;
char* pFile;
DBYTE nSparks = (DBYTE)fDamage;
SurfaceType eType = GetSurfaceType(hObject, DNULL);
switch(eType)
{
case SURFTYPE_FLESH:
{
VEC_SET(vColor1, 200.0f, 0.0f, 0.0f);
VEC_SET(vColor2, 255.0f, 0.0f, 0.0f);
pFile = "spritetextures\\particle1.dtx";
pSpark->Setup(&vNormal, &vColor1, &vColor2, pFile, nSparks, 0.6f, 2.0f, 500.0f);
break;
}
default:
{
VEC_SET(vColor1, 200.0f, 200.0, 200.0f);
VEC_SET(vColor2, 200.0f, 200.0f, 0.0f);
pFile = "spritetextures\\particle1.dtx";
pSpark->Setup(&vNormal, &vColor1, &vColor2, pFile, nSparks, 0.4f, 2.0f, 500.0f);
break;
}
}
}
return;
}
示例8: GameBase
ScaleSprite::ScaleSprite() : GameBase(OT_SPRITE)
{
VEC_SET(m_vScale, 1.0f, 1.0f, 1.0f);
VEC_SET(m_vColor, 1.0f, 1.0f, 1.0f);
m_fAlpha = 1.0f;
m_bFlushWithWorld = LTFALSE;
m_bRotatable = LTFALSE;
m_bStartOn = LTTRUE;
m_dwAdditionalFlags = 0;
m_hstrDamagedFile = LTNULL;
m_hstrDestroyedFile = LTNULL;
}
示例9: CClientSFX
Rain::Rain() : CClientSFX()
{
m_dwFlags = 0;
m_fDensity = 0.0f;
VEC_INIT(m_vDims);
m_fLifetime = 1.0f;
m_bGravity = DTRUE;
m_fParticleScale = 1.0f;
m_bTriggered = DFALSE;
VEC_INIT(m_vDirection);
VEC_SET(m_vColor1, 200.0f, 255.0f, 255.0f);
VEC_SET(m_vColor2, 40.0f, 50.0f, 50.0f);
m_fTimeLimit = 0.0f;
m_fPulse = 0.0f;
}
示例10: Aggregate
Rotating::Rotating() : Aggregate()
{
m_hObject = DNULL;
m_hstrSpinUpSound = DNULL;
m_hstrBusySound = DNULL;
m_hstrSpinDownSound = DNULL;
m_fSoundRadius = 1000.0f;
m_sndLastSound = DNULL;
VEC_INIT(m_vVelocity);
VEC_INIT(m_vSaveVelocity);
VEC_INIT(m_vSpinUpTime);
VEC_INIT(m_vSpinDownTime);
VEC_INIT(m_vSpinTimeLeft);
VEC_SET(m_vSign, 1.0f, 1.0f, 1.0f);
m_fLastTime = 0.0f;
m_fStartTime = 0.0f;
m_eState = RWM_OFF;
m_fPitch = 0.0f;
m_fYaw = 0.0f;
m_fRoll = 0.0f;
}
示例11: INIT_OBJECTCREATESTRUCT
void Explosion::AddShockwave(DVector *pvPoint)
{
if (!g_pServerDE) return;
ObjectCreateStruct ocStruct;
INIT_OBJECTCREATESTRUCT(ocStruct);
DRotation rRot;
ROT_INIT(rRot);
g_pServerDE->SetupEuler(&rRot, MATH_HALFPI, 0.0f, 0.0f);
ROT_COPY(ocStruct.m_Rotation, rRot);
VEC_COPY(ocStruct.m_Pos, *pvPoint);
ocStruct.m_Flags = FLAG_VISIBLE | FLAG_ROTATEABLESPRITE;
CImpact* pShockwave = CreateImpact(ocStruct, m_hstrShockwaveSprite);
if (!pShockwave) return;
if (pShockwave)
{
DVector vNormal;
VEC_SET(vNormal, 0.0f, 1.0f, 0.0f);
pShockwave->Setup(vNormal, m_vShockwaveScaleMin, m_vShockwaveScaleMax,
DNULL, 0, m_fShockwaveDuration, DTRUE, DFALSE);
m_hShockwave = g_pServerDE->ObjectToHandle(pShockwave);
g_pServerDE->CreateInterObjectLink(m_hObject, m_hShockwave);
}
}
示例12: GameBase
RotatingWorldModel::RotatingWorldModel() : GameBase(OT_WORLDMODEL)
{
AddAggregate(&m_damage);
m_hstrSpinUpSound = LTNULL;
m_hstrBusySound = LTNULL;
m_hstrSpinDownSound = LTNULL;
m_fSoundRadius = 1000.0f;
m_sndLastSound = LTNULL;
m_bBoxPhysics = LTTRUE;
VEC_INIT(m_vVelocity);
VEC_INIT(m_vSaveVelocity);
VEC_INIT(m_vSpinUpTime);
VEC_INIT(m_vSpinDownTime);
VEC_INIT(m_vSpinTimeLeft);
VEC_SET(m_vSign, 1.0f, 1.0f, 1.0f);
m_fLastTime = 0.0f;
m_fStartTime = 0.0f;
m_eState = RWM_NORMAL;
m_fPitch = 0.0f;
m_fYaw = 0.0f;
m_fRoll = 0.0f;
m_hShadowLightsString = NULL;
m_nLightAnims = 0;
m_nShadowAxis = 0;
m_bFirstUpdate = LTTRUE;
}
示例13: B2BaseClass
FireFX::FireFX() : B2BaseClass(OT_NORMAL)
{
m_bPlaySound = DTRUE;
m_bFirstUpdate = DTRUE;
VEC_SET(m_vScale, 0.2f, 0.2f, 0.0f);
m_fSoundVol = 200;
m_hstrAttachTo = DNULL;
m_hLinkObject = DNULL;
m_hLight = DNULL;
m_fLastTime = 0.0f;
m_bDead = DFALSE;
m_fBurnTime = 0.0f;
// Setup default values
for (int x=0; x<MAXFIRES; x++)
{
m_hSmokeTrail[x] = DNULL;
m_hSprite[x] = DNULL;
m_fDuration[x] = 0.0f;
m_fStartTime[x] = 0.0f;
}
m_nFireIndex = 0;
}
示例14: Prop
Body::Body() : Prop()
{
VEC_INIT(m_vColor);
VEC_SET(m_vDeathDir, 0.0f, -1.0f, 0.0f);
m_eDeathType = CD_NORMAL;
m_bFirstUpdate = LTTRUE;
m_fStartTime = 0.0f;
m_eDamageType = DT_UNSPECIFIED;
m_eBodyStatePrevious= eBodyStateNormal;
m_eModelNodeLastHit = eModelNodeInvalid;
m_pAttachments = LTNULL;
m_hHitBox = LTNULL;
m_eBodyState = eBodyStateNormal;
m_pState = LTNULL;
m_bMoveToFloor = LTFALSE;
m_fLifetime = -1.0f;
m_hWeaponItem = LTNULL;
m_hChecker = LTNULL;
m_cSpears = 0;
memset(m_ahSpears, 0, sizeof(HOBJECT)*kMaxSpears);
}
示例15: GetServerDE
DBOOL BugAI::InitialUpdate(DVector *pMovement)
{
CServerDE* pServerDE = GetServerDE();
if (!pServerDE) return DFALSE;
//Load up animation indexes if first model instance
if(m_bLoadAnims)
{
m_Anim_Sound.SetAnimationIndexes(m_hObject);
m_Anim_Sound.GenerateHitSpheres(m_hObject);
m_Anim_Sound.SetSoundRoot("sounds\\enemies\\bug");
m_bLoadAnims = DFALSE;
}
//randomize the size/weight
DFLOAT fScale = pServerDE->Random(-0.05f, 0.1f);
VEC_SET(m_vScale,1.0f + fScale, 1.0f, 1.0f + fScale);
// Init the objects
m_InventoryMgr.Init(m_hObject);
//Set hit points
m_damage.Init(m_hObject);
m_damage.SetHitPoints(m_fAIHitPoints + pServerDE->Random(1,m_fAIRandomHP));
m_damage.SetMaxHitPoints(m_damage.GetHitPoints());
//Set armor point
m_damage.SetArmorPoints(m_fAIArmorPoints);
m_damage.SetMaxArmorPoints(200.0f);
m_damage.SetMass(m_fAIMass);
AI_Mgr::InitStatics(&m_Anim_Sound);
return DTRUE;
}