本文整理汇总了C++中CVehicle::GetTurretPositionX方法的典型用法代码示例。如果您正苦于以下问题:C++ CVehicle::GetTurretPositionX方法的具体用法?C++ CVehicle::GetTurretPositionX怎么用?C++ CVehicle::GetTurretPositionX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVehicle
的用法示例。
在下文中一共展示了CVehicle::GetTurretPositionX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
//.........这里部分代码省略.........
health.data.fValue = pVehicle->GetHealth ();
BitStream.Write ( &health );
// Color
CVehicleColor& vehColor = pVehicle->GetColor ();
uchar ucNumColors = vehColor.GetNumColorsUsed () - 1;
BitStream.WriteBits ( &ucNumColors, 2 );
for ( uint i = 0 ; i <= ucNumColors ; i++ )
{
SColor RGBColor = vehColor.GetRGBColor ( i );
BitStream.Write ( RGBColor.R );
BitStream.Write ( RGBColor.G );
BitStream.Write ( RGBColor.B );
}
// Paintjob
SPaintjobSync paintjob;
paintjob.data.ucPaintjob = pVehicle->GetPaintjob ();
BitStream.Write ( &paintjob );
// Write the damage model
SVehicleDamageSync damage ( true, true, true, true, false );
memcpy ( damage.data.ucDoorStates, pVehicle->m_ucDoorStates, MAX_DOORS );
memcpy ( damage.data.ucWheelStates, pVehicle->m_ucWheelStates, MAX_WHEELS );
memcpy ( damage.data.ucPanelStates, pVehicle->m_ucPanelStates, MAX_PANELS );
memcpy ( damage.data.ucLightStates, pVehicle->m_ucLightStates, MAX_LIGHTS );
BitStream.Write ( &damage );
// If the vehicle has a turret, send its position too
unsigned short usModel = pVehicle->GetModel ();
if ( CVehicleManager::HasTurret ( usModel ) )
{
SVehicleTurretSync specific;
specific.data.fTurretX = pVehicle->GetTurretPositionX ();
specific.data.fTurretY = pVehicle->GetTurretPositionY ();
BitStream.Write ( &specific );
}
// If the vehicle has an adjustable property send its value
if ( CVehicleManager::HasAdjustableProperty ( usModel ) )
{
BitStream.WriteCompressed ( pVehicle->GetAdjustableProperty () );
}
// If the vehicle has doors, sync their open angle ratios.
if ( CVehicleManager::HasDoors ( usModel ) )
{
SDoorOpenRatioSync door;
for ( unsigned char i = 0; i < 6; ++i )
{
door.data.fRatio = pVehicle->GetDoorOpenRatio ( i );
BitStream.Write ( &door );
}
}
// Write all the upgrades
CVehicleUpgrades* pUpgrades = pVehicle->GetUpgrades ();
unsigned char ucNumUpgrades = pUpgrades->Count ();
unsigned short* usSlotStates = pUpgrades->GetSlotStates ();
BitStream.Write ( ucNumUpgrades );
if ( ucNumUpgrades > 0 )
{
unsigned char ucSlot = 0;
for ( ; ucSlot < VEHICLE_UPGRADE_SLOTS ; ucSlot++ )
{