Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOWaypointEntity Class Reference

#include <OOWaypointEntity.h>

+ Inheritance diagram for OOWaypointEntity:
+ Collaboration diagram for OOWaypointEntity:

Instance Methods

(id) - initWithDictionary:
 
(BOOL) - oriented
 
(OOScalar- size
 
(void) - setSize:
 
(void) - dealloc [implementation]
 
(void) - setOrientation: [implementation]
 
(BOOL) - isEffect [implementation]
 
(BOOL) - isWaypoint [implementation]
 
(void) - drawImmediate:translucent: [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
 
(BOOL) - isVisibleToScripts
 
- 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) - 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
 
(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
 
(BOOL) - canCollide
 
(GLfloat) - collisionRadius
 
(GLfloat) - frustumRadius
 
(void) - setCollisionRadius:
 
(NSMutableArray *) - collisionArray
 
(void) - update:
 
(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]
 
(NSString *) - descriptionComponents [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
 
(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
 
- Instance Methods inherited from <OOBeaconEntity>

Class Methods

(instancetype) + waypointWithDictionary:
 

Private Attributes

OOScalar _size
 
NSString * _beaconCode
 
NSString * _beaconLabel
 
OOWeakReference_prevBeacon
 
OOWeakReference_nextBeacon
 
id< OOHUDBeaconIcon_beaconDrawable
 
BOOL oriented
 

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 30 of file OOWaypointEntity.h.

Method Documentation

◆ beaconCode

- (NSString *) beaconCode
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

207{
208 return _beaconCode;
209}

Referenced by WaypointGetProperty().

+ Here is the caller graph for this function:

◆ beaconDrawable

- (id< OOHUDBeaconIcon >) beaconDrawable
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

257{
258 if (_beaconDrawable == nil)
259 {
260 NSString *beaconCode = [self beaconCode];
261 NSUInteger length = [beaconCode length];
262
263 if (length > 1)
264 {
265 NSArray *iconData = [[UNIVERSE descriptions] oo_arrayForKey:beaconCode];
266 if (iconData != nil) _beaconDrawable = [[OOPolygonSprite alloc] initWithDataArray:iconData outlineWidth:0.5 name:beaconCode];
267 }
268
269 if (_beaconDrawable == nil)
270 {
271 if (length > 0) _beaconDrawable = [[beaconCode substringToIndex:1] retain];
272 else _beaconDrawable = @"";
273 }
274 }
275
276 return _beaconDrawable;
277}
return nil
id< OOHUDBeaconIcon > _beaconDrawable

◆ beaconLabel

- (NSString *) beaconLabel
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

233{
234 return _beaconLabel;
235}
NSString * _beaconLabel

Referenced by WaypointGetProperty().

+ Here is the caller graph for this function:

◆ compareBeaconCodeWith:

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

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

200 :(Entity<OOBeaconEntity> *) other
201{
202 return [[self beaconCode] compare:[other beaconCode] options: NSCaseInsensitiveSearch];
203}

◆ dealloc

- (void) dealloc
implementation

Reimplemented from Entity.

Definition at line 1 of file OOWaypointEntity.m.

69{
75
76 [super dealloc];
77}
#define DESTROY(x)
Definition OOCocoa.h:77
OOWeakReference * _nextBeacon
OOWeakReference * _prevBeacon

◆ drawImmediate:translucent:

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

Reimplemented from Entity.

Definition at line 1 of file OOWaypointEntity.m.

128 :(bool)immediate translucent:(bool)translucent
129{
130 if (!translucent || no_draw_distance < cam_zero_distance)
131 {
132 return;
133 }
134
135 if (![PLAYER hasEquipmentItemProviding:@"EQ_ADVANCED_COMPASS"])
136 {
137 return;
138 }
139
140 int8_t i,j,k;
141
142 GLfloat a = 0.75;
143 if ([PLAYER compassTarget] != self)
144 {
145 a *= 0.25;
146 }
148 {
149 // dim out as gets further away; 2-D HUD display more
150 // important at long range
151 a -= 0.004f*(sqrtf(cam_zero_distance) / _size);
152 }
153 if (a < 0.01f)
154 {
155 return;
156 }
157
158 GLfloat s0 = _size;
159 GLfloat s1 = _size * 0.75f;
160
163 OOGL(glEnable(GL_BLEND));
165
166 OOGL(glColor4f(0.0, 0.0, 1.0, a));
167 OOGLBEGIN(GL_LINES);
168 for (i = -1; i <= 1; i+=2)
169 {
170 for (j = -1; j <= 1; j+=2)
171 {
172 for (k = -1; k <= 1; k+=2)
173 {
174 glVertex3f(i*s0,j*s0,k*s1); glVertex3f(i*s0,j*s1,k*s0);
175 glVertex3f(i*s0,j*s1,k*s0); glVertex3f(i*s1,j*s0,k*s0);
176 glVertex3f(i*s1,j*s0,k*s0); glVertex3f(i*s0,j*s0,k*s1);
177 }
178 }
179 }
180 if (oriented)
181 {
182 while (s1 > 20.0f)
183 {
184 glVertex3f(-20.0,0,-s1-20.0f); glVertex3f(0,0,-s1);
185 glVertex3f(20.0,0,-s1-20.0f); glVertex3f(0,0,-s1);
186 glVertex3f(-20.0,0,s1-20.0f); glVertex3f(0,0,s1);
187 glVertex3f(20.0,0,s1-20.0f); glVertex3f(0,0,s1);
188 s1 *= 0.5;
189 }
190 }
191 OOGLEND();
192
193 OOGL(glDisable(GL_BLEND));
195}
#define OO_ENTER_OPENGL()
#define OOGLBEGIN
Definition OOOpenGL.h:253
@ OPENGL_STATE_TRANSLUCENT_PASS
Definition OOOpenGL.h:124
#define OOVerifyOpenGLState()
Definition OOOpenGL.h:136
void GLScaledLineWidth(GLfloat width)
Definition OOOpenGL.m:218
#define OOSetOpenGLState(STATE)
Definition OOOpenGL.h:135
#define OOGL(statement)
Definition OOOpenGL.h:251
#define OOGLEND
Definition OOOpenGL.h:254
#define PLAYER
GLfloat cam_zero_distance
Definition Entity.h:109
GLfloat no_draw_distance
Definition Entity.h:110

◆ getJSClass:andPrototype:

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

Reimplemented from Entity.

Provided by category OOWaypointEntity(OOJavaScriptExtensions).

Definition at line 187 of file OOJSWaypoint.m.

121 :(JSClass **)outClass andPrototype:(JSObject **)outPrototype
122{
123 *outClass = &sWaypointClass;
124 *outPrototype = sWaypointPrototype;
125}
static JSObject * sWaypointPrototype
static JSClass sWaypointClass

◆ initWithDictionary:

- (id) initWithDictionary: (NSDictionary *) info

Definition at line 1 of file OOWaypointEntity.m.

48 :(NSDictionary *)info
49{
50 self = [super init];
51 if (EXPECT_NOT(self == nil)) return nil;
52
53 oriented = YES;
54 position = [info oo_hpvectorForKey:OOWAYPOINT_KEY_POSITION];
55 Quaternion q = [info oo_quaternionForKey:OOWAYPOINT_KEY_ORIENTATION];
56 [self setOrientation:q];
57 [self setSize:[info oo_nonNegativeFloatForKey:OOWAYPOINT_KEY_SIZE defaultValue:1000.0]];
58 [self setBeaconCode:[info oo_stringForKey:OOWAYPOINT_KEY_CODE defaultValue:@"W"]];
59 [self setBeaconLabel:[info oo_stringForKey:OOWAYPOINT_KEY_LABEL defaultValue:@"Waypoint"]];
60
61 [self setStatus:STATUS_EFFECT];
62 [self setScanClass:CLASS_NO_DRAW];
63
64 return self;
65}
#define EXPECT_NOT(x)
HPVector position
Definition Entity.h:112

◆ isBeacon

- (BOOL) isBeacon
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

251{
252 return [self beaconCode] != nil;
253}

◆ isEffect

- (BOOL) isEffect
implementation

Reimplemented from Entity.

Definition at line 1 of file OOWaypointEntity.m.

117{
118 return YES;
119}

◆ isJammingScanning

- (BOOL) isJammingScanning
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

313{
314 return NO;
315}

◆ isVisibleToScripts

- (BOOL) isVisibleToScripts

Reimplemented from Entity.

Provided by category OOWaypointEntity(OOJavaScriptExtensions).

Definition at line 187 of file OOJSWaypoint.m.

134{
135 return YES;
136}

◆ isWaypoint

- (BOOL) isWaypoint
implementation

Reimplemented from Entity.

Definition at line 1 of file OOWaypointEntity.m.

123{
124 return YES;
125}

◆ nextBeacon

- (Entity< OOBeaconEntity > *) nextBeacon
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

287{
288 return [_nextBeacon weakRefUnderlyingObject];
289}

◆ oo_jsClassName

- (NSString *) oo_jsClassName

Reimplemented from Entity.

Provided by category OOWaypointEntity(OOJavaScriptExtensions).

Definition at line 187 of file OOJSWaypoint.m.

129{
130 return @"Waypoint";
131}

◆ oriented

- (BOOL) oriented

◆ prevBeacon

- (Entity< OOBeaconEntity > *) prevBeacon
implementation

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

281{
282 return [_prevBeacon weakRefUnderlyingObject];
283}

◆ setBeaconCode:

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

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

212 :(NSString *)bcode
213{
214 if ([bcode length] == 0) bcode = nil;
215
216 if (_beaconCode != bcode)
217 {
218 [_beaconCode release];
219 _beaconCode = [bcode copy];
220
222 }
223 // if not blanking code and label is currently blank, default label to code
224 if (bcode != nil && (_beaconLabel == nil || [_beaconLabel length] == 0))
225 {
226 [self setBeaconLabel:bcode];
227 }
228
229}

Referenced by OOWaypointEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:.

+ Here is the caller graph for this function:

◆ setBeaconLabel:

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

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

238 :(NSString *)blabel
239{
240 if ([blabel length] == 0) blabel = nil;
241
242 if (_beaconLabel != blabel)
243 {
244 [_beaconLabel release];
245 _beaconLabel = [OOExpand(blabel) retain];
246 }
247}

Referenced by OOWaypointEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:.

+ Here is the caller graph for this function:

◆ setNextBeacon:

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

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

302 :(Entity <OOBeaconEntity> *)beaconShip
303{
304 if (beaconShip != [self nextBeacon])
305 {
306 [_nextBeacon release];
307 _nextBeacon = [beaconShip weakRetain];
308 }
309}
Entity< OOBeaconEntity > * nextBeacon()

◆ setOrientation:

- (void) setOrientation: (Quaternion) q
implementation

Reimplemented from Entity.

Definition at line 1 of file OOWaypointEntity.m.

81 :(Quaternion)q
82{
83 if (quaternion_equal(q,kZeroQuaternion)) {
85 oriented = NO;
86 } else {
87 oriented = YES;
88 }
89 [super setOrientation:q];
90}
const Quaternion kIdentityQuaternion
const Quaternion kZeroQuaternion

◆ setPrevBeacon:

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

Reimplemented from <OOBeaconEntity>.

Definition at line 1 of file OOWaypointEntity.m.

292 :(Entity <OOBeaconEntity> *)beaconShip
293{
294 if (beaconShip != [self prevBeacon])
295 {
296 [_prevBeacon release];
297 _prevBeacon = [beaconShip weakRetain];
298 }
299}
Entity< OOBeaconEntity > * prevBeacon()

◆ setSize:

- (void) setSize: (OOScalar) newSize

Definition at line 1 of file OOWaypointEntity.m.

105 :(OOScalar)newSize
106{
107 if (newSize > 0)
108 {
109 _size = newSize;
111 }
112}
#define NO_DRAW_DISTANCE_FACTOR
Definition Entity.h:46
GLfloat OOScalar
Definition OOMaths.h:64

Referenced by OOWaypointEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:.

+ Here is the caller graph for this function:

◆ size

Definition at line 1 of file OOWaypointEntity.m.

100{
101 return _size;
102}

◆ waypointWithDictionary:

+ (instancetype) waypointWithDictionary: (NSDictionary *) info

Definition at line 1 of file OOWaypointEntity.m.

43 :(NSDictionary *)info
44{
45 return [[[OOWaypointEntity alloc] initWithDictionary:info] autorelease];
46}

Member Data Documentation

◆ _beaconCode

- (NSString*) _beaconCode
private

Definition at line 36 of file OOWaypointEntity.h.

◆ _beaconDrawable

- (id<OOHUDBeaconIcon>) _beaconDrawable
private

Definition at line 40 of file OOWaypointEntity.h.

◆ _beaconLabel

- (NSString*) _beaconLabel
private

Definition at line 37 of file OOWaypointEntity.h.

◆ _nextBeacon

- (OOWeakReference*) _nextBeacon
private

Definition at line 39 of file OOWaypointEntity.h.

◆ _prevBeacon

- (OOWeakReference*) _prevBeacon
private

Definition at line 38 of file OOWaypointEntity.h.

◆ _size

- (OOScalar) _size
private

Definition at line 34 of file OOWaypointEntity.h.

◆ oriented

- (BOOL) oriented
private

Definition at line 41 of file OOWaypointEntity.h.


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