Can't change screen orientation for the scene in cocos3d

83 Views Asked by At

I have a view controller in which I show some cocos3d content. In my appDelegate:

+(CC3DeviceCameraOverlayUIViewController *)panoramaHostController {
static CC3DeviceCameraOverlayUIViewController *panoramaHostController = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
    panoramaHostController = CC3DeviceCameraOverlayUIViewController.sharedDirector;
    panoramaHostController.supportedInterfaceOrientations = UIInterfaceOrientationMaskAll;
    panoramaHostController.viewShouldUseStencilBuffer = NO;     // Set to YES if using shadow volumes
    panoramaHostController.viewPixelSamples = 1;                    // Set to 4 for antialiasing multisampling
    panoramaHostController.animationInterval = (1.0f / 60.0f);
    panoramaHostController.displayStats = NO;
    [panoramaHostController enableRetinaDisplay: YES];
});
return panoramaHostController;
}

and in panoramaHostController I initialize the scene this way:

-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

//
if (!sceneInitialized) {
    sceneInitialized = YES;

    CC3Layer *axPanoramaLayer = [AxPanoramaLayer layer];
    axPanoramaLayer.contentSize =  [CCDirector sharedDirector].winSize;

    [CCDirector.sharedDirector runWithScene: [axPanoramaLayer asCCScene]];
}
else {
    [[AppDelegate panoramaHostController] resumeAnimation];
}

[self.view addSubview: CCDirector.sharedDirector.view];
...
}

but when I rotate the device - the content stays the same. What's wrong here?

0

There are 0 best solutions below