Line data Source code
1 0 : /* 2 : 3 : OOExhaustPlumeEntity.h 4 : 5 : 6 : Oolite 7 : Copyright (C) 2004-2013 Giles C Williams and contributors 8 : 9 : This program is free software; you can redistribute it and/or 10 : modify it under the terms of the GNU General Public License 11 : as published by the Free Software Foundation; either version 2 12 : of the License, or (at your option) any later version. 13 : 14 : This program is distributed in the hope that it will be useful, 15 : but WITHOUT ANY WARRANTY; without even the implied warranty of 16 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 : GNU General Public License for more details. 18 : 19 : You should have received a copy of the GNU General Public License 20 : along with this program; if not, write to the Free Software 21 : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 : MA 02110-1301, USA. 23 : 24 : */ 25 : 26 : #import "ShipEntity.h" 27 : #import "OOTexture.h" 28 : 29 0 : typedef struct 30 : { 31 0 : double timeframe; // universal time for this frame 32 0 : HPVector position; 33 0 : Quaternion orientation; 34 0 : Vector k; // direction vectors 35 : } Frame; 36 : 37 : 38 0 : enum 39 : { 40 : kExhaustFrameCount = 16 41 : }; 42 : 43 : 44 0 : @interface OOExhaustPlumeEntity: Entity <OOSubEntity> 45 : { 46 : @private 47 : Vector _exhaustScale; 48 0 : OOHPScalar _vertices[34 * 3]; 49 0 : GLfloat _glVertices[34 * 3]; 50 0 : GLfloat _exhaustBaseColors[34 * 4]; 51 0 : Frame _track[kExhaustFrameCount]; 52 0 : OOTimeAbsolute _trackTime; 53 0 : uint8_t _nextFrame; 54 0 : } 55 : 56 : + (id) exhaustForShip:(ShipEntity *)ship withDefinition:(NSArray *)definition andScale:(float)scale; 57 0 : - (id) initForShip:(ShipEntity *)ship withDefinition:(NSArray *)definition andScale:(float)scale; 58 0 : 59 : - (void) resetPlume; 60 0 : 61 : - (Vector) scale; 62 0 : - (void) setScale:(Vector)scale; 63 0 : 64 : - (OOTexture *) texture; 65 0 : 66 : + (void) setUpTexture; 67 0 : + (OOTexture *) plumeTexture; 68 0 : + (void) resetGraphicsState; 69 0 : 70 : @end 71 : 72 : 73 : @interface Entity (OOExhaustPlume) 74 : 75 : - (BOOL)isExhaust; 76 0 : 77 : @end