Oolite
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]
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
(NSUInteger) - lastDrawCounter
(void) - setLastDrawCounter:
(double) - findCollisionRadius
(BOOL) - isVisible
(BOOL) - isInSpace
(BOOL) - isImmuneToBreakPatternHide
(GLfloat) - universalTime
(GLfloat) - spawnTime
(GLfloat) - timeElapsedSinceSpawn
(void) - setAtmosphereFogging:
(OOColor *) - fogUniform
(id) - init [implementation]
(void) - dealloc [implementation]
(NSString *) - descriptionComponents [implementation]
(BOOL) - checkLinkedLists [implementation]
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
(Vector) - relativePosition [implementation]
(void) - subEntityReallyDied: [implementation]
(BOOL) - isBreakPattern
(BOOL) - isECMBlast
(BOOL) - isExhaust
(BOOL) - isFlasher
(BOOL) - isVisibleToScripts
(BOOL) - isVisibleToScripts
(NSString *) - oo_jsClassName
(NSString *) - oo_jsClassName
(void) - getJSClass:andPrototype:
(void) - deleteJSSelf
(void) - deleteJSSelf
(JSClassID) - oo_jsClassID
(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
OOColor * atmosphereFogging
int zero_index
Entity * x_previous
Entity * x_next
Entity * y_previous
Entity * y_next
Entity * z_previous
Entity * z_next
Entity * collision_chain
OOUniversalID shadingEntityID
Entity * collider
CollisionRegion * collisionRegion
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
NSUInteger lastDrawCounter
Protected Attributes inherited from OOWeakRefObject
OOWeakReference * weakSelf

Detailed Description

Definition at line 30 of file OOFlashEffectEntity.h.

Method Documentation

◆ explosionFlashFromEntity:

+ (instancetype) explosionFlashFromEntity: (Entity*) entity

Definition at line 74 of file OOFlashEffectEntity.m.

74 :(Entity*)entity
75{
76 return [[[self alloc] initExplosionFlashWithPosition:[entity position] velocity:[entity velocity] size:[entity collisionRadius]] autorelease];
77}
GLfloat collisionRadius()
Definition Entity.m:830
HPVector position
Definition Entity.m:576
Vector velocity
Definition Entity.m:708

References Entity::collisionRadius, Entity::position, and Entity::velocity.

Referenced by ShipEntity::becomeExplosion.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initExplosionFlashWithPosition:velocity:size:

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

Definition at line 55 of file OOFlashEffectEntity.m.

55 :(HPVector)pos velocity:(Vector)vel size:(float)size
56{
57 if ((self = [self initWithPosition:pos size:size color:[OOColor whiteColor] duration:kExplosionFlashDuration])) {
60 [self setVelocity:vel];
61 }
62 return self;
63}
#define kExplosionFlashDuration
#define kMinExplosionGrowth
#define kExplosionFlashAlpha
struct HPVector HPVector
struct Vector Vector
voidpf void uLong size
Definition ioapi.h:126

References _alpha, _growthRate, kExplosionFlashAlpha, kExplosionFlashDuration, kMinExplosionGrowth, and Entity::setVelocity:.

Here is the call graph for this function:

◆ initLaserFlashWithPosition:velocity:color:

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

Definition at line 65 of file OOFlashEffectEntity.m.

65 :(HPVector)pos velocity:(Vector)vel color:(OOColor*)color
66{
67 if ((self = [self initWithPosition:pos size:kLaserFlashInitialSize color:color duration:kLaserFlashDuration])) {
68 [self setVelocity:vel];
69 _alpha = 1.0f;
70 }
71 return self;
72}
#define kLaserFlashInitialSize
#define kLaserFlashDuration

References _alpha, kLaserFlashDuration, kLaserFlashInitialSize, and Entity::setVelocity:.

Here is the call graph for this function:

◆ 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 84 of file OOFlashEffectEntity.m.

84 :(HPVector)pos size:(float)size color:(OOColor*)color duration:(float)duration
85{
86 if ((self = [super initWithDiameter:size])) {
87 [self setPosition:pos];
88 _duration = duration;
90 [self setColor:color alpha:1.0f];
91 assert([self collisionRadius] == 0 && [self energy] == 0 && magnitude([self velocity]) == 0);
92 }
93 return self;
94}
#define kGrowthRateFactor
OOINLINE OOScalar magnitude(Vector vec) INLINE_CONST_FUNC
Definition OOVector.h:242
GLfloat energy
Definition Entity.m:753

References kGrowthRateFactor, magnitude(), OOLightParticleEntity::setColor:alpha:, and Entity::setPosition:.

Here is the call graph for this function:

◆ laserFlashWithPosition:velocity:color:

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

Definition at line 79 of file OOFlashEffectEntity.m.

79 :(HPVector)pos velocity:(Vector)vel color:(OOColor*)color
80{
81 return [[[self alloc] initLaserFlashWithPosition:pos velocity:vel color:color] autorelease];
82}

Referenced by Universe::addLaserHitEffectsAt:against:damage:color:.

Here is the caller graph for this function:

◆ 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 134 of file OOFlashEffectEntity.m.

135{
136 [sFlashTexture release];
138}
static OOTexture * sFlashTexture
return nil

References nil, resetGraphicsState, and sFlashTexture.

Referenced by resetGraphicsState.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpTexture

+ (void) setUpTexture

Reimplemented from OOLightParticleEntity.

Definition at line 122 of file OOFlashEffectEntity.m.

123{
124 if (sFlashTexture == nil) {
125 sFlashTexture = [[OOTexture textureWithName:@"oolite-particle-flash.png"
126 inFolder:@"Textures"
127 options:kOOTextureMinFilterMipMap | kOOTextureMagFilterLinear | kOOTextureAlphaMask
128 anisotropy:kOOTextureDefaultAnisotropy
129 lodBias:0.0] retain];
130 [[OOGraphicsResetManager sharedManager] registerClient:(id<OOGraphicsResetClient>)[OOFlashEffectEntity class]];
131 }
132}
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:132

References nil, OOGraphicsResetManager::registerClient:, setUpTexture, sFlashTexture, OOGraphicsResetManager::sharedManager, and OOTexture::textureWithName:inFolder:options:anisotropy:lodBias:.

Referenced by Universe::initWithGameView:, setUpTexture, and texture.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ texture

- (OOTexture *) texture
implementation

Reimplemented from OOLightParticleEntity.

Definition at line 115 of file OOFlashEffectEntity.m.

References nil, setUpTexture, sFlashTexture, and texture.

Referenced by texture.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from Entity.

Definition at line 96 of file OOFlashEffectEntity.m.

96 :(OOTimeDelta)delta_t
97{
98 [super update:delta_t];
99
100 float tf = _duration * 0.667f;
101 float tf1 = _duration - tf;
102
103 // Scale up.
104 _diameter += delta_t * _growthRate;
105
106 // Fade in and out.
107 OOTimeDelta lifeTime = [self timeElapsedSinceSpawn];
108 _colorComponents[3] = _alpha * ((lifeTime < tf) ? (lifeTime / tf) : (_duration - lifeTime) / tf1);
109
110 // Disappear as necessary.
111 if (lifeTime > _duration)
112 [UNIVERSE removeEntity:self];
113}
double OOTimeDelta
Definition OOTypes.h:193
#define UNIVERSE
Definition Universe.h:827

References _alpha, OOLightParticleEntity::_colorComponents, OOLightParticleEntity::_diameter, _duration, _growthRate, Entity::timeElapsedSinceSpawn, and Entity::update:.

Here is the call graph for this function:

Member Data Documentation

◆ _alpha

- (float) _alpha
private

◆ _duration

- (float) _duration
private

Definition at line 32 of file OOFlashEffectEntity.h.

Referenced by update:.

◆ _growthRate

- (float) _growthRate
private

Definition at line 33 of file OOFlashEffectEntity.h.

Referenced by initExplosionFlashWithPosition:velocity:size:, and update:.


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