本文整理汇总了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;
}
示例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 );
}