本文整理汇总了C++中NET_Packet::w_float_q8方法的典型用法代码示例。如果您正苦于以下问题:C++ NET_Packet::w_float_q8方法的具体用法?C++ NET_Packet::w_float_q8怎么用?C++ NET_Packet::w_float_q8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NET_Packet
的用法示例。
在下文中一共展示了NET_Packet::w_float_q8方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UPDATE_Write
void CSE_ALifeItemWeapon::UPDATE_Write(NET_Packet &tNetPacket)
{
inherited::UPDATE_Write (tNetPacket);
tNetPacket.w_float_q8 (m_fCondition,0.0f,1.0f);
tNetPacket.w_u8 (wpn_flags);
tNetPacket.w_u16 (a_elapsed);
tNetPacket.w_u8 (m_addon_flags.get());
tNetPacket.w_u8 (ammo_type);
tNetPacket.w_u8 (wpn_state);
tNetPacket.w_u8 (m_bZoom);
}
示例2:
static void w_qt_q8(NET_Packet& P,const Fquaternion& q)
{
//Fvector Q;
//Q.set(q.x,q.y,q.z);
//if(q.w<0.f) Q.invert();
//P.w_float_q8(Q.x,-1.f,1.f);
//P.w_float_q8(Q.y,-1.f,1.f);
//P.w_float_q8(Q.z,-1.f,1.f);
///////////////////////////////////////////////////
P.w_float_q8(q.x,-1.f,1.f);
P.w_float_q8(q.y,-1.f,1.f);
P.w_float_q8(q.z,-1.f,1.f);
P.w_float_q8(q.w,-1.f,1.f);
///////////////////////////////////////////
//P.w_float_q8(q.x,-1.f,1.f);
//P.w_float_q8(q.y,-1.f,1.f);
//P.w_float_q8(q.z,-1.f,1.f);
//P.w(sign())
}
示例3: net_Export
void CWeapon::net_Export(NET_Packet& P)
{
inherited::net_Export (P);
P.w_float_q8 (GetCondition(),0.0f,1.0f);
u8 need_upd = IsUpdating() ? 1 : 0;
P.w_u8 (need_upd);
P.w_u16 (u16(iAmmoElapsed));
P.w_u8 (m_flagsAddOnState);
P.w_u8 (m_ammoType);
P.w_u8 ((u8)GetState());
P.w_u8 ((u8)IsZoomed());
}
示例4:
void game_PlayerState::net_Export(NET_Packet& P, BOOL Full)
{
P.w_u8 (Full ? 1 : 0);
if (Full)
P.w_stringZ ( name );
P.w_u8 ( team );
P.w_s16 ( m_iRivalKills );
P.w_s16 ( m_iSelfKills );
P.w_s16 ( m_iTeamKills );
P.w_s16 ( m_iDeaths );
P.w_s32 ( money_for_round );
P.w_float_q8 ( experience_D, -1.0f, 2.0f);
P.w_u8 ( rank );
P.w_u8 ( af_count );
P.w_u16 ( flags__ );
P.w_u16 ( ping );
P.w_u16 ( GameID );
P.w_s8 ( skin );
P.w_u8 ( m_bCurrentVoteAgreed );
P.w_u32 (Device.dwTimeGlobal - DeathTime);
};
示例5:
void CSE_ALifeInventoryItem::UPDATE_Write (NET_Packet &tNetPacket)
{
if (!m_u8NumItems) {
tNetPacket.w_u8 (0);
return;
}
mask_num_items num_items;
num_items.mask = 0;
num_items.num_items = m_u8NumItems;
R_ASSERT2 (
num_items.num_items < (u8(1) << 5),
make_string("%d",num_items.num_items)
);
if (State.enabled) num_items.mask |= inventory_item_state_enabled;
if (fis_zero(State.angular_vel.square_magnitude())) num_items.mask |= inventory_item_angular_null;
if (fis_zero(State.linear_vel.square_magnitude())) num_items.mask |= inventory_item_linear_null;
tNetPacket.w_u8 (num_items.common);
tNetPacket.w_vec3 (State.position);
tNetPacket.w_float_q8 (State.quaternion.x,0.f,1.f);
tNetPacket.w_float_q8 (State.quaternion.y,0.f,1.f);
tNetPacket.w_float_q8 (State.quaternion.z,0.f,1.f);
tNetPacket.w_float_q8 (State.quaternion.w,0.f,1.f);
if (!check(num_items.mask,inventory_item_angular_null)) {
tNetPacket.w_float_q8 (State.angular_vel.x,0.f,10*PI_MUL_2);
tNetPacket.w_float_q8 (State.angular_vel.y,0.f,10*PI_MUL_2);
tNetPacket.w_float_q8 (State.angular_vel.z,0.f,10*PI_MUL_2);
}
if (!check(num_items.mask,inventory_item_linear_null)) {
tNetPacket.w_float_q8 (State.linear_vel.x,-32.f,32.f);
tNetPacket.w_float_q8 (State.linear_vel.y,-32.f,32.f);
tNetPacket.w_float_q8 (State.linear_vel.z,-32.f,32.f);
}
};
示例6: net_Export
void CCustomOutfit::net_Export(NET_Packet& P)
{
inherited::net_Export (P);
P.w_float_q8 (GetCondition(),0.0f,1.0f);
}
示例7:
//serialization
void CWound::save (NET_Packet &output_packet)
{
output_packet.w_u8((u8)m_iBoneNum);
for(int i=0; i<ALife::eHitTypeMax; i++)
output_packet.w_float_q8 (m_Wounds[i],0.f, WOUND_MAX);
}
示例8: object
void CInventoryItem::net_Export (NET_Packet& P)
{
if (object().H_Parent() || IsGameTypeSingle())
{
P.w_u8 (0);
return;
}
CPHSynchronize* pSyncObj = NULL;
SPHNetState State;
pSyncObj = object().PHGetSyncItem (0);
if (pSyncObj && !object().H_Parent())
pSyncObj->get_State (State);
else
State.position.set (object().Position());
mask_num_items num_items;
num_items.mask = 0;
u16 temp = bone_count_to_synchronize();
R_ASSERT (temp < (u16(1) << 5));
num_items.num_items = u8(temp);
if (State.enabled) num_items.mask |= CSE_ALifeInventoryItem::inventory_item_state_enabled;
if (fis_zero(State.angular_vel.square_magnitude())) num_items.mask |= CSE_ALifeInventoryItem::inventory_item_angular_null;
if (fis_zero(State.linear_vel.square_magnitude())) num_items.mask |= CSE_ALifeInventoryItem::inventory_item_linear_null;
P.w_u8 (num_items.common);
P.w_vec3 (State.position);
float magnitude = _sqrt(State.quaternion.magnitude());
if (fis_zero(magnitude)) {
magnitude = 1;
State.quaternion.x = 0.f;
State.quaternion.y = 0.f;
State.quaternion.z = 1.f;
State.quaternion.w = 0.f;
}
else {
float invert_magnitude = 1.f/magnitude;
State.quaternion.x *= invert_magnitude;
State.quaternion.y *= invert_magnitude;
State.quaternion.z *= invert_magnitude;
State.quaternion.w *= invert_magnitude;
clamp (State.quaternion.x,0.f,1.f);
clamp (State.quaternion.y,0.f,1.f);
clamp (State.quaternion.z,0.f,1.f);
clamp (State.quaternion.w,0.f,1.f);
}
P.w_float_q8 (State.quaternion.x,0.f,1.f);
P.w_float_q8 (State.quaternion.y,0.f,1.f);
P.w_float_q8 (State.quaternion.z,0.f,1.f);
P.w_float_q8 (State.quaternion.w,0.f,1.f);
if (!(num_items.mask & CSE_ALifeInventoryItem::inventory_item_angular_null)) {
clamp (State.angular_vel.x,0.f,10.f*PI_MUL_2);
clamp (State.angular_vel.y,0.f,10.f*PI_MUL_2);
clamp (State.angular_vel.z,0.f,10.f*PI_MUL_2);
P.w_float_q8 (State.angular_vel.x,0.f,10.f*PI_MUL_2);
P.w_float_q8 (State.angular_vel.y,0.f,10.f*PI_MUL_2);
P.w_float_q8 (State.angular_vel.z,0.f,10.f*PI_MUL_2);
}
if (!(num_items.mask & CSE_ALifeInventoryItem::inventory_item_linear_null)) {
clamp (State.linear_vel.x,-32.f,32.f);
clamp (State.linear_vel.y,-32.f,32.f);
clamp (State.linear_vel.z,-32.f,32.f);
P.w_float_q8 (State.linear_vel.x,-32.f,32.f);
P.w_float_q8 (State.linear_vel.y,-32.f,32.f);
P.w_float_q8 (State.linear_vel.z,-32.f,32.f);
}
};