Cocos3D: MeshNode не добавляется на сцену

Я пытаюсь добавить узлы сетки из 2 разных файлов pod в мою сцену. Первый узел ('austenNode') добавляется, но не три других (backpack_front, backpack_back и backpack_closed), которые я пытаюсь добавить из второго файла модуля. Я что-то здесь не так делаю??

-(void) initializeScene {

self.backdrop = [CC3Backdrop nodeWithColor:ccc4f(0.0/255.0, 0.0/255.0, 0.0/255.0, 0.0)];

CC3Camera* cam = [CC3Camera nodeWithName: @"Camera"];
cam.location = cc3v( 32.0, 10.6 , -10.0 );
[cam rotateByAngle:126 aroundAxis:cc3v(0, 1, 0)];
cam.uniformScale=0.9;

NSLog(@"info : %f %f",[cam fieldOfView],cam.uniformScale);
[self addChild: cam];

CC3Light* lamp = [CC3Light nodeWithName: @"Lamp"];
lamp.location = cc3v( 0.0, 0.0, 0.0 );
lamp.isDirectionalOnly = NO;
[cam addChild: lamp];

self.rezNode= [CC3PODResourceNode nodeFromFile: @"Austen_Intro.pod"];
self.austenNode=[self.rezNode getNodeNamed:@"Austen_Intro.pod-SoftBody"];

[self addChild:self.austenNode];
self.austenNode.location=cc3v( 0.0, 0.0, 0.0 );
[self.austenNode rotateByAngle:60.0 aroundAxis:cc3v(0, 1, 0)];
[self.austenNode rotateByAngle:0.0 aroundAxis:cc3v(1, 0, 0)];
[self.austenNode rotateByAngle:5.0 aroundAxis:cc3v(0, 0, 1)];
[self.austenNode removeShaders];

[self addChild:self.austenNode];

self.austenNode.visible=YES;
self.austenNode.touchEnabled=YES;
self.austenNode.opacity = GLfloatFromCCOpacity(1.0);

CC3ResourceNode* rezNode2=[CC3PODResourceNode nodeFromFile: @"Austen_Success_Jump.pod"];

self.backpack_back = [CC3MeshNode nodeWithName:@"backpack_back"];
self.backpack_front = [CC3MeshNode nodeWithName:@"backpack_front"];
self.backpack_closed = [CC3MeshNode nodeWithName:@"backpack_closed"];

[self.backpack_back populateFrom:[rezNode2 getMeshNodeNamed:@"backpack_back"]];
[self.backpack_front populateFrom:[rezNode2 getMeshNodeNamed:@"backpack_back"]];
[self.backpack_closed populateFrom:[rezNode2 getMeshNodeNamed:@"backpack_back"]];


[self addChild:self.backpack_back];
[self addChild:self.backpack_front];
[self addChild:self.backpack_closed];

[self removeShaders];

self.backpack_back.location= cc3v( 2.0, 5.0, 1.0 );
self.backpack_front.location= cc3v( 2.0, 5.0, 0.0 );
self.backpack_closed.location= cc3v( 2.0, 5.0, -1.0 );

self.backpack_back.visible=YES;
self.backpack_back.touchEnabled=YES;
self.backpack_back.opacity = GLfloatFromCCOpacity(1.0);

self.backpack_front.visible=YES;
self.backpack_front.touchEnabled=YES;
self.backpack_front.opacity = GLfloatFromCCOpacity(1.0);

self.backpack_closed.visible=YES;
self.backpack_closed.touchEnabled=YES;
self.backpack_closed.opacity = GLfloatFromCCOpacity(1.0);




[self createBoundingVolumes];
[self createGLBuffers];
[self releaseRedundantContent];

LogInfo(@"The structure of this scene is: %@", [self structureDescription]);

}

0 ответов

Другие вопросы по тегам