Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOFlashEffectEntity Class Reference

#include <OOFlashEffectEntity.h>

+ Inheritance diagram for OOFlashEffectEntity:
+ Collaboration diagram for OOFlashEffectEntity:

Instance Methods

(id) - initExplosionFlashWithPosition:velocity:size: [implementation]
 
(id) - initLaserFlashWithPosition:velocity:color: [implementation]
 
(id) - initWithPosition:size:color:duration: [implementation]
 
(void) - update: [implementation]
 
(OOTexture *) - texture [implementation]
 
(void) - performUpdate: [implementation]
 
- Instance Methods inherited from OOLightParticleEntity
(id) - initWithDiameter:
 
(float) - diameter
 
(void) - setDiameter:
 
(void) - setColor:
 
(void) - setColor:alpha:
 
(void) - drawSubEntityImmediate:translucent:
 
(void) - drawImmediate:translucent: [implementation]
 
(BOOL) - isEffect [implementation]
 
(BOOL) - canCollide [implementation]
 
(NSSet *) - allTextures [implementation]
 
- Instance Methods inherited from Entity
(NSUInteger) - sessionID
 
(BOOL) - isShip
 
(BOOL) - isDock
 
(BOOL) - isStation
 
(BOOL) - isSubEntity
 
(BOOL) - isPlayer
 
(BOOL) - isPlanet
 
(BOOL) - isSun
 
(BOOL) - isSunlit
 
(BOOL) - isStellarObject
 
(BOOL) - isSky
 
(BOOL) - isWormhole
 
(BOOL) - isVisualEffect
 
(BOOL) - isWaypoint
 
(BOOL) - validForAddToUniverse
 
(void) - addToLinkedLists
 
(void) - removeFromLinkedLists
 
(void) - updateLinkedLists
 
(void) - wasAddedToUniverse
 
(void) - wasRemovedFromUniverse
 
(void) - warnAboutHostiles
 
(CollisionRegion *) - collisionRegion
 
(void) - setCollisionRegion:
 
(void) - setUniversalID:
 
(OOUniversalID- universalID
 
(BOOL) - throwingSparks
 
(void) - setThrowSparks:
 
(void) - throwSparks
 
(void) - setOwner:
 
(id) - owner
 
(ShipEntity *) - parentEntity
 
(ShipEntity *) - rootShipEntity
 
(void) - setPosition:
 
(void) - setPositionX:y:z:
 
(HPVector) - position
 
(Vector) - cameraRelativePosition
 
(GLfloat) - cameraRangeFront
 
(GLfloat) - cameraRangeBack
 
(void) - updateCameraRelativePosition
 
(Vector) - vectorTo:
 
(HPVector) - absolutePositionForSubentity
 
(HPVector) - absolutePositionForSubentityOffset:
 
(double) - zeroDistance
 
(double) - camZeroDistance
 
(NSComparisonResult) - compareZeroDistance:
 
(BoundingBox) - boundingBox
 
(GLfloat) - mass
 
(Quaternion) - orientation
 
(void) - setOrientation:
 
(Quaternion) - normalOrientation
 
(void) - setNormalOrientation:
 
(void) - orientationChanged
 
(void) - setVelocity:
 
(Vector) - velocity
 
(double) - speed
 
(GLfloat) - distanceTravelled
 
(void) - setDistanceTravelled:
 
(void) - setStatus:
 
(OOEntityStatus- status
 
(void) - setScanClass:
 
(OOScanClass- scanClass
 
(void) - setEnergy:
 
(GLfloat) - energy
 
(void) - setMaxEnergy:
 
(GLfloat) - maxEnergy
 
(void) - applyRoll:andClimb:
 
(void) - applyRoll:climb:andYaw:
 
(void) - moveForward:
 
(OOMatrix) - rotationMatrix
 
(OOMatrix) - drawRotationMatrix
 
(OOMatrix) - transformationMatrix
 
(OOMatrix) - drawTransformationMatrix
 
(GLfloat) - collisionRadius
 
(GLfloat) - frustumRadius
 
(void) - setCollisionRadius:
 
(NSMutableArray *) - collisionArray
 
(void) - applyVelocity:
 
(BOOL) - checkCloseCollisionWith:
 
(void) - takeEnergyDamage:from:becauseOf:weaponIdentifier:
 
(void) - dumpState
 
(void) - dumpSelfState
 
(double) - findCollisionRadius
 
(BOOL) - isVisible
 
(BOOL) - isInSpace
 
(BOOL) - isImmuneToBreakPatternHide
 
(GLfloat) - universalTime
 
(GLfloat) - spawnTime
 
(GLfloat) - timeElapsedSinceSpawn
 
(void) - setAtmosphereFogging:
 
(OOColor *) - fogUniform
 
(NSString *) - descriptionForObjDumpBasic
 
(NSString *) - descriptionForObjDump
 
(id) - init [implementation]
 
(void) - dealloc [implementation]
 
(NSString *) - descriptionComponents [implementation]
 
(BOOL) - checkLinkedLists [implementation]
 
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
 
(Vector) - relativePosition [implementation]
 
(void) - subEntityReallyDied: [implementation]
 
(BOOL) - isBreakPattern
 
(void) - inspect [implementation]
 
(BOOL) - isECMBlast
 
(NSArray *) - debugInspectorModules [implementation]
 
(NSString *) - inspScanClassLine
 
(NSString *) - inspStatusLine
 
(NSString *) - inspRetainCountLine
 
(NSString *) - inspPositionLine
 
(NSString *) - inspVelocityLine
 
(NSString *) - inspOrientationLine
 
(NSString *) - inspEnergyLine
 
(NSString *) - inspOwnerLine
 
(NSString *) - inspTargetLine
 
(NSString *) - inspDescription [implementation]
 
(NSString *) - inspBasicIdentityLine [implementation]
 
(BOOL) - isExhaust
 
(BOOL) - isFlasher
 
(BOOL) - isVisibleToScripts
 
(NSString *) - oo_jsClassName
 
(void) - getJSClass:andPrototype:
 
(void) - deleteJSSelf
 
(jsval) - oo_jsValueInContext: [implementation]
 
(BOOL) - isCascadeWeapon
 
(BOOL) - isPlayerLikeShip
 
(GLfloat) - clock [implementation]
 
(unsigned) - pseudoFixedD100 [implementation]
 
(unsigned) - pseudoFixedD256 [implementation]
 
(unsigned) - systemGovernment [implementation]
 
(unsigned) - systemEconomy [implementation]
 
(unsigned) - systemTechLevel [implementation]
 
(unsigned) - systemPopulation [implementation]
 
(unsigned) - systemProductivity [implementation]
 
(BOOL) - isShipWithSubEntityShip:
 
- Instance Methods inherited from OOWeakRefObject
(id) - weakSelf
 
(id) - weakRetain [implementation]
 
(void) - weakRefDied: [implementation]
 
- Instance Methods inherited from <OOWeakReferenceSupport>
(id) - OO_RETURNS_RETAINED
 

Class Methods

(instancetype) + explosionFlashFromEntity:
 
(instancetype) + laserFlashWithPosition:velocity:color:
 
(void) + setUpTexture
 
(void) + resetGraphicsState [implementation]
 
- Class Methods inherited from OOLightParticleEntity
(OOTexture *) + defaultParticleTexture
 

Private Attributes

float _duration
 
float _growthRate
 
float _alpha
 

Additional Inherited Members

- Public Attributes inherited from Entity
OOUniversalID universalID
 
unsigned isShip: 1
 
unsigned isStation: 1
 
unsigned isPlayer: 1
 
unsigned isWormhole: 1
 
unsigned isSubEntity: 1
 
unsigned hasMoved: 1
 
unsigned hasRotated: 1
 
unsigned hasCollided: 1
 
unsigned isSunlit: 1
 
unsigned collisionTestFilter: 2
 
unsigned throw_sparks: 1
 
unsigned isImmuneToBreakPatternHide: 1
 
unsigned isExplicitlyNotMainStation: 1
 
unsigned isVisualEffect: 1
 
OOScanClass scanClass
 
GLfloat zero_distance
 
GLfloat cam_zero_distance
 
GLfloat no_draw_distance
 
GLfloat collision_radius
 
HPVector position
 
Vector cameraRelativePosition
 
Quaternion orientation
 
OOColoratmosphereFogging
 
int zero_index
 
Entityx_previous
 
Entityx_next
 
Entityy_previous
 
Entityy_next
 
Entityz_previous
 
Entityz_next
 
Entitycollision_chain
 
OOUniversalID shadingEntityID
 
Entitycollider
 
CollisionRegioncollisionRegion
 
- Protected Attributes inherited from OOLightParticleEntity
GLfloat _colorComponents [4]
 
float _diameter
 
- Protected Attributes inherited from Entity
HPVector lastPosition
 
Quaternion lastOrientation
 
GLfloat distanceTravelled
 
OOMatrix rotMatrix
 
Vector velocity
 
GLfloat energy
 
GLfloat maxEnergy
 
BoundingBox boundingBox
 
GLfloat mass
 
NSMutableArray * collidingEntities
 
OOTimeAbsolute spawnTime
 
struct JSObject * _jsSelf
 
- Protected Attributes inherited from OOWeakRefObject
OOWeakReferenceweakSelf
 

Detailed Description

Definition at line 31 of file OOFlashEffectEntity.h.

Method Documentation

◆ explosionFlashFromEntity:

+ (instancetype) explosionFlashFromEntity: (Entity *) entity

Definition at line 41 of file OOFlashEffectEntity.m.

81 :(Entity *)entity
82{
83 return [[[self alloc] initExplosionFlashWithPosition:[entity position] velocity:[entity velocity] size:[entity collisionRadius]] autorelease];
84}
GLfloat collisionRadius()
Definition Entity.m:905
HPVector position
Definition Entity.h:112
Vector velocity
Definition Entity.h:140

◆ initExplosionFlashWithPosition:velocity:size:

- (id) initExplosionFlashWithPosition: (HPVector) pos
velocity: (Vector) vel
size: (float) size 
implementation

Definition at line 41 of file OOFlashEffectEntity.m.

58 :(HPVector)pos velocity:(Vector)vel size:(float)size
59{
60 if ((self = [self initWithPosition:pos size:size color:[OOColor whiteColor] duration:kExplosionFlashDuration]))
61 {
64 [self setVelocity:vel];
65 }
66 return self;
67}
#define kExplosionFlashDuration
#define kMinExplosionGrowth
#define kExplosionFlashAlpha
voidpf void uLong size
Definition ioapi.h:134

◆ initLaserFlashWithPosition:velocity:color:

- (id) initLaserFlashWithPosition: (HPVector) pos
velocity: (Vector) vel
color: (OOColor *) color 
implementation

Definition at line 41 of file OOFlashEffectEntity.m.

70 :(HPVector)pos velocity:(Vector)vel color:(OOColor *)color
71{
72 if ((self = [self initWithPosition:pos size:kLaserFlashInitialSize color:color duration:kLaserFlashDuration]))
73 {
74 [self setVelocity:vel];
75 _alpha = 1.0f;
76 }
77 return self;
78}
#define kLaserFlashInitialSize
#define kLaserFlashDuration

◆ initWithPosition:size:color:duration:

- (id) initWithPosition: (HPVector) pos
size: (float) size
color: (OOColor *) color
duration: (float) duration 
implementation

Provided by category OOFlashEffectEntity(Private).

Definition at line 41 of file OOFlashEffectEntity.m.

93 :(HPVector)pos size:(float)size color:(OOColor *)color duration:(float)duration
94{
95 if ((self = [super initWithDiameter:size]))
96 {
97 [self setPosition:pos];
98 _duration = duration;
100 [self setColor:color alpha:1.0f];
101 assert([self collisionRadius] == 0 && [self energy] == 0 && magnitude([self velocity]) == 0);
102 }
103 return self;
104}
#define kGrowthRateFactor
GLfloat energy
Definition Entity.h:142

◆ laserFlashWithPosition:velocity:color:

+ (instancetype) laserFlashWithPosition: (HPVector) position
velocity: (Vector) vel
color: (OOColor *) color 

Definition at line 41 of file OOFlashEffectEntity.m.

87 :(HPVector)pos velocity:(Vector)vel color:(OOColor *)color
88{
89 return [[[self alloc] initLaserFlashWithPosition:pos velocity:vel color:color] autorelease];
90}

◆ performUpdate:

- (void) performUpdate: (OOTimeDelta) delta_t
implementation

Provided by category OOFlashEffectEntity(Private).

◆ resetGraphicsState

+ (void) resetGraphicsState
implementation

Reimplemented from OOLightParticleEntity.

Provided by category OOFlashEffectEntity(Private).

Definition at line 41 of file OOFlashEffectEntity.m.

148{
149 [sFlashTexture release];
151}
static OOTexture * sFlashTexture
return nil

◆ setUpTexture

+ (void) setUpTexture

Reimplemented from OOLightParticleEntity.

Definition at line 41 of file OOFlashEffectEntity.m.

134{
135 if (sFlashTexture == nil)
136 {
137 sFlashTexture = [[OOTexture textureWithName:@"oolite-particle-flash.png"
138 inFolder:@"Textures"
139 options:kOOTextureMinFilterMipMap | kOOTextureMagFilterLinear | kOOTextureAlphaMask
140 anisotropy:kOOTextureDefaultAnisotropy
141 lodBias:0.0] retain];
142 [[OOGraphicsResetManager sharedManager] registerClient:(id<OOGraphicsResetClient>)[OOFlashEffectEntity class]];
143 }
144}
void registerClient:(id< OOGraphicsResetClient > client)
OOGraphicsResetManager * sharedManager()
id textureWithName:inFolder:options:anisotropy:lodBias:(NSString *name,[inFolder] NSString *directory,[options] OOTextureFlags options,[anisotropy] GLfloat anisotropy,[lodBias] GLfloat lodBias)
Definition OOTexture.m:134

◆ texture

- (OOTexture *) texture
implementation

Reimplemented from OOLightParticleEntity.

Definition at line 41 of file OOFlashEffectEntity.m.

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from Entity.

Definition at line 41 of file OOFlashEffectEntity.m.

107 :(OOTimeDelta)delta_t
108{
109 [super update:delta_t];
110
111 float tf = _duration * 0.667f;
112 float tf1 = _duration - tf;
113
114 // Scale up.
115 _diameter += delta_t * _growthRate;
116
117 // Fade in and out.
118 OOTimeDelta lifeTime = [self timeElapsedSinceSpawn];
119 _colorComponents[3] = _alpha * ((lifeTime < tf) ? (lifeTime / tf) : (_duration - lifeTime) / tf1);
120
121 // Disappear as necessary.
122 if (lifeTime > _duration) [UNIVERSE removeEntity:self];
123}
double OOTimeDelta
Definition OOTypes.h:224
#define UNIVERSE
Definition Universe.h:840

Member Data Documentation

◆ _alpha

- (float) _alpha
private

Definition at line 36 of file OOFlashEffectEntity.h.

◆ _duration

- (float) _duration
private

Definition at line 34 of file OOFlashEffectEntity.h.

◆ _growthRate

- (float) _growthRate
private

Definition at line 35 of file OOFlashEffectEntity.h.


The documentation for this class was generated from the following files: