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

Implementation Gyroscope iOS #24

Open
GoogleCodeExporter opened this issue Jul 2, 2015 · 1 comment
Open

Implementation Gyroscope iOS #24

GoogleCodeExporter opened this issue Jul 2, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Someone managed to implement the use of the gyroscope?


Original issue reported on code.google.com by [email protected] on 22 Aug 2013 at 4:30

@GoogleCodeExporter
Copy link
Author

Hi I was facing the issues when implementing gyroscope in ipad. Its showing "No 
Gyroscope".

I was using this code when i need to start the gyroscope in panorama view or 
stop it.
-(void)startCompass
{

[plView setAccelerometerSensitivity:1];
    [plView startSensorialRotation];
}
-(void)stopCompass
{

     [plView stopSensorialRotation];
}

but it did not work , so little trick work for me. whenever you want to start 
compass , just add a dummy hotspot and keep its visibility hidden. so this work 
nice for me.

The working code is

-(void)startCompass
{
    [plView setAccelerometerSensitivity:1];
    [plView startSensorialRotation];

    NSString *iconPath = [[NSBundle mainBundle] pathForResource:@"hotspot1" ofType:@"png"];
    PLTexture *hotspotTexture = [PLTexture textureWithImage:[PLImage imageWithPath:iconPath]];
    PLHotspot *hotspot = [PLHotspot hotspotWithId:0 texture:hotspotTexture atv:0 ath:0 width:0.01 height:0.01];
    [currentPanoramaObject addHotspot:hotspot];
    // hotspot.panoramaImageId = dto.destPanoImgId;
    //hotspot.type = PLHotspotTypeNavigation;
    hotspot.alpha = 0;
    [plView.panorama addHotspot:hotspot];
}

i kept the width and height small and make it hidden. because its for dummy 
purpose.


Original comment by [email protected] on 11 Aug 2014 at 6:57

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

No branches or pull requests

1 participant