Oolite
Loading...
Searching...
No Matches
OOVisualEffectEntity Class Reference

#include <OOVisualEffectEntity.h>

Inheritance diagram for OOVisualEffectEntity:
Collaboration diagram for OOVisualEffectEntity:

Instance Methods

(id) - initWithKey:definition:
(BOOL) - setUpVisualEffectFromDictionary:
(OOMesh *) - mesh
(void) - setMesh:
(NSString *) - effectKey
(GLfloat) - frustumRadius
(void) - clearSubEntities
(BOOL) - setUpSubEntities
(void) - removeSubEntity:
(void) - setNoDrawDistance
(NSArray *) - subEntities
(NSUInteger) - subEntityCount
(NSEnumerator *) - visualEffectSubEntityEnumerator
(BOOL) - hasSubEntity:
(NSEnumerator *) - subEntityEnumerator
(NSEnumerator *) - effectSubEntityEnumerator
(NSEnumerator *) - flasherEnumerator
(void) - orientationChanged
(Vector) - forwardVector
(Vector) - rightVector
(Vector) - upVector
(OOColor *) - scannerDisplayColor1
(OOColor *) - scannerDisplayColor2
(void) - setScannerDisplayColor1:
(void) - setScannerDisplayColor2:
(GLfloat *) - scannerDisplayColorForShip:scannerDisplayColor1:scannerDisplayColor2:
(void) - setScript:
(OOJSScript *) - script
(NSDictionary *) - scriptInfo
(void) - doScriptEvent:
(void) - remove
(GLfloat) - scaleMax
(GLfloat) - scaleX
(void) - setScaleX:
(GLfloat) - scaleY
(void) - setScaleY:
(GLfloat) - scaleZ
(void) - setScaleZ:
(GLfloat) - hullHeatLevel
(void) - setHullHeatLevel:
(GLfloat) - shaderFloat1
(void) - setShaderFloat1:
(GLfloat) - shaderFloat2
(void) - setShaderFloat2:
(int) - shaderInt1
(void) - setShaderInt1:
(int) - shaderInt2
(void) - setShaderInt2:
(Vector) - shaderVector1
(void) - setShaderVector1:
(Vector) - shaderVector2
(void) - setShaderVector2:
(BOOL) - isBreakPattern
(void) - setIsBreakPattern:
(NSDictionary *) - effectInfoDictionary
(id) - init [implementation]
(void) - dealloc [implementation]
(BOOL) - isEffect [implementation]
(BOOL) - isVisualEffect [implementation]
(BOOL) - canCollide [implementation]
(BOOL) - setUpOneSubentity: [implementation]
(BOOL) - setUpOneFlasher: [implementation]
(BOOL) - setUpOneStandardSubentity: [implementation]
(void) - addSubEntity: [implementation]
(void) - drawSubEntityImmediate:translucent: [implementation]
(void) - rescaleBy: [implementation]
(void) - rescaleBy:writeToCache: [implementation]
(GLfloat) - collisionRadius [implementation]
(void) - drawImmediate:translucent: [implementation]
(void) - update: [implementation]
(NSComparisonResult) - compareBeaconCodeWith: [implementation]
(NSString *) - beaconCode [implementation]
(void) - setBeaconCode: [implementation]
(NSString *) - beaconLabel [implementation]
(void) - setBeaconLabel: [implementation]
(BOOL) - isBeacon [implementation]
(id< OOHUDBeaconIcon >) - beaconDrawable [implementation]
(Entity< OOBeaconEntity > *) - prevBeacon [implementation]
(Entity< OOBeaconEntity > *) - nextBeacon [implementation]
(void) - setPrevBeacon: [implementation]
(void) - setNextBeacon: [implementation]
(BOOL) - isJammingScanning [implementation]
(void) - getJSClass:andPrototype:
(NSString *) - oo_jsClassName
(NSString *) - oo_jsClassName
(BOOL) - isVisibleToScripts
(BOOL) - isVisibleToScripts
(NSArray *) - subEntitiesForScript
(NSArray *) - subEntitiesForScript
(JSClassID) - oo_jsClassID
(BOOL) - isShipWithSubEntityShip: [implementation]
Instance Methods inherited from OOEntityWithDrawable
(OODrawable *) - drawable
(void) - setDrawable:
(double) - findCollisionRadius [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) - 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) - 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
(void) - setCollisionRadius:
(NSMutableArray *) - collisionArray
(void) - applyVelocity:
(BOOL) - checkCloseCollisionWith:
(void) - takeEnergyDamage:from:becauseOf:weaponIdentifier:
(void) - dumpState
(void) - dumpSelfState
(NSUInteger) - lastDrawCounter
(void) - setLastDrawCounter:
(BOOL) - isVisible
(BOOL) - isInSpace
(BOOL) - isImmuneToBreakPatternHide
(GLfloat) - universalTime
(GLfloat) - spawnTime
(GLfloat) - timeElapsedSinceSpawn
(void) - setAtmosphereFogging:
(OOColor *) - fogUniform
(NSString *) - descriptionComponents [implementation]
(BOOL) - checkLinkedLists [implementation]
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
(Vector) - relativePosition [implementation]
(void) - subEntityReallyDied: [implementation]
(BOOL) - isECMBlast
(BOOL) - isExhaust
(BOOL) - isFlasher
(void) - deleteJSSelf
(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]
Instance Methods inherited from OOWeakRefObject
(id) - weakSelf
(id) - weakRetain [implementation]
(void) - weakRefDied: [implementation]
Instance Methods inherited from <OOWeakReferenceSupport>
(id) - OO_RETURNS_RETAINED

Private Attributes

NSMutableArray * subEntities
NSDictionary * effectinfoDictionary
GLfloat _profileRadius
OOColor * scanner_display_color1
OOColor * scanner_display_color2
GLfloat _hullHeatLevel
GLfloat _shaderFloat1
GLfloat _shaderFloat2
int _shaderInt1
int _shaderInt2
Vector _shaderVector1
Vector _shaderVector2
Vector _v_forward
Vector _v_up
Vector _v_right
OOJSScript * script
NSDictionary * scriptInfo
NSString * _effectKey
BOOL _haveExecutedSpawnAction
NSString * _beaconCode
NSString * _beaconLabel
OOWeakReference * _prevBeacon
OOWeakReference * _nextBeacon
id< OOHUDBeaconIcon > _beaconDrawable
GLfloat scaleX
GLfloat scaleY
GLfloat scaleZ

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 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 37 of file OOVisualEffectEntity.h.

Method Documentation

◆ addSubEntity:

- (void) addSubEntity: (Entity<OOSubEntity>*) sub
implementation

Provided by category OOVisualEffectEntity(Private).

Definition at line 304 of file OOVisualEffectEntity.m.

304 :(Entity<OOSubEntity>*)sub
305{
306 if (sub == nil)
307 return;
308
309 if (subEntities == nil)
310 subEntities = [[NSMutableArray alloc] init];
311 sub->isSubEntity = YES;
312 // Order matters - need consistent state in setOwner:. -- Ahruman 2008-04-20
313 [subEntities addObject:sub];
314 [sub setOwner:self];
315
316 double distance = HPmagnitude([sub position]) + [sub findCollisionRadius];
317 if (distance > _profileRadius) {
319 }
320}
OOINLINE OOHPScalar HPmagnitude(HPVector vec) INLINE_CONST_FUNC
Definition OOHPVector.h:260
return nil
OOINLINE OOScalar distance(Vector v1, Vector v2) INLINE_CONST_FUNC
Definition OOVector.h:280
unsigned isSubEntity
Definition Entity.m:140
void setOwner:(Entity *ent)
Definition Entity.m:542
HPVector position
Definition Entity.m:576
double findCollisionRadius()
Definition Entity.m:888

References distance(), HPmagnitude(), Entity::isSubEntity, and nil.

Referenced by OOVisualEffectEntity(Private)::setUpOneFlasher:, and OOVisualEffectEntity(Private)::setUpOneStandardSubentity:.

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

◆ beaconCode

- (NSString *) beaconCode
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 677 of file OOVisualEffectEntity.m.

678{
679 return _beaconCode;
680}

References _beaconCode, and beaconCode.

Referenced by beaconCode, beaconDrawable, compareBeaconCodeWith:, isBeacon, setUpVisualEffectFromDictionary:, VisualEffectGetProperty(), and VisualEffectGetProperty().

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

◆ beaconDrawable

- (id< OOHUDBeaconIcon >) beaconDrawable
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 720 of file OOVisualEffectEntity.m.

721{
722 if (_beaconDrawable == nil) {
723 NSString* beaconCode = [self beaconCode];
724 NSUInteger length = [beaconCode length];
725
726 if (length > 1) {
727 NSArray* iconData = [[UNIVERSE descriptions] oo_arrayForKey:beaconCode];
728 if (iconData != nil)
729 _beaconDrawable = [[OOPolygonSprite alloc] initWithDataArray:iconData outlineWidth:0.5 name:beaconCode];
730 }
731
732 if (_beaconDrawable == nil) {
733 if (length > 0)
734 _beaconDrawable = [[beaconCode substringToIndex:1] retain];
735 else
736 _beaconDrawable = @"";
737 }
738 }
739
740 return _beaconDrawable;
741}
id< OOHUDBeaconIcon > _beaconDrawable

References _beaconDrawable, beaconCode, beaconDrawable, and nil.

Referenced by beaconDrawable.

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

◆ beaconLabel

- (NSString *) beaconLabel
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 699 of file OOVisualEffectEntity.m.

700{
701 return _beaconLabel;
702}

References _beaconLabel, and beaconLabel.

Referenced by beaconLabel, VisualEffectGetProperty(), and VisualEffectGetProperty().

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

◆ canCollide

- (BOOL) canCollide
implementation

Reimplemented from Entity.

Definition at line 185 of file OOVisualEffectEntity.m.

186{
187 return NO;
188}

References canCollide.

Referenced by canCollide.

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

◆ clearSubEntities

- (void) clearSubEntities

Definition at line 212 of file OOVisualEffectEntity.m.

213{
214 [subEntities makeObjectsPerformSelector:@selector(setOwner:) withObject:nil]; // Ensure backlinks are broken
215 [subEntities release];
217
218 // reset size & mass!
219 if ([self mesh]) {
220 collision_radius = [self findCollisionRadius];
221 } else {
222 collision_radius = 0.0;
223 }
225}
GLfloat collision_radius
Definition Entity.h:107

References _profileRadius, clearSubEntities, Entity::collision_radius, OOEntityWithDrawable::findCollisionRadius, mesh, nil, and subEntities.

Referenced by clearSubEntities, dealloc, setUpVisualEffectFromDictionary:, VisualEffectRestoreSubEntities(), and VisualEffectRestoreSubEntities().

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

◆ collisionRadius

- (GLfloat) collisionRadius
implementation

Reimplemented from Entity.

Definition at line 487 of file OOVisualEffectEntity.m.

488{
489 return [self scaleMax] * collision_radius;
490}

References Entity::collision_radius, collisionRadius, and scaleMax.

Referenced by collisionRadius.

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

◆ compareBeaconCodeWith:

- (NSComparisonResult) compareBeaconCodeWith: (Entity<OOBeaconEntity>*) other
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 672 of file OOVisualEffectEntity.m.

672 :(Entity<OOBeaconEntity>*)other
673{
674 return [[self beaconCode] compare:[other beaconCode] options:NSCaseInsensitiveSearch];
675}

References beaconCode.

Here is the call graph for this function:

◆ dealloc

- (void) dealloc
implementation

Reimplemented from OOEntityWithDrawable.

Definition at line 159 of file OOVisualEffectEntity.m.

160{
161 [self clearSubEntities];
171
172 [super dealloc];
173}
#define DESTROY(x)
NSDictionary * effectinfoDictionary

References _beaconCode, _beaconDrawable, _beaconLabel, _effectKey, clearSubEntities, OOEntityWithDrawable::dealloc, dealloc, DESTROY, effectinfoDictionary, scanner_display_color1, scanner_display_color2, script, and scriptInfo.

Referenced by dealloc.

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

◆ doScriptEvent:

- (void) doScriptEvent: (OOJSPropID) message

Definition at line 657 of file OOVisualEffectEntity.m.

657 :(OOJSPropID)message
658{
659 JSContext* context = OOJSAcquireContext();
660 [script callMethod:message inContext:context withArguments:NULL count:0 result:NULL];
661 OOJSRelinquishContext(context);
662}
jsid OOJSPropID
Definition OOJSPropID.h:31
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)

References OOJSScript::callMethod:inContext:withArguments:count:result:, OOJSAcquireContext(), and OOJSRelinquishContext().

Referenced by remove, and update:.

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

◆ drawImmediate:translucent:

- (void) drawImmediate: (bool) immediate
translucent: (bool) translucent 
implementation

Reimplemented from OOEntityWithDrawable.

Definition at line 575 of file OOVisualEffectEntity.m.

575 :(bool)immediate translucent:(bool)translucent
576{
578 return; // too far away to draw
579 }
582
583 if ([self mesh] != nil) {
584 [super drawImmediate:immediate translucent:translucent];
585 }
587
588 // Draw subentities.
589 if (!immediate) // TODO: is this relevant any longer?
590 {
591 Entity<OOSubEntity>* subEntity = nil;
592 foreach (subEntity, [self subEntities]) {
593 [subEntity drawSubEntityImmediate:immediate translucent:translucent];
594 }
595 }
596}
void OOGLScaleModelView(Vector scale)
void OOGLPushModelView(void)
OOMatrix OOGLPopModelView(void)
OOINLINE Vector make_vector(OOScalar vx, OOScalar vy, OOScalar vz) INLINE_CONST_FUNC
Definition OOVector.h:149
void drawSubEntityImmediate:translucent:(bool immediate, [translucent] bool translucent)
GLfloat cam_zero_distance
Definition Entity.h:105
GLfloat no_draw_distance
Definition Entity.h:106

References Entity::cam_zero_distance, OOEntityWithDrawable::drawImmediate:translucent:, Entity::drawSubEntityImmediate:translucent:, make_vector(), mesh, nil, Entity::no_draw_distance, OOGLPopModelView(), OOGLPushModelView(), OOGLScaleModelView(), scaleX, scaleY, scaleZ, and subEntities.

Referenced by OOVisualEffectEntity(Private)::drawSubEntityImmediate:translucent:.

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

◆ drawSubEntityImmediate:translucent:

- (void) drawSubEntityImmediate: (bool) immediate
translucent: (bool) translucent 
implementation

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(Private).

Definition at line 357 of file OOVisualEffectEntity.m.

357 :(bool)immediate translucent:(bool)translucent
358{
359 if (cam_zero_distance > no_draw_distance) // this test provides an opportunity to do simple LoD culling
360 {
361 return; // TOO FAR AWAY
362 }
364 // HPVect: camera position
367 [self drawImmediate:immediate translucent:translucent];
368
370}
OOINLINE Vector HPVectorToVector(HPVector v) INLINE_CONST_FUNC
Definition OOHPVector.h:175
void OOGLTranslateModelView(Vector vector)
void OOGLMultModelView(OOMatrix matrix)
OOMatrix rotMatrix
Definition Entity.h:134

References drawImmediate:translucent:, HPVectorToVector(), OOGLMultModelView(), OOGLPopModelView(), OOGLPushModelView(), and OOGLTranslateModelView().

Here is the call graph for this function:

◆ effectInfoDictionary

- (NSDictionary *) effectInfoDictionary

Definition at line 623 of file OOVisualEffectEntity.m.

624{
626}

References effectInfoDictionary, and effectinfoDictionary.

Referenced by effectInfoDictionary, scaleZ, VisualEffectSetMaterialsInternal(), and VisualEffectSetMaterialsInternal().

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

◆ effectKey

- (NSString *) effectKey

Definition at line 202 of file OOVisualEffectEntity.m.

203{
204 return _effectKey;
205}

References _effectKey, and effectKey.

Referenced by effectKey, VisualEffectGetProperty(), and VisualEffectGetProperty().

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

◆ effectSubEntityEnumerator

- (NSEnumerator *) effectSubEntityEnumerator

Definition at line 347 of file OOVisualEffectEntity.m.

348{
349 return [[self subEntities] objectEnumeratorFilteredWithSelector:@selector(isVisualEffect)];
350}

References effectSubEntityEnumerator, and subEntities.

Referenced by effectSubEntityEnumerator, and subEntities.

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

◆ flasherEnumerator

- (NSEnumerator *) flasherEnumerator

Definition at line 352 of file OOVisualEffectEntity.m.

353{
354 return [[self subEntities] objectEnumeratorFilteredWithSelector:@selector(isFlasher)];
355}

References flasherEnumerator, and subEntities.

Referenced by flasherEnumerator, and subEntities.

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

◆ forwardVector

- (Vector) forwardVector

Definition at line 502 of file OOVisualEffectEntity.m.

503{
504 return _v_forward;
505}

References _v_forward, and forwardVector.

Referenced by forwardVector, and subEntities.

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

◆ frustumRadius

- (GLfloat) frustumRadius

Reimplemented from Entity.

Definition at line 207 of file OOVisualEffectEntity.m.

208{
209 return [self scaleMax] * _profileRadius;
210}

References _profileRadius, frustumRadius, and scaleMax.

Referenced by OOEntityWithDrawable::drawImmediate:translucent:, and frustumRadius.

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

◆ getJSClass:andPrototype:

- (void) getJSClass: (JSClass**) outClass
andPrototype: (JSObject**) outPrototype 

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(OOJavaScriptExtensions).

Definition at line 165 of file OOJSVisualEffect.m.

165 :(JSClass**)outClass andPrototype:(JSObject**)outPrototype
166{
167 *outClass = &sVisualEffectClass;
168 *outPrototype = sVisualEffectPrototype;
169}
static JSObject * sVisualEffectPrototype
static JSClass sVisualEffectClass

◆ hasSubEntity:

- (BOOL) hasSubEntity: (Entity<OOSubEntity>*) sub

Definition at line 337 of file OOVisualEffectEntity.m.

337 :(Entity<OOSubEntity>*)sub
338{
339 return [subEntities containsObject:sub];
340}

◆ hullHeatLevel

- (GLfloat) hullHeatLevel

Definition at line 777 of file OOVisualEffectEntity.m.

778{
779 return _hullHeatLevel;
780}

References _hullHeatLevel, and hullHeatLevel.

Referenced by hullHeatLevel, and scaleZ.

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

◆ init

- (id) init
implementation

Reimplemented from Entity.

Definition at line 69 of file OOVisualEffectEntity.m.

70{
71 return [self initWithKey:@"" definition:nil];
72}

References init, and initWithKey:definition:.

Referenced by init.

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

◆ initWithKey:definition:

- (id) initWithKey: (NSString*) key
definition: (NSDictionary*) dict 

Definition at line 74 of file OOVisualEffectEntity.m.

74 :(NSString*)key definition:(NSDictionary*)dict
75{
77
78 NSParameterAssert(dict != nil);
79
80 self = [super init];
81 if (self == nil)
82 return nil;
83
84 _effectKey = [key retain];
85
86 if (![self setUpVisualEffectFromDictionary:dict]) {
87 [self release];
88 self = nil;
89 }
90
92
93 return self;
94
96}
#define OOJS_PROFILE_EXIT
#define OOJS_PROFILE_ENTER

References _effectKey, _haveExecutedSpawnAction, Entity::init, nil, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.

Referenced by init.

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

◆ isBeacon

- (BOOL) isBeacon
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 715 of file OOVisualEffectEntity.m.

716{
717 return [self beaconCode] != nil;
718}

References beaconCode, isBeacon, and nil.

Referenced by isBeacon.

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

◆ isBreakPattern

- (BOOL) isBreakPattern

Reimplemented from Entity.

Definition at line 613 of file OOVisualEffectEntity.m.

614{
616}
unsigned isImmuneToBreakPatternHide
Definition Entity.m:1050

References isBreakPattern, and Entity::isImmuneToBreakPatternHide.

Referenced by isBreakPattern, and scaleZ.

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

◆ isEffect

- (BOOL) isEffect
implementation

Reimplemented from Entity.

Definition at line 175 of file OOVisualEffectEntity.m.

176{
177 return YES;
178}

References isEffect.

Referenced by isEffect.

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

◆ isJammingScanning

- (BOOL) isJammingScanning
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 769 of file OOVisualEffectEntity.m.

770{
771 return NO;
772}

References isJammingScanning.

Referenced by isJammingScanning.

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

◆ isShipWithSubEntityShip:

- (BOOL) isShipWithSubEntityShip: (Entity*) other
implementation

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(SubEntityRelationship).

Definition at line 852 of file OOVisualEffectEntity.m.

852 :(Entity*)other
853{
854 assert([self isVisualEffect]);
855
856 if (![other isVisualEffect])
857 return NO;
858 if (![other isSubEntity])
859 return NO;
860 if ([other owner] != self)
861 return NO;
862
863#ifndef NDEBUG
864 // Sanity check; this should always be true.
865 if (![self hasSubEntity:(OOVisualEffectEntity*)other]) {
866 OOLogERR(@"visualeffect.subentity.sanityCheck.failed", @"%@ thinks it's a subentity of %@, but the supposed parent does not agree. %@", [other shortDescription], [self shortDescription], @"This is an internal error, please report it.");
867 [other setOwner:nil];
868 return NO;
869 }
870#endif
871
872 return YES;
873}
#define OOLogERR(class, format,...)
Definition OOLogging.h:125
id owner()
Definition Entity.m:548

◆ isVisibleToScripts [1/2]

- (BOOL) isVisibleToScripts

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(OOJavaScriptExtensions).

Definition at line 174 of file OOJSVisualEffect.m.

175{
176 return YES;
177}

◆ isVisibleToScripts [2/2]

- (BOOL) isVisibleToScripts

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(OOJavaScriptExtensions).

◆ isVisualEffect

- (BOOL) isVisualEffect
implementation

Reimplemented from Entity.

Definition at line 180 of file OOVisualEffectEntity.m.

181{
182 return YES;
183}

References isVisualEffect.

Referenced by isVisualEffect, setScaleX:, setScaleY:, and setScaleZ:.

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

◆ mesh

- (OOMesh *) mesh

Definition at line 190 of file OOVisualEffectEntity.m.

191{
192 return (OOMesh*)[self drawable];
193}

References OOEntityWithDrawable::drawable, and mesh.

Referenced by clearSubEntities, drawImmediate:translucent:, mesh, rescaleBy:, setMesh:, setUpVisualEffectFromDictionary:, VisualEffectGetMaterials(), VisualEffectGetMaterials(), VisualEffectGetShaders(), VisualEffectGetShaders(), VisualEffectSetMaterialsInternal(), and VisualEffectSetMaterialsInternal().

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

◆ nextBeacon

- (Entity< OOBeaconEntity > *) nextBeacon
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 748 of file OOVisualEffectEntity.m.

749{
750 return [_nextBeacon weakRefUnderlyingObject];
751}

References nextBeacon, and OOWeakReference::weakRefUnderlyingObject.

Referenced by nextBeacon, and setNextBeacon:.

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

◆ oo_jsClassID

- (JSClassID) oo_jsClassID

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(OOJavaScriptExtensions).

Definition at line 164 of file OOJSVisualEffect.m.

165{
167}
static JSClassID sVisualEffectClassID

◆ oo_jsClassName [1/2]

- (NSString *) oo_jsClassName

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(OOJavaScriptExtensions).

Definition at line 169 of file OOJSVisualEffect.m.

170{
171 return @"VisualEffect";
172}

◆ oo_jsClassName [2/2]

- (NSString *) oo_jsClassName

Reimplemented from Entity.

Provided by category OOVisualEffectEntity(OOJavaScriptExtensions).

◆ orientationChanged

- (void) orientationChanged

Reimplemented from Entity.

Definition at line 492 of file OOVisualEffectEntity.m.

493{
494 [super orientationChanged];
495
499}
Vector vector_forward_from_quaternion(Quaternion quat) CONST_FUNC
Vector vector_up_from_quaternion(Quaternion quat) CONST_FUNC
Vector vector_right_from_quaternion(Quaternion quat) CONST_FUNC
Quaternion orientation
Definition Entity.m:682

References _v_forward, _v_right, _v_up, Entity::orientation, Entity::orientationChanged, orientationChanged, vector_forward_from_quaternion(), vector_right_from_quaternion(), and vector_up_from_quaternion().

Referenced by orientationChanged, and subEntities.

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

◆ prevBeacon

- (Entity< OOBeaconEntity > *) prevBeacon
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 743 of file OOVisualEffectEntity.m.

744{
745 return [_prevBeacon weakRefUnderlyingObject];
746}

References prevBeacon, and OOWeakReference::weakRefUnderlyingObject.

Referenced by prevBeacon, and setPrevBeacon:.

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

◆ remove

- (void) remove

Definition at line 664 of file OOVisualEffectEntity.m.

665{
666 [self doScriptEvent:OOJSID("effectRemoved")];
667 [UNIVERSE removeEntity:(Entity*)self];
668}

References doScriptEvent:, and remove.

Referenced by remove, Universe::removeAllEntitiesExceptPlayer, scriptInfo, VisualEffectRemove(), and VisualEffectRemove().

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

◆ removeSubEntity:

- (void) removeSubEntity: (Entity<OOSubEntity>*) sub

Definition at line 242 of file OOVisualEffectEntity.m.

242 :(Entity<OOSubEntity>*)sub
243{
244 [sub setOwner:nil];
245 [subEntities removeObject:sub];
246}

Referenced by FlasherRemove(), FlasherRemove(), VisualEffectRemove(), and VisualEffectRemove().

Here is the caller graph for this function:

◆ rescaleBy:

- (void) rescaleBy: (GLfloat) factor
implementation

Reimplemented from <OOSubEntity>.

Definition at line 372 of file OOVisualEffectEntity.m.

372 :(GLfloat)factor
373{
374 if ([self mesh] != nil) {
375 [self setMesh:[[self mesh] meshRescaledBy:factor]];
376 }
377
378 // rescale subentities
379 Entity<OOSubEntity>* se = nil;
380 foreach (se, [self subEntities]) {
381 [se setPosition:HPvector_multiply_scalar([se position], factor)];
382 [se rescaleBy:factor];
383 }
384
385 collision_radius *= factor;
386 _profileRadius *= factor;
387}
void setPosition:(HPVector posn)
Definition Entity.m:608

References _profileRadius, Entity::collision_radius, mesh, OOMesh::meshRescaledBy:, nil, Entity::position, setMesh:, Entity::setPosition:, and subEntities.

Here is the call graph for this function:

◆ rescaleBy:writeToCache:

- (void) rescaleBy: (GLfloat) factor
writeToCache: (BOOL) writeToCache 
implementation

Reimplemented from <OOSubEntity>.

Definition at line 389 of file OOVisualEffectEntity.m.

389 :(GLfloat)factor writeToCache:(BOOL)writeToCache
390{
391 /* Do nothing; this is only needed because of OOEntityWithDrawable
392 implementation requirements */
393}

◆ rightVector

- (Vector) rightVector

Definition at line 514 of file OOVisualEffectEntity.m.

515{
516 return _v_right;
517}

References _v_right, and rightVector.

Referenced by rightVector, and subEntities.

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

◆ scaleMax

- (GLfloat) scaleMax

Definition at line 395 of file OOVisualEffectEntity.m.

396{
397 GLfloat scale = 1.0;
398 if (scaleX > scaleY) {
399 if (scaleX > scaleZ) {
400 scale *= scaleX;
401 } else {
402 scale *= scaleZ;
403 }
404 } else if (scaleY > scaleZ) {
405 scale *= scaleY;
406 } else {
407 scale *= scaleZ;
408 }
409 return scale;
410}

References scaleMax, scaleX, scaleY, and scaleZ.

Referenced by collisionRadius, frustumRadius, scaleMax, scriptInfo, and setNoDrawDistance.

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

◆ scaleX

- (GLfloat) scaleX

References scaleX.

◆ scaleY

- (GLfloat) scaleY

References scaleY.

◆ scaleZ

- (GLfloat) scaleZ

References effectInfoDictionary, hullHeatLevel, int(), isBreakPattern, scaleZ, shaderFloat1, shaderFloat2, shaderInt1, shaderInt2, shaderVector1, and shaderVector2.

Here is the call graph for this function:

◆ scannerDisplayColor1

- (OOColor *) scannerDisplayColor1

Definition at line 519 of file OOVisualEffectEntity.m.

520{
521 return [[scanner_display_color1 retain] autorelease];
522}

References scannerDisplayColor1.

Referenced by HeadUpDisplay(Private)::drawScanner:, scannerDisplayColor1, scannerDisplayColorForShip:scannerDisplayColor1:scannerDisplayColor2:, subEntities, VisualEffectGetProperty(), and VisualEffectGetProperty().

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

◆ scannerDisplayColor2

- (OOColor *) scannerDisplayColor2

Definition at line 524 of file OOVisualEffectEntity.m.

525{
526 return [[scanner_display_color2 retain] autorelease];
527}

References scannerDisplayColor2.

Referenced by HeadUpDisplay(Private)::drawScanner:, scannerDisplayColor2, scannerDisplayColorForShip:scannerDisplayColor1:scannerDisplayColor2:, subEntities, VisualEffectGetProperty(), and VisualEffectGetProperty().

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

◆ scannerDisplayColorForShip:scannerDisplayColor1:scannerDisplayColor2:

- (GLfloat *) scannerDisplayColorForShip: (BOOL) flash
scannerDisplayColor1: (OOColor*) scannerDisplayColor1
scannerDisplayColor2: (OOColor*) scannerDisplayColor2 

Definition at line 550 of file OOVisualEffectEntity.m.

551{
552
555 [scannerDisplayColor1 getRed:&scripted_color[0] green:&scripted_color[1] blue:&scripted_color[2] alpha:&scripted_color[3]];
556 }
557
559 [scannerDisplayColor2 getRed:&scripted_color[0] green:&scripted_color[1] blue:&scripted_color[2] alpha:&scripted_color[3]];
560 }
561
563 if (flash)
564 [scannerDisplayColor1 getRed:&scripted_color[0] green:&scripted_color[1] blue:&scripted_color[2] alpha:&scripted_color[3]];
565 else
566 [scannerDisplayColor2 getRed:&scripted_color[0] green:&scripted_color[1] blue:&scripted_color[2] alpha:&scripted_color[3]];
567 }
568
569 return scripted_color;
570 }
571
572 return default_color; // transparent black if not specified
573}
static GLfloat scripted_color[4]
static GLfloat default_color[4]
void getRed:green:blue:alpha:(float *red,[green] float *green,[blue] float *blue,[alpha] float *alpha)
Definition OOColor.m:344

References default_color, OOColor::getRed:green:blue:alpha:, scannerDisplayColor1, scannerDisplayColor2, and scripted_color.

Referenced by HeadUpDisplay(Private)::drawScanner:.

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

◆ script

References script.

◆ scriptInfo

- (NSDictionary *) scriptInfo

References remove, scaleMax, and scriptInfo.

Here is the call graph for this function:

◆ setBeaconCode:

- (void) setBeaconCode: (NSString*) bcode
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 682 of file OOVisualEffectEntity.m.

682 :(NSString*)bcode
683{
684 if ([bcode length] == 0)
685 bcode = nil;
686
687 if (_beaconCode != bcode) {
688 [_beaconCode release];
689 _beaconCode = [bcode copy];
690
692 }
693 // if not blanking code and label is currently blank, default label to code
694 if (bcode != nil && (_beaconLabel == nil || [_beaconLabel length] == 0)) {
695 [self setBeaconLabel:bcode];
696 }
697}

References _beaconCode, _beaconDrawable, _beaconLabel, DESTROY, nil, and setBeaconLabel:.

Referenced by setUpVisualEffectFromDictionary:, VisualEffectSetProperty(), and VisualEffectSetProperty().

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

◆ setBeaconLabel:

- (void) setBeaconLabel: (NSString*) blabel
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 704 of file OOVisualEffectEntity.m.

704 :(NSString*)blabel
705{
706 if ([blabel length] == 0)
707 blabel = nil;
708
709 if (_beaconLabel != blabel) {
710 [_beaconLabel release];
711 _beaconLabel = [OOExpand(blabel) retain];
712 }
713}

References _beaconLabel, and nil.

Referenced by setBeaconCode:, setUpVisualEffectFromDictionary:, VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setHullHeatLevel:

- (void) setHullHeatLevel: (GLfloat) value

Definition at line 782 of file OOVisualEffectEntity.m.

782 :(GLfloat)value
783{
785}
OOINLINE float OOClamp_0_1_f(float value) INLINE_CONST_FUNC

References _hullHeatLevel, and OOClamp_0_1_f().

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

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

◆ setIsBreakPattern:

- (void) setIsBreakPattern: (BOOL) bp

Definition at line 618 of file OOVisualEffectEntity.m.

618 :(BOOL)bp
619{
621}

References Entity::isImmuneToBreakPatternHide.

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setMesh:

- (void) setMesh: (OOMesh*) mesh

Definition at line 195 of file OOVisualEffectEntity.m.

195 :(OOMesh*)mesh
196{
197 if (mesh != [self mesh]) {
198 [self setDrawable:mesh];
199 }
200}

References mesh, and OOEntityWithDrawable::setDrawable:.

Referenced by rescaleBy:, setUpVisualEffectFromDictionary:, VisualEffectSetMaterialsInternal(), and VisualEffectSetMaterialsInternal().

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

◆ setNextBeacon:

- (void) setNextBeacon: (Entity<OOBeaconEntity>*) beaconShip
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 761 of file OOVisualEffectEntity.m.

761 :(Entity<OOBeaconEntity>*)beaconShip
762{
763 if (beaconShip != [self nextBeacon]) {
764 [_nextBeacon release];
765 _nextBeacon = [beaconShip weakRetain];
766 }
767}
Entity< OOBeaconEntity > * nextBeacon()
OOWeakReference * _nextBeacon

References _nextBeacon, and nextBeacon.

Here is the call graph for this function:

◆ setNoDrawDistance

- (void) setNoDrawDistance

Definition at line 248 of file OOVisualEffectEntity.m.

249{
250 GLfloat r = _profileRadius * [self scaleMax];
252}
#define NO_DRAW_DISTANCE_FACTOR
Definition Entity.h:49

References _profileRadius, Entity::no_draw_distance, NO_DRAW_DISTANCE_FACTOR, scaleMax, and setNoDrawDistance.

Referenced by setNoDrawDistance, setScaleX:, setScaleY:, setScaleZ:, and setUpSubEntities.

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

◆ setPrevBeacon:

- (void) setPrevBeacon: (Entity<OOBeaconEntity>*) beaconShip
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 753 of file OOVisualEffectEntity.m.

753 :(Entity<OOBeaconEntity>*)beaconShip
754{
755 if (beaconShip != [self prevBeacon]) {
756 [_prevBeacon release];
757 _prevBeacon = [beaconShip weakRetain];
758 }
759}
OOWeakReference * _prevBeacon
Entity< OOBeaconEntity > * prevBeacon()

References _prevBeacon, and prevBeacon.

Here is the call graph for this function:

◆ setScaleX:

- (void) setScaleX: (GLfloat) factor

Definition at line 417 of file OOVisualEffectEntity.m.

417 :(GLfloat)factor
418{
419 // rescale subentities
420 Entity<OOSubEntity>* se = nil;
421 GLfloat flasher_factor = pow(factor / scaleX, 1.0 / 3.0);
422 foreach (se, [self subEntities]) {
423 HPVector move = [se position];
424 move.x *= factor / scaleX;
425 [se setPosition:move];
426 if ([se isVisualEffect]) {
428 } else {
429 [se rescaleBy:flasher_factor];
430 }
431 }
432
433 scaleX = factor;
434 [self setNoDrawDistance];
435}
struct HPVector HPVector
void setScaleX:(GLfloat factor)
OOHPScalar x
Definition OOHPVector.h:36

References isVisualEffect, nil, Entity::position, scaleX, setNoDrawDistance, Entity::setPosition:, setScaleX:, subEntities, and HPVector::x.

Referenced by setScaleX:, VisualEffectScale(), VisualEffectScale(), VisualEffectSetProperty(), and VisualEffectSetProperty().

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

◆ setScaleY:

- (void) setScaleY: (GLfloat) factor

Definition at line 442 of file OOVisualEffectEntity.m.

442 :(GLfloat)factor
443{
444 // rescale subentities
445 Entity<OOSubEntity>* se = nil;
446 GLfloat flasher_factor = pow(factor / scaleY, 1.0 / 3.0);
447 foreach (se, [self subEntities]) {
448 HPVector move = [se position];
449 move.y *= factor / scaleY;
450 [se setPosition:move];
451 if ([se isVisualEffect]) {
453 } else {
454 [se rescaleBy:flasher_factor];
455 }
456 }
457
458 scaleY = factor;
459 [self setNoDrawDistance];
460}
void setScaleY:(GLfloat factor)
OOHPScalar y
Definition OOHPVector.h:37

References isVisualEffect, nil, Entity::position, scaleY, setNoDrawDistance, Entity::setPosition:, setScaleY:, subEntities, and HPVector::y.

Referenced by setScaleY:, VisualEffectScale(), VisualEffectScale(), VisualEffectSetProperty(), and VisualEffectSetProperty().

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

◆ setScaleZ:

- (void) setScaleZ: (GLfloat) factor

Definition at line 467 of file OOVisualEffectEntity.m.

467 :(GLfloat)factor
468{
469 // rescale subentities
470 Entity<OOSubEntity>* se = nil;
471 GLfloat flasher_factor = pow(factor / scaleZ, 1.0 / 3.0);
472 foreach (se, [self subEntities]) {
473 HPVector move = [se position];
474 move.z *= factor / scaleZ;
475 [se setPosition:move];
476 if ([se isVisualEffect]) {
478 } else {
479 [se rescaleBy:flasher_factor];
480 }
481 }
482
483 scaleZ = factor;
484 [self setNoDrawDistance];
485}
void setScaleZ:(GLfloat factor)
OOHPScalar z
Definition OOHPVector.h:38

References isVisualEffect, nil, Entity::position, scaleZ, setNoDrawDistance, Entity::setPosition:, setScaleZ:, subEntities, and HPVector::z.

Referenced by setScaleZ:, VisualEffectScale(), VisualEffectScale(), VisualEffectSetProperty(), and VisualEffectSetProperty().

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

◆ setScannerDisplayColor1:

- (void) setScannerDisplayColor1: (OOColor*) color

Definition at line 529 of file OOVisualEffectEntity.m.

529 :(OOColor*)color
530{
532
533 if (color == nil)
534 color = [OOColor colorWithDescription:[effectinfoDictionary objectForKey:@"scanner_display_color1"]];
535 scanner_display_color1 = [color retain];
536}
OOColor * colorWithDescription:(id description)
Definition OOColor.m:135

References OOColor::colorWithDescription:, DESTROY, nil, and scanner_display_color1.

Referenced by setUpVisualEffectFromDictionary:, VisualEffectSetProperty(), and VisualEffectSetProperty().

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

◆ setScannerDisplayColor2:

- (void) setScannerDisplayColor2: (OOColor*) color

Definition at line 538 of file OOVisualEffectEntity.m.

538 :(OOColor*)color
539{
541
542 if (color == nil)
543 color = [OOColor colorWithDescription:[effectinfoDictionary objectForKey:@"scanner_display_color2"]];
544 scanner_display_color2 = [color retain];
545}

References OOColor::colorWithDescription:, DESTROY, nil, and scanner_display_color2.

Referenced by setUpVisualEffectFromDictionary:, VisualEffectSetProperty(), and VisualEffectSetProperty().

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

◆ setScript:

- (void) setScript: (NSString*) script_name

Definition at line 630 of file OOVisualEffectEntity.m.

630 :(NSString*)script_name
631{
632 NSMutableDictionary* properties = nil;
633
634 properties = [NSMutableDictionary dictionary];
635 [properties setObject:self forKey:@"visualEffect"];
636
637 [script autorelease];
638 script = [OOScript jsScriptFromFileNamed:script_name properties:properties];
639 // does not support legacy scripting
640 if (script == nil) {
641 script = [OOScript jsScriptFromFileNamed:@"oolite-default-effect-script.js" properties:properties];
642 }
643 [script retain];
644}
id jsScriptFromFileNamed:properties:(NSString *fileName,[properties] NSDictionary *properties)
Definition OOScript.m:177

References OOScript::jsScriptFromFileNamed:properties:, nil, and script.

Referenced by setUpVisualEffectFromDictionary:.

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

◆ setShaderFloat1:

- (void) setShaderFloat1: (GLfloat) value

Definition at line 792 of file OOVisualEffectEntity.m.

792 :(GLfloat)value
793{
794 _shaderFloat1 = value;
795}

References _shaderFloat1.

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setShaderFloat2:

- (void) setShaderFloat2: (GLfloat) value

Definition at line 802 of file OOVisualEffectEntity.m.

802 :(GLfloat)value
803{
804 _shaderFloat2 = value;
805}

References _shaderFloat2.

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setShaderInt1:

- (void) setShaderInt1: (int) value

Definition at line 812 of file OOVisualEffectEntity.m.

812 :(int)value
813{
814 _shaderInt1 = value;
815}
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

References _shaderInt1.

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setShaderInt2:

- (void) setShaderInt2: (int) value

Definition at line 822 of file OOVisualEffectEntity.m.

822 :(int)value
823{
824 _shaderInt2 = value;
825}

References _shaderInt2.

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setShaderVector1:

- (void) setShaderVector1: (Vector) value

Definition at line 832 of file OOVisualEffectEntity.m.

832 :(Vector)value
833{
834 _shaderVector1 = value;
835}
struct Vector Vector

References _shaderVector1.

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setShaderVector2:

- (void) setShaderVector2: (Vector) value

Definition at line 842 of file OOVisualEffectEntity.m.

842 :(Vector)value
843{
844 _shaderVector2 = value;
845}

References _shaderVector2.

Referenced by VisualEffectSetProperty(), and VisualEffectSetProperty().

Here is the caller graph for this function:

◆ setUpOneFlasher:

- (BOOL) setUpOneFlasher: (NSDictionary*) subentDict
implementation

Provided by category OOVisualEffectEntity(Private).

Definition at line 264 of file OOVisualEffectEntity.m.

264 :(NSDictionary*)subentDict
265{
266 OOFlasherEntity* flasher = [OOFlasherEntity flasherWithDictionary:subentDict];
267 [flasher setPosition:[subentDict oo_hpvectorForKey:@"position"]];
268 [self addSubEntity:flasher];
269 return YES;
270}
instancetype flasherWithDictionary:(NSDictionary *dictionary)

References addSubEntity:, OOFlasherEntity::flasherWithDictionary:, and Entity::setPosition:.

Referenced by OOVisualEffectEntity(Private)::setUpOneSubentity:.

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

◆ setUpOneStandardSubentity:

- (BOOL) setUpOneStandardSubentity: (NSDictionary*) subentDict
implementation

Provided by category OOVisualEffectEntity(Private).

Definition at line 272 of file OOVisualEffectEntity.m.

272 :(NSDictionary*)subentDict
273{
274 OOVisualEffectEntity* subentity = nil;
275 NSString* subentKey = nil;
276 HPVector subPosition;
277 Quaternion subOrientation;
278
279 subentKey = [subentDict oo_stringForKey:@"subentity_key"];
280 if (subentKey == nil) {
281 OOLog(@"setup.visualeffect.badEntry.subentities", @"Failed to set up entity - no subentKey in %@", subentDict);
282 return NO;
283 }
284
285 subentity = [UNIVERSE newVisualEffectWithName:subentKey];
286 if (subentity == nil) {
287 OOLog(@"setup.visualeffect.badEntry.subentities", @"Failed to set up entity %@", subentKey);
288 return NO;
289 }
290
291 subPosition = [subentDict oo_hpvectorForKey:@"position"];
292 subOrientation = [subentDict oo_quaternionForKey:@"orientation"];
293
294 [subentity setPosition:subPosition];
295 [subentity setOrientation:subOrientation];
296
297 [self addSubEntity:subentity];
298
299 [subentity release];
300
301 return YES;
302}
#define OOLog(class, format,...)
Definition OOLogging.h:84
struct Quaternion Quaternion
void setOrientation:(Quaternion quat)
Definition Entity.m:676

References addSubEntity:, nil, OOLog, Entity::setOrientation:, and Entity::setPosition:.

Referenced by OOVisualEffectEntity(Private)::setUpOneSubentity:.

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

◆ setUpOneSubentity:

- (BOOL) setUpOneSubentity: (NSDictionary*) subentDict
implementation

Provided by category OOVisualEffectEntity(Private).

Definition at line 254 of file OOVisualEffectEntity.m.

254 :(NSDictionary*)subentDict
255{
256 NSString* type = [subentDict oo_stringForKey:@"type"];
257 if ([type isEqualToString:@"flasher"]) {
258 return [self setUpOneFlasher:subentDict];
259 } else {
260 return [self setUpOneStandardSubentity:subentDict];
261 }
262}

References setUpOneFlasher:, and setUpOneStandardSubentity:.

Referenced by setUpSubEntities.

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

◆ setUpSubEntities

- (BOOL) setUpSubEntities

Definition at line 227 of file OOVisualEffectEntity.m.

228{
229 unsigned int i;
231 NSArray* subs = [effectinfoDictionary oo_arrayForKey:@"subentities"];
232
233 for (i = 0; i < [subs count]; i++) {
234 [self setUpOneSubentity:[subs oo_dictionaryAtIndex:i]];
235 }
236
237 [self setNoDrawDistance];
238
239 return YES;
240}

References _profileRadius, Entity::collision_radius, setNoDrawDistance, setUpOneSubentity:, and setUpSubEntities.

Referenced by setUpSubEntities, setUpVisualEffectFromDictionary:, VisualEffectRestoreSubEntities(), and VisualEffectRestoreSubEntities().

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

◆ setUpVisualEffectFromDictionary:

- (BOOL) setUpVisualEffectFromDictionary: (NSDictionary*) effectDict

Definition at line 98 of file OOVisualEffectEntity.m.

98 :(NSDictionary*)effectDict
99{
101
102 effectinfoDictionary = [effectDict copy];
104 effectinfoDictionary = [[NSDictionary alloc] init];
105
108
109 collision_radius = 0.0;
110
111 NSString* modelName = [effectDict oo_stringForKey:@"model"];
112 if (modelName != nil) {
113 OOMesh* mesh = [OOMesh meshWithName:modelName
114 cacheKey:_effectKey
115 materialDictionary:[effectDict oo_dictionaryForKey:@"materials"]
116 shadersDictionary:[effectDict oo_dictionaryForKey:@"shaders"]
117 smooth:[effectDict oo_boolForKey:@"smooth" defaultValue:NO]
118 shaderMacros:OODefaultShipShaderMacros()
120 if (mesh == nil)
121 return NO;
122 [self setMesh:mesh];
123 }
124
125 isImmuneToBreakPatternHide = [effectDict oo_boolForKey:@"is_break_pattern"];
126 scaleX = 1.0;
127 scaleY = 1.0;
128 scaleZ = 1.0;
129
130 [self clearSubEntities];
131 [self setUpSubEntities];
132
133 [self setScannerDisplayColor1:nil];
134 [self setScannerDisplayColor2:nil];
135
136 scanClass = CLASS_VISUAL_EFFECT;
137
138 [self setStatus:STATUS_EFFECT];
139
140 _hullHeatLevel = 60.0 / 256.0;
141 _shaderFloat1 = 0.0;
142 _shaderFloat2 = 0.0;
143 _shaderInt1 = 0;
144 _shaderInt2 = 0;
147
148 [self setBeaconCode:[effectDict oo_stringForKey:@"beacon"]];
149 [self setBeaconLabel:[effectDict oo_stringForKey:@"beacon_label" defaultValue:[self beaconCode]]];
150
151 scriptInfo = [[effectDict oo_dictionaryForKey:@"script_info" defaultValue:nil] retain];
152 [self setScript:[effectDict oo_stringForKey:@"script"]];
153
154 return YES;
155
157}
const OOMatrix kIdentityMatrix
Definition OOMatrix.m:28
const Quaternion kIdentityQuaternion
const Vector kZeroVector
Definition OOVector.m:27
OOScanClass scanClass
Definition Entity.m:743
instancetype meshWithName:cacheKey:materialDictionary:shadersDictionary:smooth:shaderMacros:shaderBindingTarget:(NSString *name,[cacheKey] NSString *cacheKey,[materialDictionary] NSDictionary *materialDict,[shadersDictionary] NSDictionary *shadersDict,[smooth] BOOL smooth,[shaderMacros] NSDictionary *macros,[shaderBindingTarget] id< OOWeakReferenceSupport > object)
Definition OOMesh.m:223

References _hullHeatLevel, _shaderFloat1, _shaderFloat2, _shaderInt1, _shaderInt2, _shaderVector1, _shaderVector2, beaconCode, clearSubEntities, Entity::collision_radius, effectinfoDictionary, Entity::isImmuneToBreakPatternHide, kIdentityMatrix, kIdentityQuaternion, kZeroVector, mesh, OOMesh::meshWithName:cacheKey:materialDictionary:shadersDictionary:smooth:shaderMacros:shaderBindingTarget:, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, Entity::orientation, Entity::rotMatrix, scaleX, scaleY, scaleZ, Entity::scanClass, scriptInfo, setBeaconCode:, setBeaconLabel:, setMesh:, setScannerDisplayColor1:, setScannerDisplayColor2:, setScript:, Entity::setStatus:, and setUpSubEntities.

Here is the call graph for this function:

◆ shaderFloat1

- (GLfloat) shaderFloat1

Definition at line 787 of file OOVisualEffectEntity.m.

788{
789 return _shaderFloat1;
790}

References _shaderFloat1, and shaderFloat1.

Referenced by scaleZ, and shaderFloat1.

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

◆ shaderFloat2

- (GLfloat) shaderFloat2

Definition at line 797 of file OOVisualEffectEntity.m.

798{
799 return _shaderFloat2;
800}

References _shaderFloat2, and shaderFloat2.

Referenced by scaleZ, and shaderFloat2.

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

◆ shaderInt1

- (int) shaderInt1

Definition at line 807 of file OOVisualEffectEntity.m.

808{
809 return _shaderInt1;
810}

References _shaderInt1, int(), and shaderInt1.

Referenced by scaleZ, and shaderInt1.

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

◆ shaderInt2

- (int) shaderInt2

Definition at line 817 of file OOVisualEffectEntity.m.

818{
819 return _shaderInt2;
820}

References _shaderInt2, int(), and shaderInt2.

Referenced by scaleZ, and shaderInt2.

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

◆ shaderVector1

- (Vector) shaderVector1

Definition at line 827 of file OOVisualEffectEntity.m.

828{
829 return _shaderVector1;
830}

References _shaderVector1, and shaderVector1.

Referenced by scaleZ, and shaderVector1.

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

◆ shaderVector2

- (Vector) shaderVector2

Definition at line 837 of file OOVisualEffectEntity.m.

838{
839 return _shaderVector2;
840}

References _shaderVector2, and shaderVector2.

Referenced by scaleZ, and shaderVector2.

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

◆ subEntities

- (NSArray *) subEntities

References effectSubEntityEnumerator, flasherEnumerator, forwardVector, orientationChanged, rightVector, scannerDisplayColor1, scannerDisplayColor2, subEntities, subEntityCount, subEntityEnumerator, upVector, and visualEffectSubEntityEnumerator.

Here is the call graph for this function:

◆ subEntitiesForScript [1/2]

- (NSArray *) subEntitiesForScript

Provided by category OOVisualEffectEntity(OOJavaScriptExtensions).

Definition at line 179 of file OOJSVisualEffect.m.

180{
181 return [[self visualEffectSubEntityEnumerator] allObjects];
182}

Referenced by VisualEffectGetProperty(), VisualEffectGetProperty(), VisualEffectRestoreSubEntities(), and VisualEffectRestoreSubEntities().

Here is the caller graph for this function:

◆ subEntitiesForScript [2/2]

- (NSArray *) subEntitiesForScript

◆ subEntityCount

- (NSUInteger) subEntityCount

Definition at line 327 of file OOVisualEffectEntity.m.

328{
329 return [subEntities count];
330}

References subEntityCount.

Referenced by subEntities, and subEntityCount.

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

◆ subEntityEnumerator

- (NSEnumerator *) subEntityEnumerator

Definition at line 342 of file OOVisualEffectEntity.m.

343{
344 return [[self subEntities] objectEnumerator];
345}

References subEntities, and subEntityEnumerator.

Referenced by subEntities, and subEntityEnumerator.

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 598 of file OOVisualEffectEntity.m.

598 :(OOTimeDelta)delta_t
599{
600 [super update:delta_t];
601
603 [self doScriptEvent:OOJSID("effectSpawned")];
605 }
606
607 Entity* se = nil;
608 foreach (se, [self subEntities]) {
609 [se update:delta_t];
610 }
611}
double OOTimeDelta
Definition OOTypes.h:193
void update:(OOTimeDelta delta_t)
Definition Entity.m:850

References _haveExecutedSpawnAction, doScriptEvent:, nil, subEntities, and Entity::update:.

Here is the call graph for this function:

◆ upVector

- (Vector) upVector

Definition at line 508 of file OOVisualEffectEntity.m.

509{
510 return _v_up;
511}

References _v_up, and upVector.

Referenced by subEntities, and upVector.

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

◆ visualEffectSubEntityEnumerator

- (NSEnumerator *) visualEffectSubEntityEnumerator

Definition at line 332 of file OOVisualEffectEntity.m.

333{
334 return [[self subEntities] objectEnumeratorFilteredWithSelector:@selector(isVisualEffect)];
335}

References subEntities, and visualEffectSubEntityEnumerator.

Referenced by subEntities, OOVisualEffectEntity(OOJavaScriptExtensions)::subEntitiesForScript, and visualEffectSubEntityEnumerator.

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

Member Data Documentation

◆ _beaconCode

- (NSString*) _beaconCode
private

Definition at line 68 of file OOVisualEffectEntity.h.

Referenced by beaconCode, dealloc, and setBeaconCode:.

◆ _beaconDrawable

- (id<OOHUDBeaconIcon>) _beaconDrawable
private

Definition at line 72 of file OOVisualEffectEntity.h.

Referenced by beaconDrawable, dealloc, and setBeaconCode:.

◆ _beaconLabel

- (NSString*) _beaconLabel
private

Definition at line 69 of file OOVisualEffectEntity.h.

Referenced by beaconLabel, dealloc, setBeaconCode:, and setBeaconLabel:.

◆ _effectKey

- (NSString*) _effectKey
private

Definition at line 63 of file OOVisualEffectEntity.h.

Referenced by dealloc, effectKey, and initWithKey:definition:.

◆ _haveExecutedSpawnAction

- (BOOL) _haveExecutedSpawnAction
private

Definition at line 65 of file OOVisualEffectEntity.h.

Referenced by initWithKey:definition:, and update:.

◆ _hullHeatLevel

- (GLfloat) _hullHeatLevel
private

◆ _nextBeacon

- (OOWeakReference*) _nextBeacon
private

Definition at line 71 of file OOVisualEffectEntity.h.

Referenced by setNextBeacon:.

◆ _prevBeacon

- (OOWeakReference*) _prevBeacon
private

Definition at line 70 of file OOVisualEffectEntity.h.

Referenced by setPrevBeacon:.

◆ _profileRadius

- (GLfloat) _profileRadius
private

◆ _shaderFloat1

- (GLfloat) _shaderFloat1
private

◆ _shaderFloat2

- (GLfloat) _shaderFloat2
private

◆ _shaderInt1

- (int) _shaderInt1
private

Definition at line 51 of file OOVisualEffectEntity.h.

Referenced by setShaderInt1:, setUpVisualEffectFromDictionary:, and shaderInt1.

◆ _shaderInt2

- (int) _shaderInt2
private

Definition at line 52 of file OOVisualEffectEntity.h.

Referenced by setShaderInt2:, setUpVisualEffectFromDictionary:, and shaderInt2.

◆ _shaderVector1

- (Vector) _shaderVector1
private

◆ _shaderVector2

- (Vector) _shaderVector2
private

◆ _v_forward

- (Vector) _v_forward
private

Definition at line 56 of file OOVisualEffectEntity.h.

Referenced by forwardVector, and orientationChanged.

◆ _v_right

- (Vector) _v_right
private

Definition at line 58 of file OOVisualEffectEntity.h.

Referenced by orientationChanged, and rightVector.

◆ _v_up

- (Vector) _v_up
private

Definition at line 57 of file OOVisualEffectEntity.h.

Referenced by orientationChanged, and upVector.

◆ effectinfoDictionary

- (NSDictionary*) effectinfoDictionary
private

◆ scaleX

- (GLfloat) scaleX
private

Definition at line 412 of file OOVisualEffectEntity.m.

413{
414 return scaleX;
415}

Referenced by drawImmediate:translucent:, scaleMax, scaleX, setScaleX:, and setUpVisualEffectFromDictionary:.

◆ scaleY

- (GLfloat) scaleY
private

Definition at line 437 of file OOVisualEffectEntity.m.

438{
439 return scaleY;
440}

Referenced by drawImmediate:translucent:, scaleMax, scaleY, setScaleY:, and setUpVisualEffectFromDictionary:.

◆ scaleZ

- (GLfloat) scaleZ
private

Definition at line 462 of file OOVisualEffectEntity.m.

463{
464 return scaleZ;
465}

Referenced by drawImmediate:translucent:, scaleMax, scaleZ, setScaleZ:, and setUpVisualEffectFromDictionary:.

◆ scanner_display_color1

- (OOColor*) scanner_display_color1
private

Definition at line 45 of file OOVisualEffectEntity.h.

Referenced by dealloc, and setScannerDisplayColor1:.

◆ scanner_display_color2

- (OOColor*) scanner_display_color2
private

Definition at line 46 of file OOVisualEffectEntity.h.

Referenced by dealloc, and setScannerDisplayColor2:.

◆ script

- (OOJSScript *) script
private

Definition at line 646 of file OOVisualEffectEntity.m.

647{
648 return script;
649}

Referenced by dealloc, script, setScript:, VisualEffectGetProperty(), and VisualEffectGetProperty().

◆ scriptInfo

- (NSDictionary *) scriptInfo
private

Definition at line 651 of file OOVisualEffectEntity.m.

652{
653 return (scriptInfo != nil) ? scriptInfo : (NSDictionary*)[NSDictionary dictionary];
654}

Referenced by dealloc, scriptInfo, setUpVisualEffectFromDictionary:, VisualEffectGetProperty(), and VisualEffectGetProperty().

◆ subEntities


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