本文整理汇总了C++中Transformation::GetRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ Transformation::GetRotation方法的具体用法?C++ Transformation::GetRotation怎么用?C++ Transformation::GetRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transformation
的用法示例。
在下文中一共展示了Transformation::GetRotation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: asin
void TurntableCamera<real>::Update()
{
Transformation<real> transformation;
Vector3<real> initRotationAxis = Vector3<real>( 0, 1, 0 ) ^ mThetaAxis;
if ( initRotationAxis.SquaredLength() > 1e-5 )
transformation.SetRotationAxis( initRotationAxis.Normalized(), asin( initRotationAxis.Length() ) );
transformation.RotateAxis( mPhiAxis, mPhi );
transformation.RotateAxis( mThetaAxis, mTheta );
Transformation<real> transformationT;
transformationT.RotateAxis( mPhiAxis, mPhi );
transformationT.RotateAxis( mThetaAxis, mTheta );
transformation.SetTranslation( transformationT.GetRotation() * ( mPhiAxis ^ mThetaAxis ).Normalized() * mDistance + mCenter );
this->SetLocalTransformation( transformation );
Camera<real>::Update();
}
示例2: GetRot
Quat GetRot() const{
return mTransformation.GetRotation();
}
示例3: Update
//----------------------------------------------------------------------------
void Update()
{
if (mOverridingCamera){
mOverridingCamera->Update();
}
// world coordinates (Blender style)
// x: right
// y: forward
// z: up
bool viewChanged = mViewPropertyChanged;
if (mViewPropertyChanged)
{
mViewPropertyChanged = false;
Vec3 right = mTransformation.GetMatrix().Column(0);
Vec3 forward = mTransformation.GetMatrix().Column(1);
Vec3 up = mTransformation.GetMatrix().Column(2);
const Vec3& pos = mTransformation.GetTranslation();
mMatrices[View] = fb::MakeViewMatrix(pos, right, forward, up);
mTransformation.GetHomogeneous(mMatrices[InverseView]);
mFrustum.mOrigin = mTransformation.GetTranslation();
mFrustum.mOrientation = mTransformation.GetRotation();
}
bool projChanged = mProjPropertyChanged;
if (mProjPropertyChanged)
{
mAspectRatio = GetWidth() / (Real)GetHeight();
mProjPropertyChanged = false;
if (!mOrthogonal)
{
mMatrices[ProjBeforeSwap] = mMatrices[Proj] =
MakeProjectionMatrix(mFov, mAspectRatio, mNear, mFar);
}
else
{
mMatrices[ProjBeforeSwap] = mMatrices[Proj] =
MakeOrthogonalMatrix((Real)mOrthogonalData.left, (Real)mOrthogonalData.top,
(Real)mOrthogonalData.right, (Real)mOrthogonalData.bottom,
mNear, mFar);
}
if (mYZSwap)
{
Mat44 swapMat(
1, 0, 0, 0,
0, 0, 1, 0,
0, 1, 0, 0,
0, 0, 0, 1);
mMatrices[Proj] = mMatrices[Proj] * swapMat;
}
mMatrices[InverseProj] = mMatrices[Proj].Inverse();
mFrustum.SetData(mNear, mFar, mFov, mAspectRatio);
}
if (projChanged || viewChanged)
{
mMatrices[ViewProj] = mMatrices[Proj] * mMatrices[View];
mMatrices[InverseViewProj] = mMatrices[ViewProj].Inverse();
UpdateFrustum();
if (viewChanged && !mSelf->mObservers_.empty()){
auto& observers = mSelf->mObservers_[TransformChanged];
for (auto it = observers.begin(); it != observers.end(); /**/){
auto observer = it->lock();
if (!observer){
it = observers.erase(it);
continue;
}
++it;
observer->OnViewMatrixChanged();
}
}
if (projChanged && !mSelf->mObservers_.empty()){
auto& observers = mSelf->mObservers_[TransformChanged];
for (auto it = observers.begin(); it != observers.end(); /**/){
auto observer = it->lock();
if (!observer){
it = observers.erase(it);
continue;
}
++it;
observer->OnProjMatrixChanged();
}
}
mRayCache.clear();
}
}
示例4: GetRotation
const Quat& GetRotation() const{
if (mOverridingCamera){
return mOverridingCamera->GetRotation();
}
return mTransformation.GetRotation();
}
示例5: UpdateModelViewTransformation
void MeshObject::UpdateModelViewTransformation(Transformation const & model_view)
{
// TODO: _scale and _local_transformation constitutes way too much transformation data
Transformation transformation(model_view.GetTranslation(), model_view.GetRotation(), _scale);
SetModelViewTransformation(transformation);
}