Oolite 1.91.0.7677-250528-09ed63a
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
OORingEffectEntity Class Reference

#include <OORingEffectEntity.h>

Inheritance diagram for OORingEffectEntity:
Collaboration diagram for OORingEffectEntity:

Instance Methods

(id) - initRingFromEntity: [implementation]
(NSString *) - descriptionComponents [implementation]
(void) - update: [implementation]
(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
(double) - findCollisionRadius
(BOOL) - isVisible
(BOOL) - isInSpace
(BOOL) - isImmuneToBreakPatternHide
(GLfloat) - universalTime
(GLfloat) - spawnTime
(GLfloat) - timeElapsedSinceSpawn
(void) - setAtmosphereFogging:
(OOColor *) - fogUniform
(NSString *) - descriptionForObjDumpBasic
(NSString *) - descriptionForObjDump
(NSSet *) - allTextures
(id) - init [implementation]
(void) - dealloc [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:
(void) - drawSubEntityImmediate:translucent: [implementation]
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) + ringFromEntity:
(instancetype) + shrinkingRingFromEntity:
(void) + initialize [implementation]

Private Attributes

GLfloat _timePassed
GLfloat _innerRadius
GLfloat _outerRadius
GLfloat _innerGrowthRate
GLfloat _outerGrowthRate

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 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 32 of file OORingEffectEntity.h.

Method Documentation

◆ canCollide

- (BOOL) canCollide
implementation

Reimplemented from Entity.

Definition at line 167 of file OORingEffectEntity.m.

168{
169 return NO;
170}

References canCollide.

Referenced by canCollide.

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

◆ descriptionComponents

- (NSString *) descriptionComponents
implementation

Reimplemented from Entity.

Definition at line 113 of file OORingEffectEntity.m.

114{
115 return [NSString stringWithFormat:@"%f seconds passed of %f", _timePassed, kRingDuration];
116}

References descriptionComponents.

Referenced by descriptionComponents.

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 Entity.

Definition at line 134 of file OORingEffectEntity.m.

134 :(bool)immediate translucent:(bool)translucent
135{
136 if (!translucent || [UNIVERSE breakPatternHide]) return;
137
140
141 GLfloat alpha = OOClamp_0_1_f((kRingDuration - _timePassed) / kRingAttack);
142
143 GLfloat ex_em_hi[4] = {0.6, 0.8, 1.0, alpha}; // pale blue
144 GLfloat ex_em_lo[4] = {0.2, 0.0, 1.0, 0.0}; // purplish-blue-black
145
146 OOGLBEGIN(GL_TRIANGLE_STRIP);
147 for (unsigned i = 0; i < kCircleSegments; i++)
148 {
149 glColor4fv(ex_em_lo);
150 glVertex3f(_innerRadius * sCircleVerts[i].x, _innerRadius * sCircleVerts[i].y, 0.0f);
151 glColor4fv(ex_em_hi);
152 glVertex3f(_outerRadius * sCircleVerts[i].x, _outerRadius * sCircleVerts[i].y, 0.0f);
153 }
154 OOGLEND();
155
157 OOCheckOpenGLErrors(@"OOQuiriumCascadeEntity after drawing %@", self);
158}
#define OO_ENTER_OPENGL()
#define OOGLBEGIN
Definition OOOpenGL.h:253
@ OPENGL_STATE_ADDITIVE_BLENDING
Definition OOOpenGL.h:125
#define OOVerifyOpenGLState()
Definition OOOpenGL.h:136
BOOL OOCheckOpenGLErrors(NSString *format,...)
Definition OOOpenGL.m:39
#define OOSetOpenGLState(STATE)
Definition OOOpenGL.h:135
#define OOGLEND
Definition OOOpenGL.h:254
static struct @114234231373144364274312201276352366175106111125 sCircleVerts[kCircleSegments]
#define kRingDuration
#define kRingAttack
@ kCircleSegments
float y
float x
#define UNIVERSE
Definition Universe.h:840

References _innerRadius, _outerRadius, _timePassed, kCircleSegments, kRingAttack, kRingDuration, OO_ENTER_OPENGL, OOCheckOpenGLErrors(), OOGLBEGIN, OOGLEND, OOSetOpenGLState, OOVerifyOpenGLState, OPENGL_STATE_ADDITIVE_BLENDING, sCircleVerts, UNIVERSE, x, and y.

Here is the call graph for this function:

◆ initialize

+ (void) initialize
implementation

Definition at line 54 of file OORingEffectEntity.m.

55{
56 unsigned i;
57 for (i = 0; i < kCircleSegments; i++)
58 {
59 sCircleVerts[i].x = sinf(i * 2 * M_PI / (kCircleSegments - 1));
60 sCircleVerts[i].y = cosf(i * 2 * M_PI / (kCircleSegments - 1));
61 }
62}
#define M_PI
Definition OOMaths.h:73

References initialize, kCircleSegments, M_PI, and sCircleVerts.

Referenced by initialize.

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

◆ initRingFromEntity:

- (id) initRingFromEntity: (Entity *) sourceEntity
implementation

Definition at line 65 of file OORingEffectEntity.m.

65 :(Entity *)sourceEntity
66{
67 if (sourceEntity == nil)
68 {
69 [self release];
70 return nil;
71 }
72
73 if ((self = [super init]))
74 {
75 GLfloat baseSize = [sourceEntity collisionRadius];
80
81 [self setPosition:[sourceEntity position]];
82 [self setOrientation:[sourceEntity orientation]];
83 [self setVelocity:[sourceEntity velocity]];
84
85 [self setStatus:STATUS_EFFECT];
86 [self setScanClass:CLASS_NO_DRAW];
87
88 [self setOwner:sourceEntity];
89 }
90
91 return self;
92}
return nil
#define kOuterRingGrowthRateFactor
#define kInnerRingGrowthRateFactor
#define kOuterRingInitialSizeFactor
#define kInnerRingInitialSizeFactor
Quaternion orientation
Definition Entity.m:732
GLfloat collisionRadius()
Definition Entity.m:905
HPVector position
Definition Entity.m:612
Vector velocity
Definition Entity.m:763
id init()
Definition Entity.m:68

References _innerGrowthRate, _innerRadius, _outerGrowthRate, _outerRadius, Entity::collisionRadius, Entity::init, kInnerRingGrowthRateFactor, kInnerRingInitialSizeFactor, kOuterRingGrowthRateFactor, kOuterRingInitialSizeFactor, nil, Entity::orientation, Entity::position, Entity::setOrientation:, Entity::setOwner:, Entity::setPosition:, Entity::setScanClass:, Entity::setStatus:, Entity::setVelocity:, and Entity::velocity.

Here is the call graph for this function:

◆ isEffect

- (BOOL) isEffect
implementation

Reimplemented from Entity.

Definition at line 161 of file OORingEffectEntity.m.

162{
163 return YES;
164}

References isEffect.

Referenced by isEffect.

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

◆ ringFromEntity:

+ (instancetype) ringFromEntity: (Entity *) sourceEntity

Definition at line 95 of file OORingEffectEntity.m.

95 :(Entity *)sourceEntity
96{
97 return [[[self alloc] initRingFromEntity:sourceEntity] autorelease];
98}

Referenced by Universe::addWitchspaceJumpEffectForShip:, ShipEntity::becomeExplosion, and shrinkingRingFromEntity:.

Here is the caller graph for this function:

◆ shrinkingRingFromEntity:

+ (instancetype) shrinkingRingFromEntity: (Entity *) sourceEntity

Definition at line 101 of file OORingEffectEntity.m.

101 :(Entity *)sourceEntity
102{
103 OORingEffectEntity *result = [self ringFromEntity:sourceEntity];
104 if (result != nil)
105 {
108 }
109 return result;
110}
#define kShrinkingRingInnerGrowthFactor
#define kShrinkingRingOuterGrowthFactor

References _innerGrowthRate, _outerGrowthRate, kShrinkingRingInnerGrowthFactor, kShrinkingRingOuterGrowthFactor, nil, and ringFromEntity:.

Referenced by Universe::addWitchspaceJumpEffectForShip:.

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 119 of file OORingEffectEntity.m.

119 :(OOTimeDelta) delta_t
120{
121 [super update:delta_t];
122 _timePassed += delta_t;
123
124 _innerRadius += delta_t * _innerGrowthRate;
125 _outerRadius += delta_t * _outerGrowthRate;
126
128 {
129 [UNIVERSE removeEntity:self];
130 }
131}
double OOTimeDelta
Definition OOTypes.h:224

References _innerGrowthRate, _innerRadius, _outerGrowthRate, _outerRadius, _timePassed, kRingDuration, and Entity::update:.

Here is the call graph for this function:

Member Data Documentation

◆ _innerGrowthRate

- (GLfloat) _innerGrowthRate
private

Definition at line 38 of file OORingEffectEntity.h.

Referenced by initRingFromEntity:, shrinkingRingFromEntity:, and update:.

◆ _innerRadius

- (GLfloat) _innerRadius
private

Definition at line 36 of file OORingEffectEntity.h.

Referenced by drawImmediate:translucent:, initRingFromEntity:, and update:.

◆ _outerGrowthRate

- (GLfloat) _outerGrowthRate
private

Definition at line 39 of file OORingEffectEntity.h.

Referenced by initRingFromEntity:, shrinkingRingFromEntity:, and update:.

◆ _outerRadius

- (GLfloat) _outerRadius
private

Definition at line 37 of file OORingEffectEntity.h.

Referenced by drawImmediate:translucent:, initRingFromEntity:, and update:.

◆ _timePassed

- (GLfloat) _timePassed
private

Definition at line 35 of file OORingEffectEntity.h.

Referenced by drawImmediate:translucent:, and update:.


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