![]() |
WhirlyGlobe
1.2
A 3D interactive globe toolkit for iOS
|
00001 /* 00002 * ParticleSystemLayer.h 00003 * WhirlyGlobeLib 00004 * 00005 * Created by Steve Gifford on 10/10/11. 00006 * Copyright 2011 mousebird consulting. All rights reserved. 00007 * 00008 * Licensed under the Apache License, Version 2.0 (the "License"); 00009 * you may not use this file except in compliance with the License. 00010 * You may obtain a copy of the License at 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, software 00014 * distributed under the License is distributed on an "AS IS" BASIS, 00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00016 * See the License for the specific language governing permissions and 00017 * limitations under the License. 00018 * 00019 */ 00020 00021 #import <math.h> 00022 #import <set> 00023 #import <map> 00024 #import "Identifiable.h" 00025 #import "Drawable.h" 00026 #import "DataLayer.h" 00027 #import "LayerThread.h" 00028 #import "TextureAtlas.h" 00029 #import "DrawCost.h" 00030 #import "ParticleGenerator.h" 00031 00037 @interface ParticleSystem : NSObject 00038 { 00039 WhirlyGlobe::GeoCoord loc; 00040 Vector3f norm; 00041 } 00042 00043 @property (nonatomic,assign) WhirlyGlobe::GeoCoord loc; 00044 @property (nonatomic,assign) Vector3f norm; 00045 00046 @end 00047 00048 namespace WhirlyGlobe 00049 { 00050 00053 class ParticleSysSceneRep : public Identifiable 00054 { 00055 public: 00056 ParticleSysSceneRep() { } 00057 00058 SimpleIDSet partSysIDs; // The particle systems we created 00059 }; 00060 typedef std::set<ParticleSysSceneRep *,IdentifiableSorter> ParticleSysSceneRepSet; 00061 00062 } 00063 00101 @interface ParticleSystemLayer : NSObject<WhirlyGlobeLayer> 00102 { 00104 WhirlyGlobeLayerThread *layerThread; 00105 00107 WhirlyGlobe::GlobeScene *scene; 00108 00110 WhirlyGlobe::SimpleIdentity generatorId; 00111 00113 WhirlyGlobe::ParticleSysSceneRepSet sceneReps; 00114 } 00115 00117 - (void)startWithThread:(WhirlyGlobeLayerThread *)layerThread scene:(WhirlyGlobe::GlobeScene *)scene; 00118 00120 - (WhirlyGlobe::SimpleIdentity) addParticleSystem:(ParticleSystem *)partSystem desc:(NSDictionary *)desc; 00121 00123 - (WhirlyGlobe::SimpleIdentity) addParticleSystems:(NSArray *)partSystems desc:(NSDictionary *)desc; 00124 00126 - (void) removeParticleSystems:(WhirlyGlobe::SimpleIdentity)partSysId; 00127 00128 @end