Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
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 49 of file OORingEffectEntity.m.

168{
169 return NO;
170}

References x, and y.

◆ descriptionComponents

- (NSString *) descriptionComponents
implementation

Reimplemented from Entity.

Definition at line 49 of file OORingEffectEntity.m.

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

◆ drawImmediate:translucent:

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

Reimplemented from Entity.

Definition at line 49 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
#define kRingDuration
@ kCircleSegments
#define kRingAttack
static struct @11 sCircleVerts[kCircleSegments]
float y
float x
#define UNIVERSE
Definition Universe.h:833

◆ initialize

+ (void) initialize
implementation

Definition at line 49 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

◆ initRingFromEntity:

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

Definition at line 49 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.h:114
GLfloat collisionRadius()
Definition Entity.m:905
HPVector position
Definition Entity.h:112
Vector velocity
Definition Entity.h:140
id init()
Definition Entity.m:68

◆ isEffect

- (BOOL) isEffect
implementation

Reimplemented from Entity.

Definition at line 49 of file OORingEffectEntity.m.

162{
163 return YES;
164}

◆ ringFromEntity:

+ (instancetype) ringFromEntity: (Entity *) sourceEntity

Definition at line 49 of file OORingEffectEntity.m.

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

◆ shrinkingRingFromEntity:

+ (instancetype) shrinkingRingFromEntity: (Entity *) sourceEntity

Definition at line 49 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

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from Entity.

Definition at line 49 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

Member Data Documentation

◆ _innerGrowthRate

- (GLfloat) _innerGrowthRate
private

Definition at line 38 of file OORingEffectEntity.h.

◆ _innerRadius

- (GLfloat) _innerRadius
private

Definition at line 36 of file OORingEffectEntity.h.

◆ _outerGrowthRate

- (GLfloat) _outerGrowthRate
private

Definition at line 39 of file OORingEffectEntity.h.

◆ _outerRadius

- (GLfloat) _outerRadius
private

Definition at line 37 of file OORingEffectEntity.h.

◆ _timePassed

- (GLfloat) _timePassed
private

Definition at line 35 of file OORingEffectEntity.h.


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