Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the right way to manipulate MD360Director? #12

Closed
fabiotnt opened this issue Jun 4, 2016 · 2 comments
Closed

What's the right way to manipulate MD360Director? #12

fabiotnt opened this issue Jun 4, 2016 · 2 comments

Comments

@fabiotnt
Copy link

fabiotnt commented Jun 4, 2016

Hello, exploring the MD360 classes I have found the MD360Director to change Eye, Angle, Ratio and another properties.

What's the right way to manipulate these values from my ViewController?

When I instance my videoplayer, how I can pass the initValue to MD360Director object?
I want to change the mAngle on initValue and setEyeX, setLookX on MD360Director create method.

Thanks a lot.

@ashqal
Copy link
Owner

ashqal commented Jun 20, 2016

Since 0.3.1, custom director factory is supported.

@interface VideoPlayerViewController ()<MD360DirectorFactory>
@end

@implementation VideoPlayerViewController
...
- (void) initPlayer{
    ...
    /////////////////////////////////////////////////////// MDVRLibrary
    MDVRConfiguration* config = [MDVRLibrary createConfig];
    ...
    [config setDirectorFactory:self]; // pass in the custom factory
    ...
    self.vrLibrary = [config build];
    /////////////////////////////////////////////////////// MDVRLibrary
}

// implement the MD360DirectorFactory protocol here.
- (MD360Director*) createDirector:(int) index{
    MD360Director* director = [[MD360Director alloc]init];
    switch (index) {
        case 1:
            [director setEyeX:-2.0f];
            [director setLookX:-2.0f];
            break;
        default:
            break;
    }
    return director;
}
...
@end

@ashqal ashqal closed this as completed Jun 20, 2016
@fabiotnt
Copy link
Author

Thanks a Lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants