当前位置: 首页>>代码示例>>C++>>正文


C++ Matrix3::GetRow方法代码示例

本文整理汇总了C++中Matrix3::GetRow方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3::GetRow方法的具体用法?C++ Matrix3::GetRow怎么用?C++ Matrix3::GetRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Matrix3的用法示例。


在下文中一共展示了Matrix3::GetRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Force

Point3 PBombField::Force(TimeValue t,const Point3 &pos, const Point3 &vel,int index)
{	float d,chaos,dv;
	Point3 dlta,xb,yb,zb,center,expv;
	int decaytype,symm;
	Point3 zero=Zero;
		fValid = FOREVER;		
		if (!tmValid.InInterval(t)) 
		{	tmValid = FOREVER;
			tm = node->GetObjectTM(t,&tmValid);
			invtm = Inverse(tm);
		}
		xb=tm.GetRow(0);
		yb=tm.GetRow(1);
		zb=tm.GetRow(2);
		center=tm.GetTrans();
		fValid &= tmValid;
		TimeValue t0,t2,lastsfor;
		obj->pblock->GetValue(PB_STARTTIME,t,t0,fValid);
		obj->pblock->GetValue(PB_LASTSFOR,t,lastsfor,fValid);
		t2=t0+lastsfor;
		dlta=Zero;
		if ((t>=t0)&&(t<=t2))
		{ float L=Length(dlta=pos-center);
		  obj->pblock->GetValue(PB_DECAY,t,d,fValid);
		  obj->pblock->GetValue(PB_DECAYTYPE,t,decaytype,fValid);
		  if ((decaytype==0)||(L<=d))
		  { obj->pblock->GetValue(PB_DELTA_V,t,dv,fValid);
		    obj->pblock->GetValue(PB_CHAOS,t,chaos,fValid);
		    obj->pblock->GetValue(PB_SYMMETRY,t,symm,fValid);
		    Point3 r;
		    if (symm==SPHERE)
		      expv=(r=dlta/L);
	        else if (symm==PLANAR)
		    { L=DotProd(dlta,zb);
			  expv=(L<0.0f?L=-L,-zb:zb);
		    }
		    else
		    { Point3 E;
		      E=DotProd(dlta,xb)*xb+DotProd(dlta,yb)*yb;
		      L=Length(E);
		      expv=E/L;
		    }
		    dlta=(dv*expv)/(float)dtsq;
			if (decaytype==1)
			 dlta*=(d-L)/d;
			else if (decaytype==2)
			 dlta*=(1/(float)exp(L/d));
			if ((!FloatEQ0(chaos))&&(lastsfor==0.0f))
			{ float theta;
			  theta=HalfPI*chaos*RND01();
			  // Martell 4/14/01: Fix for order of ops bug.
			  float ztmp=RND11(); float ytmp=RND11(); float xtmp=RND11();
			  Point3 d=Point3(xtmp,ytmp,ztmp);
			  Point3 c=Normalize(dlta^d);
			  RotateOnePoint(&dlta.x,&zero.x,&c.x,theta);
			}
		  }	else dlta=Zero; 
		}
	return dlta;
	}
开发者ID:DimondTheCat,项目名称:xray,代码行数:60,代码来源:pbomb.cpp

示例2: TM3ToGLTM4

// ============================================================================
// Convert a MAX TM to an OpenGL TM
void TM3ToGLTM4(const Matrix3 &tm, float glTM[16])
{
	Matrix3 maxTM = tm;
	FixCoordSys(maxTM);

	Point3 row = maxTM.GetRow(0);
	glTM[0] = row.x;
	glTM[1] = row.y;
	glTM[2] = row.z;
	glTM[3] = 0.f;

	row = maxTM.GetRow(1);
	glTM[4] = row.x;
	glTM[5] = row.y;
	glTM[6] = row.z;
	glTM[7] = 0.f;

	row = maxTM.GetRow(2);
	glTM[8] = row.x;
	glTM[9] = row.y;
	glTM[10] = row.z;
	glTM[11] = 0.f;

	row = maxTM.GetRow(3);
	glTM[12] = row.x;
	glTM[13] = row.y;
	glTM[14] = row.z;
	glTM[15] = 1.f;
}
开发者ID:ApocalypseDesign,项目名称:ad_public,代码行数:31,代码来源:utilityOLD.cpp

示例3:

/**
*  @brief
*    Transforms a 3ds Max matrix to a OpenGL matrix
*/
Matrix3 PLTools::Convert3dsMaxMatrixToOpenGLMatrix(const Matrix3 &mMatrix)
{
	return Matrix3( Convert3dsMaxVectorToOpenGLVector(mMatrix.GetRow(0)),
				    Convert3dsMaxVectorToOpenGLVector(mMatrix.GetRow(2)),
				   -Convert3dsMaxVectorToOpenGLVector(mMatrix.GetRow(1)),
					Convert3dsMaxVectorToOpenGLVector(mMatrix.GetRow(3)));
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:11,代码来源:PLTools.cpp

示例4: RotQuat

void     makBoneTrans2(INode* pNode , sBoneTrans_t& boneTrans , Matrix3& mat)
{
	Point3   Trans = mat.GetTrans();
	Matrix3  RotMat = mat;
	Matrix3  ScaleMat = mat;

    RotMat.NoScale();
    ScaleMat = mat * Inverse(RotMat);
    //算出Scale Matrix;

	RotMat.NoTrans();	
	Quat RotQuat(RotMat);

	//ScaleMat.NoRot();
	//ScaleMat.NoTrans();

	boneTrans.m_Rotate    = conv_type<sQuat_t , Quat>(RotQuat);
	boneTrans.m_Trans     = conv_type<sVector_t   ,Point3 >(Trans);
	boneTrans.m_Scale.x   = ScaleMat.GetRow(0).x;
	boneTrans.m_Scale.y   = ScaleMat.GetRow(1).y;
	boneTrans.m_Scale.z   = ScaleMat.GetRow(2).z;
	if( abs(boneTrans.m_Scale.x - boneTrans.m_Scale.y) > 0.000001 ||
		abs(boneTrans.m_Scale.y - boneTrans.m_Scale.z) > 0.000001 ||
		abs(boneTrans.m_Scale.z - boneTrans.m_Scale.x) > 0.000001 )
	{
            std::wstring _NodeName = INodeName(pNode);
            XEVOL_LOG(eXL_DEBUG_HIGH , L"   {警告} :  骨头[ %s ] 的上有NonUniformScale\r\n", _NodeName.c_str() );
	}
}
开发者ID:YOlodfssdf,项目名称:evolution3d,代码行数:29,代码来源:ActionExporter.cpp

示例5: BuildObject

BOOL MeshExpUtility::BuildObject(CEditableObject*& exp_obj, LPCSTR m_ExportName)
{
	bool bResult = true;

	if (m_ExportName[0]==0) return false;

	ELog.Msg(mtInformation,"Building object..." );
	char fname[256]; _splitpath( m_ExportName, 0, 0, fname, 0 );
	exp_obj = xr_new<CEditableObject>(fname);	
	exp_obj->SetVersionToCurrent(TRUE,TRUE);

	ExportItemIt it = m_Items.begin();
	for(;it!=m_Items.end();it++){
		CEditableMesh *submesh = xr_new<CEditableMesh>(exp_obj);
		ELog.Msg(mtInformation,"Converting node '%s'...", it->pNode->GetName());
		if( submesh->Convert(it->pNode) ){
			// transform
			Matrix3 mMatrix;
			mMatrix = it->pNode->GetNodeTM(0)*Inverse(it->pNode->GetParentNode()->GetNodeTM(0));

			Point3	r1	= mMatrix.GetRow(0);
			Point3	r2	= mMatrix.GetRow(1);
			Point3	r3	= mMatrix.GetRow(2);
			Point3	r4	= mMatrix.GetRow(3);
			Fmatrix m;	m.identity();
			m.i.set(r1.x, r1.z, r1.y);
			m.j.set(r2.x, r2.z, r2.y);
			m.k.set(r3.x, r3.z, r3.y);
			m.c.set(r4.x, r4.z, r4.y);
			
			submesh->Transform( m );
			// flip faces
			Fvector v; v.crossproduct(m.j, m.k);
			if(v.dotproduct(m.i)<0.f)	submesh->FlipFaces();
			if(m_ObjectFlipFaces)		submesh->FlipFaces();
			submesh->RecomputeBBox();
			// append mesh
			submesh->SetName			(it->pNode->GetName());
			exp_obj->m_Meshes.push_back	(submesh);
		}else{
			ELog.Msg(mtError,"! can't convert", it->pNode->GetName());
			xr_delete(submesh);
			bResult = false;
			break;
		}
	}

	if (bResult){
		exp_obj->UpdateBox		();
		exp_obj->VerifyMeshNames();
		ELog.Msg				(mtInformation,"Object '%s' contains: %d points, %d faces",
								exp_obj->GetName(), exp_obj->GetVertexCount(), exp_obj->GetFaceCount());
	}else{
		xr_delete(exp_obj);
	}
//-------------------------------------------------------------------
	return bResult;
}
开发者ID:BeaconDev,项目名称:xray-16,代码行数:58,代码来源:MeshExpUtility.cpp

示例6: convertMatrix

void Exporter::convertMatrix(Matrix33 &dst, const Matrix3 &src)
{
	Point3 r0 = src.GetRow(0);
	Point3 r1 = src.GetRow(1);
	Point3 r2 = src.GetRow(2);

	dst.Set(r0.x, r0.y, r0.z,
		    r1.x, r1.y, r1.z,
			r2.x, r2.y, r2.z);
}
开发者ID:Anchoys1,项目名称:max_nif_plugin,代码行数:10,代码来源:Util.cpp

示例7: Matrix3ToMatrix4

void Matrix3ToMatrix4(D3DXMATRIX& Mat, const Matrix3& Mat3)
{
    Point3 Row = Mat3.GetRow(0);
    Mat.m[0][0] = Row.x;	Mat.m[0][1] = Row.y;	Mat.m[0][2] = Row.z;	Mat.m[0][3] = 0;
    Row = Mat3.GetRow(1);
    Mat.m[1][0] = Row.x;	Mat.m[1][1] = Row.y;	Mat.m[1][2] = Row.z;	Mat.m[1][3] = 0;
    Row = Mat3.GetRow(2);
    Mat.m[2][0] = Row.x;	Mat.m[2][1] = Row.y;	Mat.m[2][2] = Row.z;	Mat.m[2][3] = 0;
    Row = Mat3.GetRow(3);
    Mat.m[3][0] = Row.x;	Mat.m[3][1] = Row.y;	Mat.m[3][2] = Row.z;	Mat.m[3][3] = 1;

}
开发者ID:viticm,项目名称:pap2,代码行数:12,代码来源:Util.cpp

示例8: AppendFollowerMatrix

void FormationBhvr::AppendFollowerMatrix(TimeValue t,Matrix3 &mat)
{
	Point3 *points;
	points = new Point3;
	*points = mat.GetRow(0);
	pblock->Append(follower_matrix1,1,&points,1);
	*points = mat.GetRow(1);
	pblock->Append(follower_matrix2,1,&points,1);
	*points = mat.GetRow(2);
	pblock->Append(follower_matrix3,1,&points,1);	
	*points = mat.GetRow(3);
	pblock->Append(follower_matrix4,1,&points,1);
	delete points;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:14,代码来源:formation.cpp

示例9: Convert

Mat4 Convert( const Matrix3& m )
{
    Mat4 tm;
    tm.e00 = m.GetRow(0).x; 
    tm.e01 = m.GetRow(0).y; 
    tm.e02 = m.GetRow(0).z;
    tm.e03 = 0.0f;

    tm.e10 = m.GetRow(1).x; 
    tm.e11 = m.GetRow(1).y; 
    tm.e12 = m.GetRow(1).z;
    tm.e13 = 0.0f;

    tm.e20 = m.GetRow(2).x; 
    tm.e21 = m.GetRow(2).y; 
    tm.e22 = m.GetRow(2).z;
    tm.e23 = 0.0f;

    tm.e30 = m.GetRow(3).x; 
    tm.e31 = m.GetRow(3).y; 
    tm.e32 = m.GetRow(3).z;
    tm.e33 = 1.0f;

    return tm;
} // Convert
开发者ID:skopp,项目名称:rush,代码行数:25,代码来源:maxutils.cpp

示例10:

bool NoniterativeEigen3x3<Real>::PositiveRank (Matrix3<Real>& M,
        Real& maxEntry, Vector3<Real>& maxRow) const
{
	// Locate the maximum-magnitude entry of the matrix.
	maxEntry = (Real)-1;
	int row, maxRowIndex = -1;
	for (row = 0; row < 3; ++row)
	{
		for (int col = row; col < 3; ++col)
		{
			Real absValue = Math<Real>::FAbs(M[row][col]);
			if (absValue > maxEntry)
			{
				maxEntry = absValue;
				maxRowIndex = row;
			}
		}
	}

	// Return the row containing the maximum, to be used for eigenvector
	// construction.
	maxRow = M.GetRow(maxRowIndex);

	return maxEntry >= Math<Real>::ZERO_TOLERANCE;
}
开发者ID:bhlzlx,项目名称:WildMagic,代码行数:25,代码来源:Wm5NoniterativeEigen3x3.cpp

示例11: GetTargetPoint

void
SpotLightFalloffManipulator::UpdateShapes(TimeValue t, TSTR& toolTip)
{
    GenLight* pLight = (GenLight*) mhTarget;

    Matrix3 tm;
    tm = mpINode->GetObjectTM(t);

    Point3 pt;
    b = GetTargetPoint(t, pt);

    if (!b)
        return;

    float den = FLength(tm.GetRow(2));
    float dist = (den!=0) ? FLength(tm.GetTrans()-pt) / den : 0.0f;

    TSTR nodeName;
    nodeName = mpINode->GetName();

    tm = Inverse(tm);
    toolTip.printf("Falloff: %5.2f", (double) pLight->GetFallsize(t));

    SetGizmoScale(dist / kRingScaleFactor);

    ConeAngleManipulator::UpdateShapes(Point3(0,0,0),
                                       Point3(0,0,-1),
                                       dist,
                                       pLight->GetFallsize(t));
}
开发者ID:2asoft,项目名称:xray,代码行数:30,代码来源:coneanglemanip.cpp

示例12: GetWorldBoundBox

void TapeHelpObject::GetWorldBoundBox(TimeValue t, INode* inode, ViewExp* vpt, Box3& box )
{
    if ( ! vpt || ! vpt->IsAlive() )
    {
        box.Init();
        return;
    }

    int i, nv;
    Matrix3 tm;
    float dtarg;
    Point3 pt;
    Point3 q[2];
    GetMat(t,inode,*vpt,tm);
    nv = mesh.getNumVerts();
    box.Init();
    for (i=0; i<nv; i++)
        box += tm*mesh.getVert(i);
    if (GetTargetPoint(t,inode,pt)) {
        tm = inode->GetObjectTM(t);
        dtarg = Length(tm.GetTrans()-pt)/Length(tm.GetRow(2));
        box += tm*Point3(float(0),float(0),-dtarg);
    }
    if(GetSpecLen()) {
        GetLinePoints(t, q, GetLength(t) );
        box += tm * q[0];
        box += tm * q[1];
    }
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:29,代码来源:tapehelp.cpp

示例13: ExportNodeTM

void Exporter::ExportNodeTM(INode* node, int indentLevel,rmatrix *mat)
{
	Matrix3 pivot = node->GetNodeTM(GetStaticFrame());
	// Export TM inheritance flags
	DWORD iFlags = node->GetTMController()->GetInheritanceFlags();
	Point3 row;
	row = pivot.GetRow(0);
	mat->_11=-row.x;mat->_12=row.y;mat->_13=row.z;mat->_14=0;
	row = pivot.GetRow(1);
	mat->_21=-row.x;mat->_22=row.y;mat->_23=row.z;mat->_24=0;
	row = pivot.GetRow(2);
	mat->_31=-row.x;mat->_32=row.y;mat->_33=row.z;mat->_34=0;
	row = pivot.GetRow(3);
	mat->_41=-row.x;mat->_42=row.y;mat->_43=row.z;mat->_44=1;
	*mat=MatrixInverse(*mat);
}
开发者ID:MagistrAVSH,项目名称:node3d,代码行数:16,代码来源:Export.cpp

示例14: DrawLine

// From BaseObject
int TapeHelpObject::DrawLine(TimeValue t, INode* inode, GraphicsWindow *gw, int drawing )
{
    Matrix3 tm = inode->GetObjectTM(t);
    gw->setTransform(tm);
    gw->clearHitCode();
    Point3 pt,v[3];
    if (GetTargetPoint(t,inode,pt)) {
        float den = Length(tm.GetRow(2));
        float dist = (den!=0)?Length(tm.GetTrans()-pt)/den : 0.0f;
        if(!inode->IsFrozen() && !inode->Dependent() && drawing)
            gw->setColor( LINE_COLOR, GetUIColor(COLOR_TAPE_OBJ));
        if (drawing) {
            if(specLenState) {
                GetLinePoints(t, v, GetLength(t) );
                if(drawing == -1)
                    v[1] = 0.9f * v[1];
            }
            else {
                v[0] = Point3(0,0,0);
                if(drawing == -1) // hit-testing!  Shorten the line so target can be picked
                    v[1] = Point3(0.0f, 0.0f, -0.9f * dist);
                else
                    v[1] = Point3(0.0f, 0.0f, -dist);
            }
            gw->polyline( 2, v, NULL, NULL, FALSE, NULL );
        }
    }
    return gw->checkHitCode();
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:30,代码来源:tapehelp.cpp

示例15: TransformPlane

static void TransformPlane(Matrix3& tm, Point4 plin, Point4 plout) {
	Point3 n = VectorTransform(tm, Point3(plin[0],plin[1],plin[2]));
	plout[0] = n.x;
	plout[1] = n.y;
	plout[2] = n.z;
	plout[3] = plin[3] - DotProd(tm.GetRow(3),n); 
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:7,代码来源:plate.cpp


注:本文中的Matrix3::GetRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。