Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOQuiriumCascadeEntity Class Reference

#include <OOQuiriumCascadeEntity.h>

+ Inheritance diagram for OOQuiriumCascadeEntity:
+ Collaboration diagram for OOQuiriumCascadeEntity:

Instance Methods

(id) - initQuiriumCascadeFromShip: [implementation]
 
(NSString *) - descriptionComponents [implementation]
 
(void) - update: [implementation]
 
(void) - drawImmediate:translucent: [implementation]
 
(BOOL) - isEffect [implementation]
 
(BOOL) - isCascadeWeapon [implementation]
 
(BOOL) - canCollide [implementation]
 
(BOOL) - checkCloseCollisionWith: [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:
 
(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) - 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) + quiriumCascadeFromShip:
 

Private Attributes

OOTimeDelta _timePassed
 
GLfloat _color [4]
 

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 31 of file OOQuiriumCascadeEntity.h.

Method Documentation

◆ canCollide

- (BOOL) canCollide
implementation

Reimplemented from Entity.

Definition at line 1 of file OOQuiriumCascadeEntity.m.

160{
162}
#define kQuiriumCollisionDelay

◆ checkCloseCollisionWith:

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

Reimplemented from Entity.

Definition at line 1 of file OOQuiriumCascadeEntity.m.

165 :(Entity *)other
166{
167 return YES;
168}

◆ descriptionComponents

- (NSString *) descriptionComponents
implementation

Reimplemented from Entity.

Definition at line 1 of file OOQuiriumCascadeEntity.m.

71{
72 return [NSString stringWithFormat:@"%f seconds passed of %f", _timePassed, kQuiriumCascadeDuration];
73}

◆ drawImmediate:translucent:

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

Reimplemented from Entity.

Definition at line 1 of file OOQuiriumCascadeEntity.m.

121 :(bool)immediate translucent:(bool)translucent
122{
123 if (!translucent || [UNIVERSE breakPatternHide]) return;
124
127
128 OOGL(glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT));
129
130 OOGL(glDisable(GL_CULL_FACE));
131 OOGL(glDisable(GL_TEXTURE_2D));
132 OOGL(glEnable(GL_BLEND));
133 OOGL(glBlendFunc(GL_SRC_ALPHA, GL_ONE));
134
135 OOGL(glColor4fv(_color));
136 OOGLBEGIN(GL_TRIANGLE_FAN);
138 OOGLEND();
139
140 OOGL(glPopAttrib());
141
143 OOCheckOpenGLErrors(@"OOQuiriumCascadeEntity after drawing %@", self);
144}
#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
void GLDrawBallBillboard(GLfloat radius, GLfloat step, GLfloat z_distance)
Definition OOOpenGL.m:111
#define OOSetOpenGLState(STATE)
Definition OOOpenGL.h:135
#define OOGL(statement)
Definition OOOpenGL.h:251
#define OOGLEND
Definition OOOpenGL.h:254
#define UNIVERSE
Definition Universe.h:833
GLfloat collision_radius
Definition Entity.h:111
GLfloat cam_zero_distance
Definition Entity.h:109

◆ initQuiriumCascadeFromShip:

- (id) initQuiriumCascadeFromShip: (ShipEntity *) ship
implementation

Definition at line 1 of file OOQuiriumCascadeEntity.m.

38 :(ShipEntity *)ship
39{
40 if (ship == nil)
41 {
42 [self release];
43 return nil;
44 }
45
46 if ((self = [super init]))
47 {
48 [self setPosition:[ship position]];
49
50 [self setStatus:STATUS_EFFECT];
51 scanClass = CLASS_MINE;
52
53 [self setOwner:[ship owner]];
54
55 // Red and green channels are animated.
56 _color[2] = 1.0f;
57 _color[3] = 0.5f;
58 }
59
60 return self;
61}
return nil
OOScanClass scanClass
Definition Entity.h:106
HPVector position
Definition Entity.h:112
id init()
Definition Entity.m:68
id owner()
Definition Entity.m:583

◆ isCascadeWeapon

- (BOOL) isCascadeWeapon
implementation

Reimplemented from Entity.

Definition at line 1 of file OOQuiriumCascadeEntity.m.

154{
155 return YES;
156}

◆ isEffect

- (BOOL) isEffect
implementation

Reimplemented from Entity.

Definition at line 1 of file OOQuiriumCascadeEntity.m.

148{
149 return YES;
150}

◆ quiriumCascadeFromShip:

+ (instancetype) quiriumCascadeFromShip: (ShipEntity *) ship

Definition at line 1 of file OOQuiriumCascadeEntity.m.

64 :(ShipEntity *)ship
65{
66 return [[[self alloc] initQuiriumCascadeFromShip:ship] autorelease];
67}

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from Entity.

Definition at line 1 of file OOQuiriumCascadeEntity.m.

76 :(OOTimeDelta) delta_t
77{
78 [super update:delta_t];
79 _timePassed += delta_t;
80
82
84 GLfloat stf = tf * tf;
85 GLfloat expansionSpeed = 0.0;
86 if (_timePassed > 0) // Avoid divide by 0
87 {
88 expansionSpeed = fmin(240.0f + 10.0f / (tf * tf), 1000.0f);
89 }
90
91 collision_radius += delta_t * expansionSpeed; // expand
92 energy = delta_t * (100000 - 90000 * tf); // adjusted to take into account delta_t
93
94 _color[3] = OOClamp_0_1_f(0.5f * ((0.025f / tf) + 1.0f - stf));
95
96 _color[0] = _color[1] = fmin(1.0f - 5.0f * tf, 1.0f);
97 if (_color[0] < 0.0f)
98 {
99 _color[0] = 0.25f * tf * randf();
100 _color[1] = 0.0f;
101 }
102
103 // manage collisions
104 Entity *owner = [self owner];
105 Entity *e = nil;
106 foreach (e, collidingEntities)
107 {
108 // we're going to force the weapon id to be the qbomb key here, because at this point the cascade entity isn't a ship any more
109 // and there's no link back to the original.
110 [e takeEnergyDamage:energy from:self becauseOf:owner weaponIdentifier:@"EQ_QC_MINE"];
111 }
112
113 // expire after ttl
115 {
116 [UNIVERSE removeEntity:self];
117 }
118}
OOMatrix OOMatrixForBillboard(HPVector bbPos, HPVector eyePos)
Definition OOMatrix.m:191
#define kQuiriumCascadeDuration
double OOTimeDelta
Definition OOTypes.h:224
#define PLAYER
NSMutableArray * collidingEntities
Definition Entity.h:148
GLfloat energy
Definition Entity.h:142
void takeEnergyDamage:from:becauseOf:weaponIdentifier:(double amount,[from] Entity *ent,[becauseOf] Entity *other,[weaponIdentifier] NSString *weaponIdentifier)
Definition Entity.m:990
OOMatrix rotMatrix
Definition Entity.h:138
float randf(void)

Member Data Documentation

◆ _color

- (GLfloat _color[4])
private

Definition at line 35 of file OOQuiriumCascadeEntity.h.

◆ _timePassed

- (OOTimeDelta) _timePassed
private

Definition at line 34 of file OOQuiriumCascadeEntity.h.


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