本文整理汇总了C++中LLVector3::rotVec方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVector3::rotVec方法的具体用法?C++ LLVector3::rotVec怎么用?C++ LLVector3::rotVec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVector3
的用法示例。
在下文中一共展示了LLVector3::rotVec方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateWorldFrustumPlanes
void LLCamera::calculateWorldFrustumPlanes()
{
F32 d;
LLVector3 center = mOrigin - mXAxis*mNearPlane;
mWorldPlanePos = center;
for (int p=0; p<4; p++)
{
LLVector3 pnorm = LLVector3(mLocalPlanes[p]);
LLVector3 norm = rotateToAbsolute(pnorm);
norm.normVec();
d = -(center * norm);
mWorldPlanes[p] = LLPlane(norm, d);
}
// horizontal planes, perpindicular to (0,0,1);
LLVector3 zaxis(0, 0, 1.0f);
F32 yaw = getYaw();
{
LLVector3 tnorm = LLVector3(mLocalPlanes[PLANE_LEFT]);
tnorm.rotVec(yaw, zaxis);
d = -(mOrigin * tnorm);
mHorizPlanes[HORIZ_PLANE_LEFT] = LLPlane(tnorm, d);
}
{
LLVector3 tnorm = LLVector3(mLocalPlanes[PLANE_RIGHT]);
tnorm.rotVec(yaw, zaxis);
d = -(mOrigin * tnorm);
mHorizPlanes[HORIZ_PLANE_RIGHT] = LLPlane(tnorm, d);
}
}
示例2: getManipAxis
BOOL LLManip::getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &axis)
{
LLVector3 grid_origin;
LLVector3 grid_scale;
LLQuaternion grid_rotation;
LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
if (manip == LL_X_ARROW)
{
axis = LLVector3::x_axis;
}
else if (manip == LL_Y_ARROW)
{
axis = LLVector3::y_axis;
}
else if (manip == LL_Z_ARROW)
{
axis = LLVector3::z_axis;
}
else
{
return FALSE;
}
axis.rotVec( grid_rotation );
return TRUE;
}
示例3: getVolumePos
LLVector3 LLViewerJointCollisionVolume::getVolumePos(LLVector3 &offset)
{
mUpdateXform = TRUE;
LLVector3 result = offset;
result.scaleVec(getScale());
result.rotVec(getWorldRotation());
result += getWorldPosition();
return result;
}
示例4: fireCurrentBeams
void lggBeamMaps::fireCurrentBeams(LLPointer<LLHUDEffectSpiral> mBeam, const LLColor4U& rgb)
{
if (mScale == 0.0f)
{
return;
}
static LLCachedControl<std::string> colorf(gSavedSettings, "FSBeamColorFile");
bool colorsDisabled = (colorf().empty());
for (std::vector<lggBeamData>::iterator it = mDots.begin(); it != mDots.end(); ++it)
{
LLColor4U myColor = rgb;
if (colorsDisabled)
{
myColor = (*it).c;
}
F32 distanceAdjust = dist_vec(mBeam->getPositionGlobal(), gAgent.getPositionGlobal());
F32 pulse = (F32)(.75f + sinf(gFrameTimeSeconds * 1.0f) * 0.25f);
LLVector3d offset = (*it).p;
offset.mdV[VY] *= -1.f;
offset *= pulse * mScale * distanceAdjust * 0.1f;
LLVector3 beamLine = LLVector3( mBeam->getPositionGlobal() - gAgent.getPositionGlobal());
LLVector3 beamLineFlat = beamLine;
beamLineFlat.mV[VZ]= 0.0f;
LLVector3 newDirFlat = LLVector3::x_axis;
beamLine.normalize();
beamLineFlat.normalize();
LLQuaternion change;
change.shortestArc(newDirFlat, beamLineFlat);
offset.rotVec(change);
newDirFlat.rotVec(change);
change.shortestArc(newDirFlat, beamLine);
offset.rotVec(change);
LLPointer<LLHUDEffectSpiral> myBeam = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM);
myBeam->setPositionGlobal(mBeam->getPositionGlobal() + offset + (LLVector3d(beamLine) * sinf(gFrameTimeSeconds * 2.0f) * 0.2f));
myBeam->setColor(myColor);
myBeam->setTargetObject(mBeam->getTargetObject());
myBeam->setSourceObject(mBeam->getSourceObject());
myBeam->setNeedsSendToSim(mBeam->getNeedsSendToSim());
myBeam->setDuration(mDuration * 1.2f);
}
}
示例5: fireCurrentBeams
void lggBeamMaps::fireCurrentBeams(LLPointer<LLHUDEffectSpiral> mBeam, LLColor4U rgb)
{
if (scale == 0.0f)
{
return;
}
static LLCachedControl<std::string> colorf(gSavedSettings, "FSBeamColorFile");
bool colorsDisabled = std::string(colorf) == "===OFF===";
for(int i = 0; i < (int)dots.size(); i++)
{
LLColor4U myColor = rgb;
if (colorsDisabled) myColor = dots[i].c;
F32 distanceAdjust = dist_vec(mBeam->getPositionGlobal(),gAgent.getPositionGlobal()) ;
F32 pulse = (F32)(.75f+sinf(gFrameTimeSeconds*1.0f)*0.25f);
LLVector3d offset = dots[i].p;
offset.mdV[VY] *= -1;
offset *= pulse * scale * distanceAdjust * 0.1;
//llinfos << "dist is " << distanceAdjust << "scale is " << scale << llendl;
LLVector3 beamLine = LLVector3( mBeam->getPositionGlobal() - gAgent.getPositionGlobal());
LLVector3 beamLineFlat = beamLine;
beamLineFlat.mV[VZ]= 0.0f;
LLVector3 newDirFlat = LLVector3::x_axis;
beamLine.normalize();
beamLineFlat.normalize();
LLQuaternion change;
change.shortestArc(newDirFlat,beamLineFlat);
offset.rotVec(change);
newDirFlat.rotVec(change);
change.shortestArc(newDirFlat,beamLine);
offset.rotVec(change);
LLPointer<LLHUDEffectSpiral> myBeam = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM);
myBeam->setPositionGlobal(mBeam->getPositionGlobal() + offset + (LLVector3d(beamLine) * sinf(gFrameTimeSeconds*2.0f) * 0.2f));
myBeam->setColor(myColor);
myBeam->setTargetObject(mBeam->getTargetObject());
myBeam->setSourceObject(mBeam->getSourceObject());
myBeam->setNeedsSendToSim(mBeam->getNeedsSendToSim());
myBeam->setDuration(duration* 1.2f);
}
}
示例6: getManipNormal
void LLManip::getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal)
{
LLVector3 grid_origin;
LLVector3 grid_scale;
LLQuaternion grid_rotation;
LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
if (manip >= LL_X_ARROW && manip <= LL_Z_ARROW)
{
LLVector3 arrow_axis;
getManipAxis(object, manip, arrow_axis);
LLVector3 cross = arrow_axis % LLViewerCamera::getInstance()->getAtAxis();
normal = cross % arrow_axis;
normal.normVec();
}
else if (manip >= LL_YZ_PLANE && manip <= LL_XY_PLANE)
{
switch (manip)
{
case LL_YZ_PLANE:
normal = LLVector3::x_axis;
break;
case LL_XZ_PLANE:
normal = LLVector3::y_axis;
break;
case LL_XY_PLANE:
normal = LLVector3::z_axis;
break;
default:
break;
}
normal.rotVec(grid_rotation);
}
else
{
normal.clearVec();
}
}
示例7: addPointAgent
void LLBBox::addPointAgent( LLVector3 p)
{
p -= mPosAgent;
p.rotVec( ~mRotation );
addPointLocal( p );
}