mapbox / mapbox-scenekit

Other
231 stars 51 forks source link

Frequently there's a crash when fetching terrain texture - Using Objective - C (There's no log about the issue) #77

Open jorgeAdfi opened 5 years ago

jorgeAdfi commented 5 years ago

if(_terrainNode != nil){ _terrainNode.scale = terraindNodeScale; _terrainNode.geometry.materials = [self _defaultMaterials]; [self.scene.rootNode addChildNode:_terrainNode]; NSLog(@"Agrega terreno a 4riders");

    [_terrainNode fetchTerrainAndTextureWithMinWallHeight:50.0 multiplier:2 enableDynamicShadows:YES textureStyle:@"mapbox/satellite-streets-v9" heightProgress:nil heightCompletion:^(NSError * _Nullable fetchError) {
        if (fetchError) {
            NSLog(@"Texture load failed: %@", fetchError.localizedDescription);
        } else {
            NSLog(@"Terrain load complete");
        }
    } textureProgress:nil textureCompletion:^(UIImage * _Nullable image, NSError * _Nullable fetchError) {
        if (fetchError) {

// NSLog(@"Texture load failed: %@", fetchError.localizedDescription); } if (image) { NSLog(@"terrain texture fetch completed"); self->_terrainNode.geometry.materials[4].diffuse.contents = image; } }]; }

camdeardorff commented 5 years ago

79 might resolve this