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


C++ YsVec3::GetValue方法代码示例

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


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

示例1:

static YSRESULT YsClipInfiniteLine3_FindFirstIntersection
    (YsVec3 &itsc,const YsVec3 &org,const YsVec3 &vec,const YsVec3 range[2])
{
	int i,j,k;

	for(i=0; i<3; i++)
	{
		for(j=0; j<2; j++)
		{
			if(YsClip3DLine(itsc,org,vec,range[j].GetValue()[i],i)==YSOK)
			{
				for(k=0; k<3; k++)
				{
					if(i!=k &&
					   (itsc.GetValue()[k]<range[0].GetValue()[k]-YsTolerance ||
					    range[1].GetValue()[k]+YsTolerance<itsc.GetValue()[k]))
					{
						goto NEXTPLANE;
					}
				}
				return YSOK;
			}
		NEXTPLANE:
			;
		}
	}
	return YSERR;
}
开发者ID:Jenny19880324,项目名称:MCG03,代码行数:28,代码来源:ysclip.cpp

示例2: if

static YSRESULT YsClip3DLine
    (YsVec3 &clip,const YsVec3 &org,const YsVec3 &vec,const double &clipPoint,int component)
{
	int c1,c2;
	double buf[3],slope[3];

	if(component==0)
	{
		c1=1;
		c2=2;
	}
	else if(component==1)
	{
		c1=0;
		c2=2;
	}
	else
	{
		c1=0;
		c2=1;
	}

	if(YsAbs(vec.GetValue()[component])>=YsTolerance)
	{
		slope[c1]=vec.GetValue()[c1]/vec.GetValue()[component];
		slope[c2]=vec.GetValue()[c2]/vec.GetValue()[component];

		buf[component]=clipPoint;
		buf[c1]=org.GetValue()[c1]+slope[c1]*(clipPoint-org.GetValue()[component]);
		buf[c2]=org.GetValue()[c2]+slope[c2]*(clipPoint-org.GetValue()[component]);

		clip.Set(buf[0],buf[1],buf[2]);

		return YSOK;
	}
	else
	{
		return YSERR;
	}
}
开发者ID:Jenny19880324,项目名称:MCG03,代码行数:40,代码来源:ysclip.cpp

示例3: if

void FsGui3DInterface::Draw(void) const
{
	needRedraw=YSFALSE;

	if(type==IFTYPE_BOX)
	{
		YsVec3 cen,o;

		glColor3d(0.0,1.0,0.0);

		glEnable(GL_LINE_STIPPLE);
		glLineStipple(1,0xf0f0);

		glBegin(GL_LINES);

		glVertex3d(box_pos[0].x(),box_pos[0].y(),box_pos[0].z());
		glVertex3d(box_pos[1].x(),box_pos[0].y(),box_pos[0].z());

		glVertex3d(box_pos[1].x(),box_pos[0].y(),box_pos[0].z());
		glVertex3d(box_pos[1].x(),box_pos[1].y(),box_pos[0].z());

		glVertex3d(box_pos[1].x(),box_pos[1].y(),box_pos[0].z());
		glVertex3d(box_pos[0].x(),box_pos[1].y(),box_pos[0].z());


		glVertex3d(box_pos[0].x(),box_pos[1].y(),box_pos[0].z());
		glVertex3d(box_pos[0].x(),box_pos[0].y(),box_pos[0].z());

		glVertex3d(box_pos[0].x(),box_pos[0].y(),box_pos[1].z());
		glVertex3d(box_pos[1].x(),box_pos[0].y(),box_pos[1].z());

		glVertex3d(box_pos[1].x(),box_pos[0].y(),box_pos[1].z());
		glVertex3d(box_pos[1].x(),box_pos[1].y(),box_pos[1].z());

		glVertex3d(box_pos[1].x(),box_pos[1].y(),box_pos[1].z());
		glVertex3d(box_pos[0].x(),box_pos[1].y(),box_pos[1].z());

		glVertex3d(box_pos[0].x(),box_pos[1].y(),box_pos[1].z());
		glVertex3d(box_pos[0].x(),box_pos[0].y(),box_pos[1].z());


		glVertex3d(box_pos[0].x(),box_pos[0].y(),box_pos[0].z());
		glVertex3d(box_pos[0].x(),box_pos[0].y(),box_pos[1].z());

		glVertex3d(box_pos[1].x(),box_pos[0].y(),box_pos[0].z());
		glVertex3d(box_pos[1].x(),box_pos[0].y(),box_pos[1].z());

		glVertex3d(box_pos[1].x(),box_pos[1].y(),box_pos[0].z());
		glVertex3d(box_pos[1].x(),box_pos[1].y(),box_pos[1].z());

		glVertex3d(box_pos[0].x(),box_pos[1].y(),box_pos[0].z());
		glVertex3d(box_pos[0].x(),box_pos[1].y(),box_pos[1].z());


		glEnd();

		glDisable(GL_LINE_STIPPLE);

		cen=(box_pos[0]+box_pos[1])/2.0;

		glPointSize(float(markerSize));
		glLineWidth(float(linePickingTolerance));

		o.Set(box_pos[0].x(),cen.y(),cen.z());
		glBegin(GL_POINTS);
		glVertex3dv(o.GetValue());
		glEnd();
		DrawLineByPixelLength(o,YsVec3( 1.0,0.0,0.0),pickerLength);
		DrawLineByPixelLength(o,YsVec3(-1.0,0.0,0.0),pickerLength);

		o.Set(box_pos[1].x(),cen.y(),cen.z());
		glBegin(GL_POINTS);
		glVertex3dv(o.GetValue());
		glEnd();
		DrawLineByPixelLength(o,YsVec3( 1.0,0.0,0.0),pickerLength);
		DrawLineByPixelLength(o,YsVec3(-1.0,0.0,0.0),pickerLength);

		o.Set(cen.x(),box_pos[0].y(),cen.z());
		glBegin(GL_POINTS);
		glVertex3dv(o.GetValue());
		glEnd();
		DrawLineByPixelLength(o,YsVec3(0.0, 1.0,0.0),pickerLength);
		DrawLineByPixelLength(o,YsVec3(0.0,-1.0,0.0),pickerLength);

		o.Set(cen.x(),box_pos[1].y(),cen.z());
		glBegin(GL_POINTS);
		glVertex3dv(o.GetValue());
		glEnd();
		DrawLineByPixelLength(o,YsVec3(0.0, 1.0,0.0),pickerLength);
		DrawLineByPixelLength(o,YsVec3(0.0,-1.0,0.0),pickerLength);

		o.Set(cen.x(),cen.y(),box_pos[0].z());
		glBegin(GL_POINTS);
		glVertex3dv(o.GetValue());
		glEnd();
		DrawLineByPixelLength(o,YsVec3(0.0,0.0, 1.0),pickerLength);
		DrawLineByPixelLength(o,YsVec3(0.0,0.0,-1.0),pickerLength);

		o.Set(cen.x(),cen.y(),box_pos[1].z());
		glBegin(GL_POINTS);
//.........这里部分代码省略.........
开发者ID:ninkamat,项目名称:CMU-24-681-CAD-MIProject,代码行数:101,代码来源:fsgui3dgl1.x.cpp


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