本文整理汇总了C++中CServerDE::SetObjectColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CServerDE::SetObjectColor方法的具体用法?C++ CServerDE::SetObjectColor怎么用?C++ CServerDE::SetObjectColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CServerDE
的用法示例。
在下文中一共展示了CServerDE::SetObjectColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateBoundingBox
void Trigger::CreateBoundingBox()
{
CServerDE* pServerDE = GetServerDE();
if (!pServerDE) return;
ObjectCreateStruct theStruct;
INIT_OBJECTCREATESTRUCT(theStruct);
DVector vPos;
pServerDE->GetObjectPos(m_hObject, &vPos);
VEC_COPY(theStruct.m_Pos, vPos);
SAFE_STRCPY(theStruct.m_Filename, "Models\\Props\\1x1_square.abc");
// strcpy(theStruct.m_SkinName, "SpecialFX\\smoke.dtx");
theStruct.m_Flags = FLAG_VISIBLE;
HCLASS hClass = pServerDE->GetClass("Model");
LPBASECLASS pModel = pServerDE->CreateObject(hClass, &theStruct);
if (pModel)
{
m_hBoundingBox = pModel->m_hObject;
DVector vDims;
pServerDE->GetObjectDims(m_hObject, &vDims);
DVector vScale;
VEC_DIVSCALAR(vScale, vDims, 0.5f);
pServerDE->ScaleObject(m_hBoundingBox, &vScale);
}
pServerDE->SetObjectColor(m_hBoundingBox, GetRandom(0.5f, 1.0f),
GetRandom(0.5f, 1.0f), GetRandom(0.5f, 1.0f), 1.0f);
}
示例2: CreateShield
void Gabriel::CreateShield()
{
CServerDE* pServerDE = GetServerDE();
if (!pServerDE || m_hShield) return;
ObjectCreateStruct theStruct;
INIT_OBJECTCREATESTRUCT(theStruct);
DVector vPos;
pServerDE->GetObjectPos(m_hObject, &vPos);
VEC_COPY(theStruct.m_Pos, vPos);
SAFE_STRCPY(theStruct.m_Filename, "Models\\PV_Weapons\\SpiderExplosionCore.abc");
SAFE_STRCPY(theStruct.m_SkinName, "SpecialFX\\Explosions\\SpiderCore.dtx");
theStruct.m_ObjectType = OT_MODEL;
theStruct.m_Flags = FLAG_VISIBLE | FLAG_GOTHRUWORLD;
HCLASS hClass = pServerDE->GetClass("BaseClass");
LPBASECLASS pModel = pServerDE->CreateObject(hClass, &theStruct);
if (!pModel) return;
m_hShield = pModel->m_hObject;
DVector vScale;
VEC_SET(vScale, 150.0f, 300.0f, 150.0f);
pServerDE->ScaleObject(m_hShield, &vScale);
pServerDE->SetObjectColor(m_hShield, 1.0f, 0.5f, 0.0f, 0.5f);
// Attach the sheild model to Gabriel...
DVector vOffset;
VEC_INIT(vOffset);
DRotation rOffset;
ROT_INIT(rOffset);
HATTACHMENT hAttachment;
DRESULT dRes = pServerDE->CreateAttachment(m_hObject, m_hShield, DNULL,
&vOffset, &rOffset, &hAttachment);
if (dRes != DE_OK)
{
pServerDE->RemoveObject(m_hShield);
m_hShield = DNULL;
}
}
示例3: Update
//.........这里部分代码省略.........
if (!m_hLinkObject) return DFALSE;
DVector vVel;
pServerDE->GetVelocity(m_hLinkObject, &vVel);
pServerDE->SetVelocity(pSprite->m_hObject, &vVel);
}
// Add Smoke
/* {
ObjectCreateStruct theStruct;
INIT_OBJECTCREATESTRUCT(theStruct);
pServerDE->GetObjectPos(m_hSprite[x], &vPos);
vPos.y = vPos.y + 5;
VEC_COPY(theStruct.m_Pos, vPos);
HCLASS hClass = pServerDE->GetClass("CClientSmokeTrail");
CClientSmokeTrail* pTrail = DNULL;
if (hClass)
{
pTrail = (CClientSmokeTrail*)pServerDE->CreateObject(hClass, &theStruct);
}
if (pTrail)
{
DVector vVel;
if (!m_hLinkObject) return DFALSE;
pServerDE->GetVelocity(m_hLinkObject, &vVel);
pTrail->Setup(vVel, DFALSE);
m_hSmokeTrail[x] = pTrail->m_hObject;
}
} */
}
if (m_hSmokeTrail[x])
{
DVector vPos;
// Move the Smoke Up
if (m_hSprite[x]) pServerDE->GetObjectPos(m_hSprite[x], &vPos);
else pServerDE->GetObjectPos(m_hSmokeTrail[x], &vPos);
vPos.y = vPos.y + 5;
pServerDE->SetObjectPos(m_hSmokeTrail[x], &vPos);
}
}
if (m_hLight)
{
DFLOAT fRed, fGreen, fBlue, fAlpha;
DVector vPos;
if (!m_hLinkObject) return DFALSE;
pServerDE->GetObjectPos(m_hLinkObject, &vPos);
pServerDE->SetObjectPos(m_hLight, &vPos);
if (!m_hLinkObject) return DFALSE;
pServerDE->GetObjectColor(m_hLinkObject, &fRed, &fGreen, &fBlue, &fAlpha);
pServerDE->SetObjectColor(m_hLinkObject, (fRed+0.3f), fGreen, fBlue, fAlpha);
}
}
else
{
// Lost the Link, Remove Fire.
// BPrint("Lost Link, Remove Fire...");
for (int x=0; x<MAXFIRES; x++)
{
if (m_hSprite[x])
{
pServerDE->RemoveObject(m_hSprite[x]);
m_hSprite[x] = DNULL;
}
if (m_hSmokeTrail[x])
{
pServerDE->RemoveObject(m_hSmokeTrail[x]);
m_hSmokeTrail[x] = DNULL;
}
}
if (m_hLight) pServerDE->RemoveObject( m_hLight );
pServerDE->RemoveObject( m_hObject );
return DFALSE;
}
}
return DTRUE;
}