本文整理汇总了C++中CVehicle::GetAlpha方法的典型用法代码示例。如果您正苦于以下问题:C++ CVehicle::GetAlpha方法的具体用法?C++ CVehicle::GetAlpha怎么用?C++ CVehicle::GetAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVehicle
的用法示例。
在下文中一共展示了CVehicle::GetAlpha方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
//.........这里部分代码省略.........
// Write the name. It can be empty.
unsigned short usNameLength = static_cast < unsigned short > ( strlen ( szName ) );
BitStream.WriteCompressed ( usNameLength );
if ( usNameLength > 0 )
{
BitStream.Write ( const_cast < char * > ( szName ), usNameLength );
}
// Write the sync time context
BitStream.Write ( pElement->GetSyncTimeContext () );
// Write the rest depending on the type
switch ( ucEntityTypeID )
{
case CElement::OBJECT:
{
CObject* pObject = static_cast < CObject* > ( pElement );
// Position
position.data.vecPosition = pObject->GetPosition ();
BitStream.Write ( &position );
// Rotation
SRotationRadiansSync rotationRadians ( false );
pObject->GetRotation ( rotationRadians.data.vecRotation );
BitStream.Write ( &rotationRadians );
// Object id
BitStream.WriteCompressed ( pObject->GetModel () );
// Alpha
SEntityAlphaSync alpha;
alpha.data.ucAlpha = pObject->GetAlpha ();
BitStream.Write ( &alpha );
// Double sided
bool bIsDoubleSided = pObject->IsDoubleSided ();
BitStream.WriteBit ( bIsDoubleSided );
// Moving
const CPositionRotationAnimation* pMoveAnimation = pObject->GetMoveAnimation ();
if ( pMoveAnimation )
{
BitStream.WriteBit ( true );
pMoveAnimation->ToBitStream ( BitStream, true );
}
else
{
BitStream.WriteBit ( false );
}
// Scale
float fScale = pObject->GetScale ();
BitStream.Write ( fScale );
// Static
bool bStatic = pObject->IsStatic ();
BitStream.WriteBit ( bStatic );
// Health
SObjectHealthSync health;
health.data.fValue = pObject->GetHealth ();
BitStream.Write ( &health );
break;