本文整理汇总了C++中MyObject::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ MyObject::addChild方法的具体用法?C++ MyObject::addChild怎么用?C++ MyObject::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyObject
的用法示例。
在下文中一共展示了MyObject::addChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fyxPart
void fyxPart(std::vector<Object*>* objectList)
{
MyObject *MyObjectOne = new MyObject;
objectList->push_back(MyObjectOne);
MyCylinder * CylinderOne = new MyCylinder();
CylinderOne->color = Vector3(0.8,0.9,0.6);
CylinderOne->location = Vector3(60,5,-3);
CylinderOne->rotate = Vector3(0,90,0);
MyObjectOne->addChild(CylinderOne);
MyObject *FrontWall = new MyObject;
FrontWall->location = Vector3(100.0,0.0,0.0);
MyObjectOne->addChild(FrontWall);
MyObject *BackWall = new MyObject;
BackWall->location = Vector3(0.0,0.0,-100.0);
BackWall->rotate = Vector3(0.0,180.0,0.0);
MyObjectOne->addChild(BackWall);
MyObject *LeftWall = new MyObject;
LeftWall->rotate = Vector3(0.0,270.0,0.0);
MyObjectOne->addChild(LeftWall);
MyObject *RightWall = new MyObject;
RightWall->location = Vector3(100.0,0.0,-100.0);
RightWall->rotate = Vector3(0.0,90.0,0.0);
MyObjectOne->addChild(RightWall);
MyObject *TopWall = new MyObject;
TopWall->location = Vector3(100.0,100.0,0.0);
TopWall->rotate = Vector3(270.0,0.0,0.0);
MyObjectOne->addChild(TopWall);
MyObject *BottomWall = new MyObject;
BottomWall->location = Vector3(100.0,0.0,-100.0);
BottomWall->rotate = Vector3(90.0,0.0,0.0);
MyObjectOne->addChild(BottomWall);
NewWall *AllWall = new NewWall;
AllWall->location = Vector3(-50.0,50.0,0.0);
AllWall->size = Vector3(100.0,100.0,2.0);
FrontWall->addChild(AllWall);
BackWall->addChild(AllWall);
LeftWall->addChild(AllWall);
RightWall->addChild(AllWall);
Top * Topt = new Top;
Topt->location = Vector3(-50.0,50.0,0.0);
Topt->size = Vector3(100.0,100.0,1.0);
TopWall->addChild(Topt);
Bottom * Bottomt = new Bottom;
Bottomt->location = Vector3(-50.0,50.0,0.0);
Bottomt->size = Vector3(100.0,100.0,1.0);
BottomWall->addChild(Bottomt);
// MyObject *CompleteDoor = new MyObject;
// CompleteDoor->location = Vector3(50.0,10.0,-98.4);
// MyObjectOne->addChild(CompleteDoor);
// Door *MyDoor = new Door;
// MyDoor->location = Vector3(0.0,0.0,0.0);
// MyDoor->size = Vector3(12.0,20.0,1.0);
// CompleteDoor->addChild(MyDoor);
// Out *DoorOut = new Out;
// DoorOut->color = Vector3(0.0,0.0,0.0);
// DoorOut->location = Vector3(0.0,0.0,-1.0);
// DoorOut->size = Vector3(12.0,20.0,1.0);
// CompleteDoor->addChild(DoorOut);
// Cube *Doorbar1 = new Cube;
// Doorbar1->color = Vector3(0.501,0.2,0);
// Doorbar1->location = Vector3(-6.0,0.0,0.0);
// Doorbar1->size = Vector3(1.0,21.0,2.0);
// CompleteDoor->addChild(Doorbar1);
// Cube *Doorbar2 = new Cube;
// Doorbar2->color = Vector3(0.501,0.2,0);
// Doorbar2->location = Vector3(6.0,0.0,0.0);
// Doorbar2->size = Vector3(1.0,21.0,2.0);
// CompleteDoor->addChild(Doorbar2);
// Cube *Doorbar3 = new Cube;
// Doorbar3->color = Vector3(0.501,0.2,0);
// Doorbar3->location = Vector3(0.0,10.0,0.0);
// Doorbar3->size = Vector3(12.0,1.0,2.0);
// CompleteDoor->addChild(Doorbar3);
}