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

#include <OOBreakPatternEntity.h>

+ Inheritance diagram for OOBreakPatternEntity:
+ Collaboration diagram for OOBreakPatternEntity:

Instance Methods

(void) - setInnerColor:outerColor:
 
(void) - setLifetime:
 
(id) - initWithPolygonSides:startAngle:aspectRatio: [implementation]
 
(void) - setInnerColorComponents:outerColorComponents: [implementation]
 
(void) - update: [implementation]
 
(void) - drawImmediate:translucent: [implementation]
 
(BOOL) - canCollide [implementation]
 
(BOOL) - isBreakPattern [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) - isEffect
 
(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]
 
(NSString *) - descriptionComponents [implementation]
 
(BOOL) - checkLinkedLists [implementation]
 
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
 
(Vector) - relativePosition [implementation]
 
(void) - subEntityReallyDied: [implementation]
 
(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) + breakPatternWithPolygonSides:startAngle:aspectRatio:
 

Private Attributes

Vector _vertexPosition [kOOBreakPatternMaxVertices]
 
GLfloat _vertexColor [kOOBreakPatternMaxVertices][4]
 
NSUInteger _vertexCount
 
double _lifetime
 

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 44 of file OOBreakPatternEntity.h.

Method Documentation

◆ breakPatternWithPolygonSides:startAngle:aspectRatio:

+ (instancetype) breakPatternWithPolygonSides: (NSUInteger) sides
startAngle: (float) startAngleDegrees
aspectRatio: (float) aspectRatio 

Definition at line 1 of file OOBreakPatternEntity.m.

83 :(NSUInteger)sides startAngle:(float)startAngleDegrees aspectRatio:(float)aspectRatio
84{
85 return [[[self alloc] initWithPolygonSides:sides startAngle:startAngleDegrees aspectRatio:aspectRatio] autorelease];
86}

◆ canCollide

- (BOOL) canCollide
implementation

Reimplemented from Entity.

Definition at line 1 of file OOBreakPatternEntity.m.

164{
165 return NO;
166}

◆ drawImmediate:translucent:

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

Reimplemented from Entity.

Definition at line 1 of file OOBreakPatternEntity.m.

128 :(bool)immediate translucent:(bool)translucent
129{
130 // check if has been hidden.
131 if (!isImmuneToBreakPatternHide) return;
132
133 if (translucent || immediate)
134 {
137
138 OOGL(glDisable(GL_LIGHTING));
139 OOGL(glDisable(GL_TEXTURE_2D));
140 OOGL(glEnable(GL_BLEND));
141 OOGL(glDepthMask(GL_FALSE));
142 OOGL(glDisableClientState(GL_NORMAL_ARRAY));
143
144 OOGL(glVertexPointer(3, GL_FLOAT, 0, _vertexPosition));
145 OOGL(glEnableClientState(GL_COLOR_ARRAY));
146 OOGL(glColorPointer(4, GL_FLOAT, 0, _vertexColor));
147
148 OOGL(glDrawArrays(GL_TRIANGLE_STRIP, 0, _vertexCount));
149
150 OOGL(glEnable(GL_LIGHTING));
151 OOGL(glEnable(GL_TEXTURE_2D));
152 OOGL(glDisable(GL_BLEND));
153 OOGL(glDepthMask(GL_TRUE));
154 OOGL(glEnableClientState(GL_NORMAL_ARRAY));
155 OOGL(glDisableClientState(GL_COLOR_ARRAY));
156
158 OOCheckOpenGLErrors(@"OOBreakPatternEntity after drawing %@", self);
159 }
160}
#define OO_ENTER_OPENGL()
@ OPENGL_STATE_OPAQUE
Definition OOOpenGL.h:123
#define OOVerifyOpenGLState()
Definition OOOpenGL.h:136
BOOL OOCheckOpenGLErrors(NSString *format,...)
Definition OOOpenGL.m:39
#define OOSetOpenGLState(STATE)
Definition OOOpenGL.h:135
#define OOGL(statement)
Definition OOOpenGL.h:251
unsigned isImmuneToBreakPatternHide
Definition Entity.h:102
GLfloat _vertexColor[kOOBreakPatternMaxVertices][4]
Vector _vertexPosition[kOOBreakPatternMaxVertices]

◆ initWithPolygonSides:startAngle:aspectRatio:

- (id) initWithPolygonSides: (NSUInteger) sides
startAngle: (float) startAngleDegrees
aspectRatio: (float) aspectRatio 
implementation

Definition at line 1 of file OOBreakPatternEntity.m.

43 :(NSUInteger)sides startAngle:(float)startAngleDegrees aspectRatio:(float)aspectRatio
44{
45 sides = MIN(MAX((NSUInteger)3, sides), (NSUInteger)kOOBreakPatternMaxSides);
46
47 if ((self = [super init]))
48 {
49 _vertexCount = (sides + 1) * 2;
50 float angle = startAngleDegrees * M_PI / 180.0f;
51 float deltaAngle = M_PI * 2.0f / sides;
52 float xAspect = fmin(1.0f, aspectRatio);
53 float yAspect = fmin(1.0f, 1.0f / aspectRatio);
54
55 NSUInteger vi = 0;
56 for (NSUInteger i = 0; i < sides; i++)
57 {
58 float s = sin(angle) * xAspect;
59 float c = cos(angle) * yAspect;
60
61 _vertexPosition[vi++] = (Vector) { s * 50, c * 50, -40 };
62 _vertexPosition[vi++] = (Vector) { s * 40, c * 40, 0 };
63
64 angle += deltaAngle;
65 }
66
69
70 [self setInnerColorComponents:(GLfloat[]){ 1.0f, 0.0f, 0.0f, 0.5f }
71 outerColorComponents:(GLfloat[]){ 0.0f, 0.0f, 1.0f, 0.25f }];
72
73 [self setStatus:STATUS_EFFECT];
74 [self setScanClass:CLASS_NO_DRAW];
75
77 }
78
79 return self;
80}
@ kOOBreakPatternMaxSides
#define MAX(A, B)
Definition OOMaths.h:114
#define MIN(A, B)
Definition OOMaths.h:111
#define M_PI
Definition OOMaths.h:73
id init()
Definition Entity.m:68

◆ isBreakPattern

- (BOOL) isBreakPattern
implementation

Reimplemented from Entity.

Definition at line 1 of file OOBreakPatternEntity.m.

170{
171 return YES;
172}

◆ setInnerColor:outerColor:

- (void) setInnerColor: (OOColor *) color1
outerColor: (OOColor *) color2 

Definition at line 1 of file OOBreakPatternEntity.m.

89 :(OOColor *)color1 outerColor:(OOColor *)color2
90{
91 GLfloat inner[4], outer[4];
92 [color1 getRed:&inner[0] green:&inner[1] blue:&inner[2] alpha:&inner[3]];
93 [color2 getRed:&outer[0] green:&outer[1] blue:&outer[2] alpha:&outer[3]];
94 [self setInnerColorComponents:inner outerColorComponents:outer];
95}
void getRed:green:blue:alpha:(float *red,[green] float *green,[blue] float *blue,[alpha] float *alpha)
Definition OOColor.m:368

◆ setInnerColorComponents:outerColorComponents:

- (void) setInnerColorComponents: (GLfloat[4]) color1
outerColorComponents: (GLfloat[4]) color2 
implementation

Provided by category OOBreakPatternEntity(Private).

Definition at line 1 of file OOBreakPatternEntity.m.

98 :(GLfloat[4])color1 outerColorComponents:(GLfloat[4])color2
99{
100 GLfloat *colors[2] = { color1, color2 };
101
102 for (NSUInteger i = 0; i < _vertexCount; i++)
103 {
104 GLfloat *color = colors[i & 1];
105 memcpy(&_vertexColor[i], color, sizeof (GLfloat) * 4);
106 }
107}

◆ setLifetime:

- (void) setLifetime: (double) lifetime

Definition at line 1 of file OOBreakPatternEntity.m.

110 :(double)lifetime
111{
112 _lifetime = lifetime;
113}

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from Entity.

Definition at line 1 of file OOBreakPatternEntity.m.

116 :(OOTimeDelta) delta_t
117{
118 [super update:delta_t];
119
121 if (_lifetime < 0.0)
122 {
123 [UNIVERSE removeEntity:self];
124 }
125}
#define BREAK_PATTERN_RING_SPEED
double OOTimeDelta
Definition OOTypes.h:224

Member Data Documentation

◆ _lifetime

- (double) _lifetime
private

Definition at line 50 of file OOBreakPatternEntity.h.

◆ _vertexColor

- (GLfloat _vertexColor[kOOBreakPatternMaxVertices][4])
private

Definition at line 48 of file OOBreakPatternEntity.h.

◆ _vertexCount

- (NSUInteger) _vertexCount
private

Definition at line 49 of file OOBreakPatternEntity.h.

◆ _vertexPosition

- (Vector _vertexPosition[kOOBreakPatternMaxVertices])
private

Definition at line 47 of file OOBreakPatternEntity.h.


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