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


C++ Assembly::SetPosition方法代码示例

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


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

示例1: Assembly

Assembly *GraspGLObjects::CreateVisualTool( double magnifier ) {

	Assembly *tool = new Assembly();

	// Create a set of 'fingers', each of which is a 'capsule' composed of a tube with rounded caps.
	static int n_fingers = target_balls-1;

	double radius = finger_ball_radius * magnifier;
	double length = finger_length * magnifier;

	double spacing = radius * 2.0;

	for ( int trg = - n_fingers; trg <= n_fingers ; trg++ ){


		// Each finger is a 'capsule' composed of a cylinder that is capped on each end with a sphere.
		Assembly *finger = new Assembly();
		Sphere *sphere = new Sphere( radius );
		sphere->SetPosition( 0.0, 0.0, 0.0 );
		finger->AddComponent( sphere );
		Cylinder *cylinder = new Cylinder( radius, radius, length );
		cylinder->SetPosition( 0.0, 0.0, - length / 2 );
		finger->AddComponent( cylinder );
		sphere = new Sphere( radius );
		sphere->SetPosition( 0.0, 0.0, - length );
		finger->AddComponent( sphere );

		// Space the fingers vertically.
		finger->SetPosition( 0.0, spacing * trg, 0.0 );
		tool->AddComponent( finger );
	}
	SetHandColor( tool, true );

	return tool;
}
开发者ID:PsyPhy,项目名称:GRASPonISS,代码行数:35,代码来源:GraspGLObjects.cpp

示例2: MarkerStructureGLObject

MarkerStructureGLObject *GraspGLObjects::CreateHmdMarkerStructure ( char *model_file ) {

	MarkerStructureGLObject *structure = new MarkerStructureGLObject( model_file );

	Slab *bar;
	Assembly *frame = new Assembly();

	bar = new Slab( STRUCTURE_BAR_RADIUS, 100.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition(   0.0, 0.0, 0.0 );
	frame->AddComponent( bar );
	bar = new Slab( 210.0, STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS );
	bar->SetPosition(   0.0, 0.0, 0.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, 160.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( 110.0, 0.0, 40.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, 160.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( -110.0, 0.0, 40.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS, 40 );
	bar->SetPosition( -110.0, 0.0, 20.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS, 40 );
	bar->SetPosition( 110.0, 0.0, 20.0 );
	frame->AddComponent( bar );


	frame->SetPosition( 0.0, 0.0, -10.0 );

	structure->AddComponent( frame );


	structure->SetColor( Translucid( GRAY ) );
	//	structure->SetOrientation( 0.0, 0.0, 90.0 );
	return( structure );
}
开发者ID:PsyPhy,项目名称:GRASPonISS,代码行数:36,代码来源:GraspGLObjects.cpp


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