本文整理汇总了C++中Vec3f::CNormalize方法的典型用法代码示例。如果您正苦于以下问题:C++ Vec3f::CNormalize方法的具体用法?C++ Vec3f::CNormalize怎么用?C++ Vec3f::CNormalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vec3f
的用法示例。
在下文中一共展示了Vec3f::CNormalize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAsoboFPU
bool UnderstandingMgr_W::OnePassScanOnCurrentSR(const Vec3f &_CameraPos, const Vec3f &_CameraDir, Float _MaxPlayspaceSize)
{
// Set FPU
SetAsoboFPU();
m_PlaySpaceInfos.SetPlayspaceSR(&m_PlayspaceSR);
// Set Camera (to be modified)
Vec3f normedCameraDir;
Vec3f normedCameraDirUp;
normedCameraDir.CNormalize();
normedCameraDirUp = normedCameraDir ^ (normedCameraDir^VEC3F_UP);
normedCameraDirUp.CNormalize();
Util_L::SetCurrentCamera(_CameraPos, normedCameraDir, normedCameraDirUp);
if (m_FrameMode == ManageInside)
Util_L::ApplyTranfoToCamera(m_FrameQuat);
// Set Scan mode : MESH and NEW (to be suppressed)
PlaySpaceInfos_W::g_TypeScan &= ~PlaySpaceInfos_W::PSI_SCAN_OLD;
PlaySpaceInfos_W::g_TypeScan |= PlaySpaceInfos_W::PSI_SCAN_NEW;
PlaySpaceInfos_W::g_TypeScan |= PlaySpaceInfos_W::PSI_SCAN_MESH;
if (!m_PlaySpaceInfos.OnePassComputePlaySpace(_CameraPos, _CameraDir, _MaxPlayspaceSize))
return FALSE;
// Report Align.
ResetFrameTransfo(m_FrameQuat * m_PlaySpaceInfos.m_AlignTransfo);
return TRUE;
}
示例2: Sign
Quat Util_L::GetOrientationQuat(const Vec3f &_front, const Vec3f &_baseUp, S32 _order[3])
{
// orientation / sol
Mat4x4 rot;
Quat qRot;
Vec3f vRight = _front ^ _baseUp;
vRight.CNormalize();
Vec3f vUp = vRight ^ _front;
vUp.CNormalize();
Vec3f v[3] = { _front, vUp, vRight };
for (S32 i = 0;i < 3;i++)
rot.GetRow(i) = Sign(_order[i]) * v[Abs(_order[i]) - 1];
qRot = Quat(rot);
qRot.Normalize();
return qRot;
}
示例3: GetOrientationQuat
Quat Util_L::GetOrientationQuat(const Vec3f &_nodePos, const Vec3f &_viewPos, const Vec3f &_baseUp, S32 _order[3], Float *_pDist)
{
Vec3f vFrontDir = _viewPos - _nodePos;
if (_pDist)
{
(*_pDist) = vFrontDir.GetNorm();
}
vFrontDir.CNormalize();
return GetOrientationQuat(vFrontDir, _baseUp, _order);
}
示例4: QuatToRV
void QuatToRV(const Quat &_q,Vec3f &_v)
{
Quat q=_q;
if (q.w<-1.f) q.w=-1.f;
if (q.w>1.f) q.w=1.f;
Float halfang=ACos(q.w);
Float s=Sin(halfang); //Don't try to use sinf here...we already tried, it breaks the quaternion...Need to investigate
if (s>Float_Eps)
{
q.v*=(1.f/s);
}
q.w=halfang*2.f;
_v=q.v,
_v.CNormalize();
_v*=q.w;
}