本文整理汇总了C++中LLDataPacker::unpackU16方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDataPacker::unpackU16方法的具体用法?C++ LLDataPacker::unpackU16怎么用?C++ LLDataPacker::unpackU16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDataPacker
的用法示例。
在下文中一共展示了LLDataPacker::unpackU16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unpackPathParams
bool LLVolumeMessage::unpackPathParams(LLPathParams* params, LLDataPacker &dp)
{
U8 value;
S8 svalue;
U16 temp_u16;
dp.unpackU8(value, "Curve");
params->setCurveType( value );
dp.unpackU16(temp_u16, "Begin");
params->setBegin((F32)(temp_u16 * CUT_QUANTA));
dp.unpackU16(temp_u16, "End");
params->setEnd((F32)((50000 - temp_u16) * CUT_QUANTA));
dp.unpackU8(value, "ScaleX");
F32 x = (F32) (200 - value) * SCALE_QUANTA;
dp.unpackU8(value, "ScaleY");
F32 y = (F32) (200 - value) * SCALE_QUANTA;
params->setScale( x, y );
dp.unpackU8(value, "ShearX");
svalue = *(S8 *)&value;
F32 shear_x = (F32) svalue * SHEAR_QUANTA;
dp.unpackU8(value, "ShearY");
svalue = *(S8 *)&value;
F32 shear_y = (F32) svalue * SHEAR_QUANTA;
params->setShear( shear_x, shear_y );
dp.unpackU8(value, "Twist");
svalue = *(S8 *)&value;
params->setTwist((F32)(svalue * SCALE_QUANTA));
dp.unpackU8(value, "TwistBegin");
svalue = *(S8 *)&value;
params->setTwistBegin((F32)(svalue * SCALE_QUANTA));
dp.unpackU8(value, "RadiusOffset");
svalue = *(S8 *)&value;
params->setRadiusOffset((F32)(svalue * SCALE_QUANTA));
dp.unpackU8(value, "TaperX");
svalue = *(S8 *)&value;
params->setTaperX((F32)(svalue * TAPER_QUANTA));
dp.unpackU8(value, "TaperY");
svalue = *(S8 *)&value;
params->setTaperY((F32)(svalue * TAPER_QUANTA));
dp.unpackU8(value, "Revolutions");
params->setRevolutions((F32)(value * REV_QUANTA + 1.0f));
dp.unpackU8(value, "Skew");
svalue = *(S8 *)&value;
params->setSkew((F32)(svalue * SCALE_QUANTA));
return true;
}
示例2: unpackProfileParams
bool LLVolumeMessage::unpackProfileParams(
LLProfileParams* params,
LLDataPacker &dp)
{
bool ok = true;
U8 temp_u8;
U16 temp_u16;
F32 temp_f32;
dp.unpackU8(temp_u8, "Curve");
params->setCurveType(temp_u8);
dp.unpackU16(temp_u16, "Begin");
temp_f32 = temp_u16 * CUT_QUANTA;
if (temp_f32 > 1.f)
{
LL_WARNS() << "Profile begin out of range: " << temp_f32 << LL_ENDL;
LL_WARNS() << "Clamping to 0.0" << LL_ENDL;
temp_f32 = 0.f;
ok = false;
}
params->setBegin(temp_f32);
dp.unpackU16(temp_u16, "End");
temp_f32 = temp_u16 * CUT_QUANTA;
if (temp_f32 > 1.f)
{
LL_WARNS() << "Profile end out of range: " << 1.f - temp_f32 << LL_ENDL;
LL_WARNS() << "Clamping to 1.0" << LL_ENDL;
temp_f32 = 1.f;
ok = false;
}
params->setEnd(1.f - temp_f32);
dp.unpackU16(temp_u16, "Hollow");
temp_f32 = temp_u16 * HOLLOW_QUANTA;
if (temp_f32 > 1.f)
{
LL_WARNS() << "Profile hollow out of range: " << temp_f32 << LL_ENDL;
LL_WARNS() << "Clamping to 0.0" << LL_ENDL;
temp_f32 = 0.f;
ok = false;
}
params->setHollow(temp_f32);
return ok;
}