本文整理汇总了C++中Fmatrix::rotateZ方法的典型用法代码示例。如果您正苦于以下问题:C++ Fmatrix::rotateZ方法的具体用法?C++ Fmatrix::rotateZ怎么用?C++ Fmatrix::rotateZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fmatrix
的用法示例。
在下文中一共展示了Fmatrix::rotateZ方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CCar::cb_Steer (CBoneInstance* B)
{
VERIFY2(fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS),"Bones receive returns 0 matrix");
CCar* C = static_cast<CCar*>(B->callback_param());
Fmatrix m;
m.rotateZ(C->m_steer_angle);
B->mTransform.mulB_43 (m);
#ifdef DEBUG
if( !fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS) ){
Log("RotatingZ angle=",C->m_steer_angle);
VERIFY2(0,"Bones callback returns BAD!!! matrix");
}
#endif
}
示例2: Move
void __fastcall TUI_ControlAIMapNodeRotate::Move(TShiftState _Shift)
{
if (_Shift.Contains(ssLeft)){
float amount = -UI->m_DeltaCpH.x * UI->m_MouseSR;
if( Tools->GetSettings(etfASnap) ) CHECK_SNAP(m_fRotateSnapAngle,amount,Tools->m_RotateSnapAngle);
Fmatrix R;
if (fis_zero(m_RotateVector.x)) R.rotateZ(amount);
else R.rotateX(amount);
AINodeVec& lst = ((ESceneAIMapTool*)parent_tool)->Nodes();
for(AINodeIt _F = lst.begin();_F!=lst.end();_F++)
if((*_F)->flags.is(SAINode::flSelected)){
Fvector new_n;
R.transform_dir(new_n,(*_F)->Plane.n);
if (Fvector().set(0,1,0).dotproduct(new_n)>0.02f){
(*_F)->Plane.build((*_F)->Pos,new_n);
}
}
}
}
示例3: Calculate
void CMatrix::Calculate()
{
if (dwFrame==Device.dwFrame) return;
dwFrame = Device.dwFrame;
// Switch on mode
switch (dwMode) {
case modeProgrammable:
case modeDetail:
return;
case modeTCM:
{
Fmatrix T;
float sU=1,sV=1,t=Device.fTimeGlobal;
tc_trans (xform,.5f,.5f);
if (tcm&tcmRotate) {
T.rotateZ (rotate.Calculate(t)*t);
xform.mulA_43 (T);
}
if (tcm&tcmScale) {
sU = scaleU.Calculate(t);
sV = scaleV.Calculate(t);
T.scale (sU,sV,1);
xform.mulA_43 (T);
}
if (tcm&tcmScroll) {
float u = scrollU.Calculate(t)*t;
float v = scrollV.Calculate(t)*t;
u*=sU;
v*=sV;
tc_trans (T, u, v );
xform.mulA_43 (T);
}
tc_trans (T, -0.5f, -0.5f );
xform.mulB_43 (T);
}
return;
case modeS_refl:
{
float Ux= .5f*Device.mView._11, Uy= .5f*Device.mView._21, Uz= .5f*Device.mView._31, Uw = .5f;
float Vx=-.5f*Device.mView._12, Vy=-.5f*Device.mView._22, Vz=-.5f*Device.mView._32, Vw = .5f;
xform._11=Ux; xform._12=Vx; xform._13=0; xform._14=0;
xform._21=Uy; xform._22=Vy; xform._23=0; xform._24=0;
xform._31=Uz; xform._32=Vz; xform._33=0; xform._34=0;
xform._41=Uw; xform._42=Vw; xform._43=0; xform._44=0;
}
return;
case modeC_refl:
{
Fmatrix M = Device.mView;
M._41 = 0.f;
M._42 = 0.f;
M._43 = 0.f;
xform.invert(M);
}
return;
default:
return;
}
}