本文整理汇总了C++中LLQuaternion::unpackFromVector3方法的典型用法代码示例。如果您正苦于以下问题:C++ LLQuaternion::unpackFromVector3方法的具体用法?C++ LLQuaternion::unpackFromVector3怎么用?C++ LLQuaternion::unpackFromVector3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLQuaternion
的用法示例。
在下文中一共展示了LLQuaternion::unpackFromVector3方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getQuat
void LLTemplateMessageReader::getQuat(const char *block, const char *var,
LLQuaternion &q, S32 blocknum)
{
LLVector3 vec;
getData(block, var, &vec.mV[0], sizeof(vec.mV), blocknum);
if( vec.isFinite() )
{
q.unpackFromVector3( vec );
}
else
{
llwarns << "non-finite in getQuatFast " << block << " " << var
<< llendl;
q.loadIdentity();
}
}
示例2: copyFromMessageData
//.........这里部分代码省略.........
case MVT_U8:
addU8(varname, *(U8*)mvci.getData());
break;
case MVT_U16:
addU16(varname, *(U16*)mvci.getData());
break;
case MVT_U32:
addU32(varname, *(U32*)mvci.getData());
break;
case MVT_U64:
addU64(varname, *(U64*)mvci.getData());
break;
case MVT_S8:
addS8(varname, *(S8*)mvci.getData());
break;
case MVT_S16:
addS16(varname, *(S16*)mvci.getData());
break;
case MVT_S32:
addS32(varname, *(S32*)mvci.getData());
break;
// S64 not supported in LLSD so we just truncate it
case MVT_S64:
addS32(varname, *(S64*)mvci.getData());
break;
case MVT_F32:
addF32(varname, *(F32*)mvci.getData());
break;
case MVT_F64:
addF64(varname, *(F64*)mvci.getData());
break;
case MVT_LLVector3:
addVector3(varname, *(LLVector3*)mvci.getData());
break;
case MVT_LLVector3d:
addVector3d(varname, *(LLVector3d*)mvci.getData());
break;
case MVT_LLVector4:
addVector4(varname, *(LLVector4*)mvci.getData());
break;
case MVT_LLQuaternion:
{
LLVector3 v = *(LLVector3*)mvci.getData();
LLQuaternion q;
q.unpackFromVector3(v);
addQuat(varname, q);
break;
}
case MVT_LLUUID:
addUUID(varname, *(LLUUID*)mvci.getData());
break;
case MVT_BOOL:
addBOOL(varname, *(BOOL*)mvci.getData());
break;
case MVT_IP_ADDR:
addIPAddr(varname, *(U32*)mvci.getData());
break;
case MVT_IP_PORT:
addIPPort(varname, *(U16*)mvci.getData());
break;
case MVT_U16Vec3:
//treated as an array of 6 bytes
addBinaryData(varname, mvci.getData(), 6);
break;
case MVT_U16Quat:
//treated as an array of 8 bytes
addBinaryData(varname, mvci.getData(), 8);
break;
case MVT_S16Array:
addBinaryData(varname, mvci.getData(), mvci.getSize());
break;
default:
llwarns << "Unknown type in conversion of message to LLSD" << llendl;
break;
}
}
}
}
示例3: addField
//.........这里部分代码省略.........
gMessageSystem->addS64(var_name, valueS64);
return TRUE;
break;
*/
case MVT_F32:
if((stream >> valueF32).fail())
return FALSE;
gMessageSystem->addF32(var_name, valueF32);
return TRUE;
break;
case MVT_F64:
if((stream >> valueF64).fail())
return FALSE;
gMessageSystem->addF64(var_name, valueF64);
return TRUE;
break;
case MVT_LLVector3:
LLStringUtil::trim(input);
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
return FALSE;
tokens = split(input.substr(1, input.length() - 2), ",");
if(tokens.size() != 3)
return FALSE;
for(int i = 0; i < 3; i++)
{
stream.clear();
stream.str(tokens[i]);
if((stream >> valueF32).fail())
return FALSE;
valueVector3.mV[i] = valueF32;
}
gMessageSystem->addVector3(var_name, valueVector3);
return TRUE;
break;
case MVT_LLVector3d:
LLStringUtil::trim(input);
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
return FALSE;
tokens = split(input.substr(1, input.length() - 2), ",");
if(tokens.size() != 3)
return FALSE;
for(int i = 0; i < 3; i++)
{
stream.clear();
stream.str(tokens[i]);
if((stream >> valueF64).fail())
return FALSE;
valueVector3d.mdV[i] = valueF64;
}
gMessageSystem->addVector3d(var_name, valueVector3d);
return TRUE;
break;
case MVT_LLVector4:
LLStringUtil::trim(input);
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
return FALSE;
tokens = split(input.substr(1, input.length() - 2), ",");
if(tokens.size() != 4)
return FALSE;
for(int i = 0; i < 4; i++)
{
stream.clear();
stream.str(tokens[i]);
if((stream >> valueF32).fail())
return FALSE;
valueVector4.mV[i] = valueF32;
}
gMessageSystem->addVector4(var_name, valueVector4);
return TRUE;
break;
case MVT_LLQuaternion:
LLStringUtil::trim(input);
if(input.substr(0, 1) != "<" || input.substr(input.length() - 1, 1) != ">")
return FALSE;
tokens = split(input.substr(1, input.length() - 2), ",");
if(tokens.size() == 3)
{
for(int i = 0; i < 3; i++)
{
stream.clear();
stream.str(tokens[i]);
if((stream >> valueF32).fail())
return FALSE;
valueVector3.mV[i] = valueF32;
}
valueQuaternion.unpackFromVector3(valueVector3);
}
else if(tokens.size() == 4)
{
for(int i = 0; i < 4; i++)
{
stream.clear();
stream.str(tokens[i]);
if((stream >> valueF32).fail())
return FALSE;
valueQuaternion.mQ[i] = valueF32;
}
}
else
return FALSE;