本文整理汇总了C++中LLQuaternion::loadIdentity方法的典型用法代码示例。如果您正苦于以下问题:C++ LLQuaternion::loadIdentity方法的具体用法?C++ LLQuaternion::loadIdentity怎么用?C++ LLQuaternion::loadIdentity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLQuaternion
的用法示例。
在下文中一共展示了LLQuaternion::loadIdentity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: serialize
//.........这里部分代码省略.........
S32 outcount = 0;
S32 frame = 1;
for ( ki = joint->mKeys.begin();
ki != joint->mKeys.end();
++ki )
{
if ((frame == 1) && joint->mRelativeRotationKey)
{
first_frame_rot = mayaQ( ki->mRot[0], ki->mRot[1], ki->mRot[2], order);
fixup_rot.shortestArc(LLVector3::z_axis * first_frame_rot * frameRot, LLVector3::z_axis);
}
if (ki->mIgnoreRot)
{
frame++;
continue;
}
time = (F32)frame * mFrameTime;
if (mergeParent)
{
mergeParentRot = mayaQ( mergeParent->mKeys[frame-1].mRot[0],
mergeParent->mKeys[frame-1].mRot[1],
mergeParent->mKeys[frame-1].mRot[2],
bvhStringToOrder(mergeParent->mOrder) );
LLQuaternion parentFrameRot( mergeParent->mFrameMatrix );
LLQuaternion parentOffsetRot( mergeParent->mOffsetMatrix );
mergeParentRot = ~parentFrameRot * mergeParentRot * parentFrameRot * parentOffsetRot;
}
else
{
mergeParentRot.loadIdentity();
}
if (mergeChild)
{
mergeChildRot = mayaQ( mergeChild->mKeys[frame-1].mRot[0],
mergeChild->mKeys[frame-1].mRot[1],
mergeChild->mKeys[frame-1].mRot[2],
bvhStringToOrder(mergeChild->mOrder) );
LLQuaternion childFrameRot( mergeChild->mFrameMatrix );
LLQuaternion childOffsetRot( mergeChild->mOffsetMatrix );
mergeChildRot = ~childFrameRot * mergeChildRot * childFrameRot * childOffsetRot;
}
else
{
mergeChildRot.loadIdentity();
}
LLQuaternion inRot = mayaQ( ki->mRot[0], ki->mRot[1], ki->mRot[2], order);
LLQuaternion outRot = frameRotInv* mergeChildRot * inRot * mergeParentRot * ~first_frame_rot * frameRot * offsetRot;
U16 time_short = F32_to_U16(time, 0.f, mDuration);
dp.packU16(time_short, "time");
U16 x, y, z;
LLVector3 rot_vec = outRot.packToVector3();
rot_vec.quantize16(-1.f, 1.f, -1.f, 1.f);
x = F32_to_U16(rot_vec.mV[VX], -1.f, 1.f);
y = F32_to_U16(rot_vec.mV[VY], -1.f, 1.f);
z = F32_to_U16(rot_vec.mV[VZ], -1.f, 1.f);
dp.packU16(x, "rot_angle_x");
dp.packU16(y, "rot_angle_y");