本文整理汇总了C++中LLVector3::scaleVec方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVector3::scaleVec方法的具体用法?C++ LLVector3::scaleVec怎么用?C++ LLVector3::scaleVec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVector3
的用法示例。
在下文中一共展示了LLVector3::scaleVec方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getVolumePos
LLVector3 LLViewerJointCollisionVolume::getVolumePos(LLVector3 &offset)
{
mUpdateXform = TRUE;
LLVector3 result = offset;
result.scaleVec(getScale());
result.rotVec(getWorldRotation());
result += getWorldPosition();
return result;
}
示例2: setInfo
BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
{
llassert(mInfo == NULL);
if (info->mID < 0)
return FALSE;
mInfo = info;
mID = info->mID;
setWeight(getDefaultWeight(), FALSE );
LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
{
LLPolySkeletalBoneInfo *bone_info = &(*iter);
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
if (!joint)
{
LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
continue;
}
if (mJointScales.find(joint) != mJointScales.end())
{
LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
}
// store it
mJointScales[joint] = bone_info->mScaleDeformation;
// apply to children that need to inherit it
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
iter != joint->mChildren.end(); ++iter)
{
LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
if (child_joint->inheritScale())
{
LLVector3 childDeformation = LLVector3(child_joint->getScale());
childDeformation.scaleVec(bone_info->mScaleDeformation);
mJointScales[child_joint] = childDeformation;
}
}
if (bone_info->mHasPositionDeformation)
{
if (mJointOffsets.find(joint) != mJointOffsets.end())
{
LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
}
mJointOffsets[joint] = bone_info->mPositionDeformation;
}
}
return TRUE;
}
示例3: lineSegmentIntersect
BOOL LLVOTree::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face, BOOL pick_transparent, S32 *face_hitp,
LLVector3* intersection,LLVector2* tex_coord, LLVector3* normal, LLVector3* bi_normal)
{
if (!lineSegmentBoundingBox(start, end))
{
return FALSE;
}
const LLVector4a* exta = mDrawable->getSpatialExtents();
//VECTORIZE THIS
LLVector3 ext[2];
ext[0].set(exta[0].getF32ptr());
ext[1].set(exta[1].getF32ptr());
LLVector3 center = (ext[1]+ext[0])*0.5f;
LLVector3 size = (ext[1]-ext[0]);
LLQuaternion quat = getRotation();
center -= LLVector3(0,0,size.magVec() * 0.25f)*quat;
size.scaleVec(LLVector3(0.25f, 0.25f, 1.f));
size.mV[0] = llmin(size.mV[0], 1.f);
size.mV[1] = llmin(size.mV[1], 1.f);
LLVector3 pos, norm;
if (linesegment_tetrahedron(start, end, center, size, quat, pos, norm))
{
if (intersection)
{
*intersection = pos;
}
if (normal)
{
*normal = norm;
}
return TRUE;
}
return FALSE;
}
示例4: llvecpos
void xform_test_object_t::test<7>()
{
LLXformMatrix formMatrix_obj;
LLXformMatrix parent;
LLVector3 llvecpos(1.0, 2.0, 3.0);
LLVector3 llvecpospar(10.0, 20.0, 30.0);
formMatrix_obj.setPosition(llvecpos);
parent.setPosition(llvecpospar);
LLVector3 llvecparentscale(1.0, 2.0, 0);
parent.setScaleChildOffset(TRUE);
parent.setScale(llvecparentscale);
LLQuaternion quat(1, 2, 3, 4);
LLQuaternion quatparent(5, 6, 7, 8);
formMatrix_obj.setRotation(quat);
parent.setRotation(quatparent);
formMatrix_obj.setParent(&parent);
parent.update();
formMatrix_obj.update();
LLVector3 worldPos = llvecpos;
worldPos.scaleVec(llvecparentscale);
worldPos *= quatparent;
worldPos += llvecpospar;
LLQuaternion worldRot = quat * quatparent;
ensure("getWorldPosition failed: ", formMatrix_obj.getWorldPosition() == worldPos);
ensure("getWorldRotation failed: ", formMatrix_obj.getWorldRotation() == worldRot);
ensure("getWorldPosition for parent failed: ", parent.getWorldPosition() == llvecpospar);
ensure("getWorldRotation for parent failed: ", parent.getWorldRotation() == quatparent);
}
示例5:
LLVector3 LLVector3::scaledVec(const LLVector3& vec) const
{
LLVector3 ret = LLVector3(*this);
ret.scaleVec(vec);
return ret;
}