本文整理汇总了C++中GetMatrix函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMatrix函数的具体用法?C++ GetMatrix怎么用?C++ GetMatrix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMatrix函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: string
inline void TAligner_SW<CQuery,CSubject>::x_PrintMatrix()
{
cerr << "\x1b[31mNULL\t\x1b[32mIdentity\t\x1b[33mMismatch\t\x1b[34mInsertion\t\x1b[35mDeletion\t\x1b[36mOTHER\x1b[0m\n";
cerr << string(78,'=') << endl;
for( int q = -1; q < (int)((*m_matrix)[0].size() - 1); ++q ) {
for( int s = -1; s < (int)((*m_matrix)[0].size() - 1); ++s ) {
if( s >= 0 ) cerr << "\t";
switch( GetMatrix( q, s, false ).second ) {
case eNull:
cerr << "\x1b[31m";
break;
case eIdentity:
cerr << "\x1b[32m";
break;
case eMismatch:
cerr << "\x1b[33m";
break;
case eInsertion:
cerr << "\x1b[34m";
break;
case eDeletion:
cerr << "\x1b[35m";
break;
default:
cerr << "\x1b[36m";
break;
}
cerr << GetMatrix( q, s, false ).first << "\x1b[0m";
}
cerr << "\n";
}
}
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:32,代码来源:taligner_sw.hpp
示例2: vector3f_t
const CameraDesc& Camera::GetDesc() const
{
m_desc.EyePosition = vector3f_t(GetMatrix(CoordType::Global) * vector4f_t(m_originalDesc.EyePosition, 1));
m_desc.Direction = vector3f_t(GetMatrix(CoordType::Global) * GetMatrix(CoordType::Local) * vector4f_t(m_originalDesc.Direction, 0));
m_desc.Up = vector3f_t(GetMatrix(CoordType::Global) * GetMatrix(CoordType::Local) * vector4f_t(m_originalDesc.Up, 0));
return m_desc;
}
开发者ID:QueryInterface,项目名称:RenderBase,代码行数:7,代码来源:CameraImpl.cpp
示例3: ForceSetWorldMatrix
void MatrixMoveable::OnUpdateWorldMatrix(Matrix4& transform, int32 dirtyFlag)
{
if (mParentMoveable != nullptr&&mParentMoveable->IsWorldMatrixDirty())
{
ForceSetWorldMatrix(GetMatrix()*(mParentMoveable->WorldMatrix()));
}
else
{
ForceSetWorldMatrix(GetMatrix());
}
}
开发者ID:johndpope,项目名称:Medusa,代码行数:11,代码来源:MatrixMoveable.cpp
示例4: ForceSetWorldMatrix
void TransformMoveable::OnUpdateWorldMatrix( Matrix4& transform )
{
TransformMoveable* parent=GetParentMoveable();
if (parent!=NULL&&parent->IsWorldMatrixDirty())
{
ForceSetWorldMatrix(GetMatrix()*(parent->GetWorldMatrix()));
}
else
{
ForceSetWorldMatrix(GetMatrix());
}
}
开发者ID:alkaidlong,项目名称:PaperDemo,代码行数:12,代码来源:TransformMoveable.cpp
示例5: wxSVGRect
wxSVGRect wxSVGVideoElement::GetBBox(wxSVG_COORDINATES coordinates) {
wxSVGRect bbox = wxSVGRect(GetX().GetAnimVal(), GetY().GetAnimVal(), GetWidth().GetAnimVal(),
GetHeight().GetAnimVal());
if (coordinates != wxSVG_COORDINATES_USER)
bbox.MatrixTransform(GetMatrix(coordinates));
return bbox;
}
开发者ID:KastB,项目名称:OpenCPN,代码行数:7,代码来源:SVGVideoElement.cpp
示例6: MgTest
void MGPreconditioner :: MgTest () const
{
cout << "Compute eigenvalues" << endl;
const BaseMatrix & amat = GetAMatrix();
const BaseMatrix & pre = GetMatrix();
int eigenretval;
EigenSystem eigen (amat, pre);
eigen.SetPrecision(1e-30);
eigen.SetMaxSteps(1000);
eigenretval = eigen.Calc();
eigen.PrintEigenValues (*testout);
(cout) << " Min Eigenvalue : " << eigen.EigenValue(mgnumber) << endl;
(cout) << " Max Eigenvalue : " << eigen.MaxEigenValue() << endl;
(cout) << " Condition " << eigen.MaxEigenValue()/eigen.EigenValue(mgnumber) << endl;
(*testout) << " Min Eigenvalue : " << eigen.EigenValue(mgnumber) << endl;
(*testout) << " Max Eigenvalue : " << eigen.MaxEigenValue() << endl;
(*testout) << " Condition " << eigen.MaxEigenValue()/eigen.EigenValue(mgnumber) << endl;
static ofstream condout (mgfile.c_str());
// double cond;
condout << bfa->GetFESpace()->GetNDof() << "\t" << bfa->GetFESpace()->GetOrder() << "\t" << eigen.EigenValue(mgnumber) << "\t" << eigen.MaxEigenValue() << "\t"
<< eigen.MaxEigenValue()/eigen.EigenValue(mgnumber) << "\t" << endl;
if(testresult_ok) *testresult_ok = eigenretval;
if(testresult_min) *testresult_min = eigen.EigenValue(mgnumber);
if(testresult_max) *testresult_max = eigen.MaxEigenValue();
}
开发者ID:ddrake,项目名称:ngsolve,代码行数:31,代码来源:preconditioner.cpp
示例7: D3DXVECTOR2
/**
@brief 바운딩박스를 계산해 돌려준다.
*/
XE::xRECT XLayerImage::GetBoundBox( const D3DXMATRIX& mParent ) const
{
// 이미지의 4귀퉁이를 이 매트릭스로 트랜스폼
XSprite *pSpr = m_pSpriteCurr;
if( pSpr ) {
const D3DXVECTOR2 vAdj = pSpr->GetAdjust();
const auto vSize = pSpr->GetSize();
D3DXVECTOR2 vLT = vAdj;
D3DXVECTOR2 vRT = D3DXVECTOR2( vAdj.x + vSize.w, vAdj.y );
D3DXVECTOR2 vLB = D3DXVECTOR2( vAdj.x , vAdj.y + vSize.h );
D3DXVECTOR2 vRB = D3DXVECTOR2( vAdj.x + vSize.w, vAdj.y + vSize.h );
XE::VEC2 vtLT, vtRT, vtLB, vtRB;
D3DXVECTOR4 vResult;
const auto mWorld = GetMatrix() * mParent;
D3DXVec2Transform( &vResult, &vLT, &mWorld ); vtLT.Set( vResult.x, vResult.y );
D3DXVec2Transform( &vResult, &vRT, &mWorld ); vtRT.Set( vResult.x, vResult.y );
D3DXVec2Transform( &vResult, &vLB, &mWorld ); vtLB.Set( vResult.x, vResult.y );
D3DXVec2Transform( &vResult, &vRB, &mWorld ); vtRB.Set( vResult.x, vResult.y );
XE::xRECT rectBB;
rectBB.UpdateBoundBox( vtLT );
rectBB.UpdateBoundBox( vtRT );
rectBB.UpdateBoundBox( vtLB );
rectBB.UpdateBoundBox( vtRB );
return rectBB;
}
return XE::xRECT();
}
开发者ID:xahgo,项目名称:tama,代码行数:30,代码来源:XLayerImage.cpp
示例8: CheckValid
void nuiSprite::GetSpritesAtPoint(float x, float y, std::vector<nuiSprite*>& rSprites)
{
CheckValid();
nuiVector ov(x, y, 0);
nuiMatrix m;
GetMatrix(m);
m.Invert();
nuiVector v = m * ov;
x = v[0];
y = v[1];
const nuiSpriteAnimation* pAnim = mpSpriteDef->GetAnimation(mCurrentAnimation);
const nuiSpriteFrame* pFrame = pAnim->GetFrame(ToBelow(mCurrentFrame));
nuiRect dst(pFrame->GetRect());
dst.Move(-pFrame->GetHandleX(), -pFrame->GetHandleY());
if (dst.IsInside(x, y))
rSprites.push_back(this);
uint32 s = mpChildren.size();
for (size_t i = 0; i < s; i++)
{
mpChildren[i]->GetSpritesAtPoint(x, y, rSprites);
}
}
开发者ID:jbl2024,项目名称:nui3,代码行数:25,代码来源:nuiSpriteView.cpp
示例9: Inversion
void Inversion(FunctionCall fc)
{
int i, j, index, exist = 0;
Matrix a, c;
char name[MAXSIZE_NAME] = {0};
index = IndexMatrix(fc->name);
if (index==-1)
{
index = cur_mat;
mats[index] = (StrMatObject*)malloc(sizeof(StrMatObject));
if (mats[index] == NULL)
{
printf("NewMatrix(): Could not allocate the new matrix\n");
return;
}
for (i = 0; i < MAXSIZE_NAME; i++)
{
mats[index]->name[i] = fc->name[i];
if (fc->name[i]=='\0') break;
}
}
else exist = 1;
j = 0;
// searching for matrix name
for (i = 0; i < MAXSIZE_NAME; i++)
{
name[j] = fc->args[i];
if (name[j] == '\0') break;
j++;
}
a = GetMatrix(name);
if (a==NULL)
{
printf("\tMatrix %s Not Found\n", name);
if (!exist) free(mats[index]);
return;
}
c = invert(a);
if (c==NULL)
{
printf("\tMatrix %s Not Invertible\n", name);
if (!exist) free(mats[index]);
return;
}
if (exist) deleteMatrix(mats[index]->mat);
mats[index]->mat = c;
// test: display the result
displayMatrix(mats[index]->mat);
if (!exist) cur_mat++;
}
开发者ID:Pawamoy-Sandbox,项目名称:minicas,代码行数:60,代码来源:minicas.c
示例10: SVGMatrix
already_AddRefed<SVGMatrix>
SVGMatrix::Translate(float x, float y)
{
nsRefPtr<SVGMatrix> matrix =
new SVGMatrix(gfxMatrix(GetMatrix()).Translate(gfxPoint(x, y)));
return matrix.forget();
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:7,代码来源:SVGMatrix.cpp
示例11: D3DXVec3Length
void CBurnBot::CollisionResponse(IBaseObject* pObj)
{
int nType = pObj->GetID();
Sphere tempSphere = pObj->GetSphere();
D3DXVECTOR3 V = tempSphere.m_Center - this->GetSphere().m_Center;
float Mag = D3DXVec3Length(&V);
float Distance = tempSphere.m_Radius + GetSphere().m_Radius;
float X = Distance/Mag + EPISILON;
V = V * X;
D3DXMATRIX tempMat = pObj->GetMatrix();
if(nType == OBJ_TUNNEL)
tempMat._43 *= 0.85f;
D3DXMATRIX tempSetMat = GetMatrix();
tempSetMat._41 = tempMat._41 - V.x;
tempSetMat._43 = tempMat._43 - V.z;
this->SetMatrix(tempSetMat);
if( nType == OBJ_PLAYER )
{
if(!m_bCloseToTarget)
{
m_bCloseToTarget = true;
m_fExplodeTimer = BURN_CHARGETIME;
SetBeingHit(BURNEXPLODE);
WwiseNS::PlaySFX(WwiseNS::EVENT_SOUND_BURNALERT);
ChangeAnimation(0);
}
}
}
开发者ID:ianalcid08,项目名称:FinalProject,代码行数:31,代码来源:BurnBot.cpp
示例12: GLCheck
////////////////////////////////////////////////////////////
/// Draw the object into the specified window
////////////////////////////////////////////////////////////
void Drawable::Draw(RenderTarget& Target) const
{
// Save the current modelview matrix and set the new one
GLCheck(glMatrixMode(GL_MODELVIEW));
GLCheck(glPushMatrix());
GLCheck(glMultMatrixf(GetMatrix().Get4x4Elements()));
// Setup alpha-blending
if (myBlendMode == Blend::None)
{
GLCheck(glDisable(GL_BLEND));
}
else
{
GLCheck(glEnable(GL_BLEND));
switch (myBlendMode)
{
case Blend::Alpha : GLCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); break;
case Blend::Add : GLCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE)); break;
case Blend::Multiply : GLCheck(glBlendFunc(GL_DST_COLOR, GL_ZERO)); break;
default : break;
}
}
// Set color
GLCheck(glColor4f(myColor.r / 255.f, myColor.g / 255.f, myColor.b / 255.f, myColor.a / 255.f));
// Let the derived class render the object geometry
Render(Target);
// Restore the previous modelview matrix
GLCheck(glMatrixMode(GL_MODELVIEW));
GLCheck(glPopMatrix());
}
开发者ID:Aiscky,项目名称:Zappy,代码行数:38,代码来源:Drawable.cpp
示例13: GetPos
void CObject::Explode()
{
CVector pos = GetPos();
pos.z += 0.5;
CExplosion::AddExplosion(this, GetPlayerPed(-1), 9, pos, 100, 1, -1.0, 0);
if (m_colDamageEffect == 202 || m_colDamageEffect == 200)
{
pos.z -= 1.0;
ObjectDamage(10000.0f, pos, 0, GetPlayerPed(-1), 51);
}
else if (!m_disableFriction)
{
m_linearVelocity.z += 0.5;
m_linearVelocity.x += (rand() - 128) * 0.000199999994947575;
m_linearVelocity.y += (rand() - 128) * 0.000199999994947575;
if (bIsStatic || bIsStaticWaitingForCollision)
{
SetIsStatic(false);
AddToMovingList();
}
}
if (m_objectInfo->fxType == 2)
{
CMatrix pos = GetMatrix();
// to object space
CVector fxObjPos = Multiply3x3(pos, m_objectInfo->fxOffset);
fxObjPos += GetPos(); // to world space
FxSystem_c *sys = FxManager.InitialiseFxSystem(m_objectInfo->fxSystem, fxObjPos, 0, 0);
if (sys)
{
sys->Start();
}
}
}
开发者ID:WLSF,项目名称:GTASA,代码行数:34,代码来源:CObject.cpp
示例14: SVGMatrix
already_AddRefed<SVGMatrix>
SVGMatrix::Rotate(float angle)
{
nsRefPtr<SVGMatrix> matrix =
new SVGMatrix(gfxMatrix(GetMatrix()).Rotate(angle*radPerDegree));
return matrix.forget();
}
开发者ID:Kunden,项目名称:gecko-dev,代码行数:7,代码来源:SVGMatrix.cpp
示例15: GetMatrix
// TODO: This could actually be strided?
const char* NDMask::DataBuffer() const
{
// First make sure that the underlying matrix is on the right device
auto matrix = GetMatrix();
matrix->TransferToDeviceIfNotThere(AsCNTKImplDeviceId(m_device), true);
return matrix->Data();
}
开发者ID:DanielMerget,项目名称:CNTK,代码行数:8,代码来源:NDMask.cpp
示例16: LogicError
void NDMask::MaskSection(const std::vector<size_t>& sectionOffset, const NDShape& sectionShape)
{
// TODO: Implement batching of masking operation for masks residing on GPUs to avoid making
// GPU invocations for each MaskSection call.
if (sectionOffset.size() > m_maskShape.NumAxes())
LogicError("NDMask::MaskSection: The sectionOffset cannot have dimensionality higher than the number of axes of 'this' mask");
if (sectionShape.NumAxes() > m_maskShape.NumAxes())
LogicError("NDMask::MaskSection: The section shape cannot have an axes count higher than the number of axes of 'this' mask");
std::vector<size_t> offset(m_maskShape.NumAxes(), 0);
for (size_t i = 0; i < sectionOffset.size(); ++i)
offset[i] = sectionOffset[i];
NDShape shape = sectionShape.AppendShape(NDShape(m_maskShape.NumAxes() - sectionShape.NumAxes(), NDShape::InferredDimension));
auto maskMatrix = GetMatrix();
size_t rowOffset = offset[0];
size_t colOffset = offset[1];
size_t sliceRowLength = (shape[0] != NDShape::InferredDimension) ? shape[0] : (maskMatrix->GetNumRows() - rowOffset);
size_t sliceColLength = (shape[1] != NDShape::InferredDimension) ? shape[1] : (maskMatrix->GetNumCols() - colOffset);
if ((rowOffset == 0) && (sliceRowLength == maskMatrix->GetNumRows()))
maskMatrix->ColumnSlice(colOffset, sliceColLength).SetValue(0);
else
{
// Since Matrix does not support strides in the row dimension, we will need to create separate slices for each column
for (size_t i = colOffset; i < (colOffset + sliceColLength); ++i)
{
auto column = maskMatrix->ColumnSlice(i, 1);
column.Reshape(1, maskMatrix->GetNumRows());
column.ColumnSlice(rowOffset, sliceRowLength).SetValue(0);
}
}
}
开发者ID:DanielMerget,项目名称:CNTK,代码行数:35,代码来源:NDMask.cpp
示例17: wxSVGPoint
wxSVGRect wxSVGLineElement::GetBBox(wxSVG_COORDINATES coordinates)
{
wxSVGPoint p1 = wxSVGPoint(GetX1().GetAnimVal(), GetY1().GetAnimVal());
wxSVGPoint p2 = wxSVGPoint(GetX2().GetAnimVal(), GetY2().GetAnimVal());
if (coordinates != wxSVG_COORDINATES_USER)
{
wxSVGMatrix matrix = GetMatrix(coordinates);
p1 = p1.MatrixTransform(matrix);
p2 = p2.MatrixTransform(matrix);
}
double x1 = p1.GetX();
double y1 = p1.GetY();
double x2 = p2.GetX();
double y2 = p2.GetY();
wxSVGRect bbox(x1, y1, x2 - x1, y2 - y1);
if (x1 > x2)
{
bbox.SetX(x2);
bbox.SetWidth(x1 - x2);
}
if (y1 > y2)
{
bbox.SetY(y2);
bbox.SetHeight(y1 - y2);
}
return bbox;
}
开发者ID:KastB,项目名称:OpenCPN,代码行数:32,代码来源:SVGLineElement.cpp
示例18: InvalidArgument
void NDMask::CopyFrom(const NDMask& source)
{
if (source.Shape() != Shape())
InvalidArgument("NDMask::CopyFrom: The 'source' mask's shape must be same as the shape of this NDMask");
GetMatrix()->AssignValuesOf(*source.GetMatrix());
}
开发者ID:DanielMerget,项目名称:CNTK,代码行数:7,代码来源:NDMask.cpp
示例19: GetMatrix
void Camera::GetMatrix(Matrix &m)
{
if (dirty)
GetMatrix();
m.Set(matrix);
}
开发者ID:dave-hillier,项目名称:davehillier,代码行数:7,代码来源:Camera.cpp
示例20: Execute
void Execute(const Core3D::ShaderReg* pkIput, C3DVECTOR4& rkPosition, Core3D::ShaderReg* pkOutput)
{
// COMMENT : Transform position
rkPosition = pkIput[0] * GetMatrix(Core3D::SC_WVPMATRIX);
// COMMENT : Pass texture coordinate to pixel shader
pkOutput[0] = pkIput[1];
}
开发者ID:gunsafighter,项目名称:core3d,代码行数:7,代码来源:Checkboard.cpp
注:本文中的GetMatrix函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论