本文整理汇总了C++中CClientEntity::SetAttachedOffsets方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientEntity::SetAttachedOffsets方法的具体用法?C++ CClientEntity::SetAttachedOffsets怎么用?C++ CClientEntity::SetAttachedOffsets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientEntity
的用法示例。
在下文中一共展示了CClientEntity::SetAttachedOffsets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetElementAttachedOffsets
void CElementRPCs::SetElementAttachedOffsets ( NetBitStreamInterface& bitStream )
{
ElementID ID;
SPositionSync position ( true );
SRotationDegreesSync rotation ( true );
if ( bitStream.Read ( ID ) && position.Read ( bitStream ) && rotation.Read ( bitStream ) )
{
CClientEntity* pEntity = CElementIDs::GetElement ( ID );
if ( pEntity )
{
pEntity->SetAttachedOffsets ( position.data.vecPosition, rotation.data.vecRotation );
}
}
}
示例2: AttachElements
void CElementRPCs::AttachElements ( NetBitStreamInterface& bitStream )
{
ElementID ID, usAttachedToID;
CVector vecPosition, vecRotation;
if ( bitStream.Read ( ID ) && bitStream.Read ( usAttachedToID ) &&
bitStream.Read ( vecPosition.fX ) &&
bitStream.Read ( vecPosition.fY ) &&
bitStream.Read ( vecPosition.fZ ) &&
bitStream.Read ( vecRotation.fX ) &&
bitStream.Read ( vecRotation.fY ) &&
bitStream.Read ( vecRotation.fZ ) )
{
CClientEntity* pEntity = CElementIDs::GetElement ( ID );
CClientEntity* pAttachedToEntity = CElementIDs::GetElement ( usAttachedToID );
if ( pEntity && pAttachedToEntity )
{
pEntity->SetAttachedOffsets ( vecPosition, vecRotation );
pEntity->AttachTo ( pAttachedToEntity );
}
}
}