Oolite
Loading...
Searching...
No Matches
Entity Class Reference

#include <Entity.h>

Inheritance diagram for Entity:
Collaboration diagram for Entity:

Instance Methods

(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
(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
(NSUInteger) - lastDrawCounter
(void) - setLastDrawCounter:
(double) - findCollisionRadius
(void) - drawImmediate:translucent:
(BOOL) - isVisible
(BOOL) - isInSpace
(BOOL) - isImmuneToBreakPatternHide
(GLfloat) - universalTime
(GLfloat) - spawnTime
(GLfloat) - timeElapsedSinceSpawn
(void) - setAtmosphereFogging:
(OOColor *) - fogUniform
(id) - init [implementation]
(void) - dealloc [implementation]
(NSString *) - descriptionComponents [implementation]
(BOOL) - checkLinkedLists [implementation]
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
(Vector) - relativePosition [implementation]
(void) - subEntityReallyDied: [implementation]
(BOOL) - isBreakPattern
(BOOL) - isECMBlast
(BOOL) - isExhaust
(BOOL) - isFlasher
(BOOL) - isVisibleToScripts
(BOOL) - isVisibleToScripts
(NSString *) - oo_jsClassName
(NSString *) - oo_jsClassName
(void) - getJSClass:andPrototype:
(void) - deleteJSSelf
(void) - deleteJSSelf
(JSClassID) - oo_jsClassID
(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

Public Attributes

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
OOColor * atmosphereFogging
int zero_index
Entity * x_previous
Entity * x_next
Entity * y_previous
Entity * y_next
Entity * z_previous
Entity * z_next
Entity * collision_chain
OOUniversalID shadingEntityID
Entity * collider
CollisionRegion * collisionRegion

Protected Attributes

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
NSUInteger lastDrawCounter
Protected Attributes inherited from OOWeakRefObject
OOWeakReference * weakSelf

Private Attributes

NSUInteger _sessionID
OOWeakReference * _owner
OOEntityStatus _status

Detailed Description

Definition at line 75 of file Entity.h.

Method Documentation

◆ absolutePositionForSubentity

- (HPVector) absolutePositionForSubentity

◆ absolutePositionForSubentityOffset:

- (HPVector) absolutePositionForSubentityOffset: (HPVector) offset

Definition at line 632 of file Entity.m.

633{
635 Entity* last = nil;
636 Entity* father = [self parentEntity];
637
638 while (father != nil && father != last) {
639 abspos = HPvector_add(OOHPVectorMultiplyMatrix(abspos, [father drawRotationMatrix]), [father position]);
640 last = father;
641 if (![last isSubEntity])
642 break;
643 father = [father owner];
644 }
645 return abspos;
646}
struct HPVector HPVector
OOINLINE HPVector HPvector_add(HPVector a, HPVector b) INLINE_CONST_FUNC
Definition OOHPVector.h:213
HPVector OOHPVectorMultiplyMatrix(HPVector v, OOMatrix m) CONST_FUNC
Definition OOMatrix.m:137
return nil
unsigned isSubEntity
Definition Entity.m:140
HPVector position
Definition Entity.m:576
OOMatrix rotMatrix
Definition Entity.h:134
id owner()
Definition Entity.m:548
OOMatrix drawRotationMatrix()
Definition Entity.m:808
voidpf uLong offset
Definition ioapi.h:132

References drawRotationMatrix, HPvector_add(), isSubEntity, nil, OOHPVectorMultiplyMatrix(), owner, parentEntity, position, and rotMatrix.

Referenced by absolutePositionForSubentity, Universe::firstShipHitByLaserFromShip:inDirection:offset:gettingRangeFound:, and OOLaserShotEntity::initLaserFromShip:direction:offset:.

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

◆ addToLinkedLists

- (void) addToLinkedLists

Definition at line 207 of file Entity.m.

208{
209#ifdef OO_DEBUG_MONITOR_ENABLED
211 OOLog(kOOLogEntityAddToList, @"DEBUG adding entity %@ to linked lists", self);
212#endif
213 //
214 // insert at the start
215 if (UNIVERSE) {
216 x_previous = nil;
217 x_next = UNIVERSE->x_list_start;
218 // move UP the list
219 while ((x_next) && (x_next->position.x - x_next->collision_radius < position.x - collision_radius)) {
221 x_next = x_next->x_next;
222 }
223 if (x_next)
224 x_next->x_previous = self;
225 if (x_previous)
226 x_previous->x_next = self;
227 else
228 UNIVERSE->x_list_start = self;
229
230 y_previous = nil;
231 y_next = UNIVERSE->y_list_start;
232 // move UP the list
233 while ((y_next) && (y_next->position.y - y_next->collision_radius < position.y - collision_radius)) {
235 y_next = y_next->y_next;
236 }
237 if (y_next)
238 y_next->y_previous = self;
239 if (y_previous)
240 y_previous->y_next = self;
241 else
242 UNIVERSE->y_list_start = self;
243
244 z_previous = nil;
245 z_next = UNIVERSE->z_list_start;
246 // move UP the list
247 while ((z_next) && (z_next->position.z - z_next->collision_radius < position.z - collision_radius)) {
249 z_next = z_next->z_next;
250 }
251 if (z_next)
252 z_next->z_previous = self;
253 if (z_previous)
254 z_previous->z_next = self;
255 else
256 UNIVERSE->z_list_start = self;
257 }
258
259#ifdef OO_DEBUG_MONITOR_ENABLED
261 if (![self checkLinkedLists]) {
262 OOLog(kOOLogEntityAddToListError, @"DEBUG LINKED LISTS - problem encountered while adding %@ to linked lists", self);
263 [UNIVERSE debugDumpEntities];
264 }
265 }
266#endif
267}
#define gDebugFlags
@ DEBUG_LINKED_LISTS
Definition OODebugFlags.h:4
#define OOLog(class, format,...)
Definition OOLogging.h:84
#define UNIVERSE
Definition Universe.h:827
GLfloat collision_radius
Definition Entity.h:107
Entity * z_next
Definition Entity.h:118
Entity * z_previous
Definition Entity.h:118
BOOL checkLinkedLists()
Definition Entity.m:321
Entity * x_previous
Definition Entity.h:116
Entity * x_next
Definition Entity.h:116
Entity * y_next
Definition Entity.h:117
Entity * y_previous
Definition Entity.h:117

References addToLinkedLists, checkLinkedLists, collision_radius, DEBUG_LINKED_LISTS, gDebugFlags, nil, OOLog, position, UNIVERSE, x_next, x_previous, y_next, y_previous, z_next, and z_previous.

Referenced by addToLinkedLists, isVisualEffect, and Universe::MaintainLinkedLists.

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

◆ applyRoll:andClimb:

- (void) applyRoll: (GLfloat) roll
andClimb: (GLfloat) climb 

Reimplemented in PlayerEntity, and ShipEntity.

Definition at line 768 of file Entity.m.

768 :(GLfloat)roll andClimb:(GLfloat)climb
769{
770 if ((roll == 0.0) && (climb == 0.0) && (!hasRotated))
771 return;
772
773 if (roll)
775 if (climb)
777
778 [self orientationChanged];
779}
void quaternion_rotate_about_x(Quaternion *quat, OOScalar angle) NONNULL_FUNC
void quaternion_rotate_about_z(Quaternion *quat, OOScalar angle) NONNULL_FUNC
unsigned hasRotated
Definition Entity.h:93
Quaternion orientation
Definition Entity.m:682

References hasRotated, orientation, orientationChanged, quaternion_rotate_about_x(), and quaternion_rotate_about_z().

Here is the call graph for this function:

◆ applyRoll:climb:andYaw:

- (void) applyRoll: (GLfloat) roll
climb: (GLfloat) climb
andYaw: (GLfloat) yaw 

Reimplemented in ShipEntity.

Definition at line 781 of file Entity.m.

781 :(GLfloat)roll climb:(GLfloat)climb andYaw:(GLfloat)yaw
782{
783 if ((roll == 0.0) && (climb == 0.0) && (yaw == 0.0) && (!hasRotated))
784 return;
785
786 if (roll)
788 if (climb)
790 if (yaw)
792
793 [self orientationChanged];
794}
void quaternion_rotate_about_y(Quaternion *quat, OOScalar angle) NONNULL_FUNC

References hasRotated, orientation, orientationChanged, quaternion_rotate_about_x(), quaternion_rotate_about_y(), and quaternion_rotate_about_z().

Here is the call graph for this function:

◆ applyVelocity:

- (void) applyVelocity: (OOTimeDelta) delta_t

Definition at line 878 of file Entity.m.

878 :(OOTimeDelta)delta_t
879{
881}
OOINLINE HPVector vectorToHPVector(Vector v) INLINE_CONST_FUNC
Definition OOHPVector.h:166
OOINLINE HPVector HPvector_multiply_scalar(HPVector v, OOHPScalar s) INLINE_CONST_FUNC
Definition OOHPVector.h:198
double OOTimeDelta
Definition OOTypes.h:193
Vector velocity
Definition Entity.m:708

References HPvector_add(), HPvector_multiply_scalar(), position, vectorToHPVector(), and velocity.

Referenced by PlayerEntity(OOPrivate)::performAutopilotUpdates:, PlayerEntity(OOPrivate)::performInFlightUpdates:, and update:.

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

◆ boundingBox

◆ cameraRangeBack

- (GLfloat) cameraRangeBack

Reimplemented in SkyEntity.

Definition at line 591 of file Entity.m.

592{
594}
return self
OOINLINE OOScalar magnitude(Vector vec) INLINE_CONST_FUNC
Definition OOVector.h:242
Vector cameraRelativePosition
Definition Entity.m:581
GLfloat frustumRadius()
Definition Entity.m:835

References cameraRangeBack, cameraRelativePosition, frustumRadius, and magnitude().

Referenced by cameraRangeBack, cameraRelativePosition, and Universe::drawUniverse.

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

◆ cameraRangeFront

- (GLfloat) cameraRangeFront

Reimplemented in SkyEntity.

Definition at line 586 of file Entity.m.

587{
589}

References cameraRangeFront, cameraRelativePosition, frustumRadius, and magnitude().

Referenced by cameraRangeFront, and cameraRelativePosition.

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

◆ cameraRelativePosition

References absolutePositionForSubentity, cameraRangeBack, cameraRangeFront, cameraRelativePosition, camZeroDistance, updateCameraRelativePosition, and zeroDistance.

Here is the call graph for this function:

◆ camZeroDistance

- (double) camZeroDistance

Definition at line 653 of file Entity.m.

654{
655 return cam_zero_distance;
656}
GLfloat cam_zero_distance
Definition Entity.h:105

References cam_zero_distance, and camZeroDistance.

Referenced by cameraRelativePosition, camZeroDistance, OOLightParticleEntity::drawSubEntityImmediate:translucent:, and update:.

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

◆ canCollide

- (BOOL) canCollide

Reimplemented in DustEntity, OOBreakPatternEntity, OOLaserShotEntity, OOLightParticleEntity, OOParticleSystem, OOPlasmaShotEntity, OOQuiriumCascadeEntity, OORingEffectEntity, OOSunEntity, OOVisualEffectEntity, PlanetEntity, PlayerEntity, ShipEntity, SkyEntity, and WormholeEntity.

Definition at line 825 of file Entity.m.

826{
827 return YES;
828}

References canCollide.

Referenced by canCollide, Universe::filterSortedLists, and maxEnergy.

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

◆ checkCloseCollisionWith:

- (BOOL) checkCloseCollisionWith: (Entity*) other

Reimplemented in OOParticleSystem, OOPlasmaShotEntity, OOQuiriumCascadeEntity, PlanetEntity, ShipEntity, and WormholeEntity.

Definition at line 883 of file Entity.m.

883 :(Entity*)other
884{
885 return other != nil;
886}

References nil.

Referenced by CollisionRegion::findCollisions.

Here is the caller graph for this function:

◆ checkLinkedLists

- (BOOL) checkLinkedLists
implementation

Provided by category Entity(OOPrivate).

Definition at line 321 of file Entity.m.

322{
323 // DEBUG check for loops
324 if (UNIVERSE->n_entities > 0) {
325 int n;
326 Entity *check, *last;
327 //
328 last = nil;
329 //
330 n = UNIVERSE->n_entities;
331 check = UNIVERSE->x_list_start;
332 while ((n--) && (check)) {
333 last = check;
334 check = check->x_next;
335 }
336 if ((check) || (n > 0)) {
337 OOLog(kOOLogEntityVerificationError, @"Broken x_next %@ list (%d) ***", UNIVERSE->x_list_start, n);
338 return NO;
339 }
340 //
341 n = UNIVERSE->n_entities;
342 check = last;
343 while ((n--) && (check))
344 check = check->x_previous;
345 if ((check) || (n > 0)) {
346 OOLog(kOOLogEntityVerificationError, @"Broken x_previous %@ list (%d) ***", UNIVERSE->x_list_start, n);
347 return NO;
348 }
349 //
350 n = UNIVERSE->n_entities;
351 check = UNIVERSE->y_list_start;
352 while ((n--) && (check)) {
353 last = check;
354 check = check->y_next;
355 }
356 if ((check) || (n > 0)) {
357 OOLog(kOOLogEntityVerificationError, @"Broken y_next %@ list (%d) ***", UNIVERSE->y_list_start, n);
358 return NO;
359 }
360 //
361 n = UNIVERSE->n_entities;
362 check = last;
363 while ((n--) && (check))
364 check = check->y_previous;
365 if ((check) || (n > 0)) {
366 OOLog(kOOLogEntityVerificationError, @"Broken y_previous %@ list (%d) ***", UNIVERSE->y_list_start, n);
367 return NO;
368 }
369 //
370 n = UNIVERSE->n_entities;
371 check = UNIVERSE->z_list_start;
372 while ((n--) && (check)) {
373 last = check;
374 check = check->z_next;
375 }
376 if ((check) || (n > 0)) {
377 OOLog(kOOLogEntityVerificationError, @"Broken z_next %@ list (%d) ***", UNIVERSE->z_list_start, n);
378 return NO;
379 }
380 //
381 n = UNIVERSE->n_entities;
382 check = last;
383 while ((n--) && (check))
384 check = check->z_previous;
385 if ((check) || (n > 0)) {
386 OOLog(kOOLogEntityVerificationError, @"Broken z_previous %@ list (%d) ***", UNIVERSE->z_list_start, n);
387 return NO;
388 }
389 }
390 return YES;
391}
static NSString *const kOOLogEntityVerificationError
Definition Entity.m:54

References Entity(OOPrivate)::checkLinkedLists, kOOLogEntityVerificationError, nil, OOLog, UNIVERSE, x_next, x_previous, y_next, y_previous, z_next, and z_previous.

Referenced by addToLinkedLists, Entity(OOPrivate)::checkLinkedLists, removeFromLinkedLists, and updateLinkedLists.

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

◆ clock

- (GLfloat) clock
implementation

Provided by category Entity(ShaderBindings).

Definition at line 35 of file EntityShaderBindings.m.

36{
37 return [PLAYER clockTime];
38}

◆ collisionArray

- (NSMutableArray *) collisionArray

Definition at line 845 of file Entity.m.

846{
847 return collidingEntities;
848}
NSMutableArray * collidingEntities
Definition Entity.h:144

References collidingEntities, and collisionArray.

Referenced by ShipEntity::collideWithShip:, collisionArray, CollisionRegion::findCollisions, maxEnergy, and ShipEntity::scoopUpProcess:processEvents:processMessages:.

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

◆ collisionRadius

- (GLfloat) collisionRadius

Reimplemented in OOVisualEffectEntity.

Definition at line 830 of file Entity.m.

831{
832 return collision_radius;
833}

References collision_radius, and collisionRadius.

Referenced by Universe::addShipsToRoute:withRole:quantity:routeFraction:asGroup:, ShipEntity::becomeExplosion, ShipEntity::behaviour_land_on_planet:, ShipEntity::behaviour_track_as_turret:, collisionRadius, ShipEntity::dealEnergyDamage:atRange:withBias:, ShipEntity::dealEnergyDamageWithinDesiredRange, ShipEntity::dealMomentumWithinDesiredRange:, DockEntity::dockingInstructionsForShip:, OOEntityWithDrawable::drawImmediate:translucent:, OOFlashEffectEntity::explosionFlashFromEntity:, Universe::firstEntityTargetedByPlayer, OOBigFragmentBurstEntity::fragmentBurstFromEntity:, OOSmallFragmentBurstEntity::fragmentBurstFromEntity:, HeadUpDisplay::hudDrawReticleOnTarget, OOExplosionCloudEntity(OOPrivate)::initExplosionCloudWithEntity:size:andSettings:, OORingEffectEntity::initRingFromEntity:, Universe::makeDemoShipWithRole:spinning:, maxEnergy, PlanetEntity::miniaturize, Universe::safeWitchspaceExitDistance, PlayerEntity::showShipModelWithKey:shipData:personality:factorX:factorY:factorZ:inContext:, WormholeEntity::suckInShip:, and PlayerEntity(OOPrivate)::updateAlertConditionForNearbyEntities.

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

◆ collisionRegion

◆ compareZeroDistance:

- (NSComparisonResult) compareZeroDistance: (Entity*) otherEntity

Reimplemented in PlayerEntity.

Definition at line 658 of file Entity.m.

658 :(Entity*)otherEntity
659{
660 if ((otherEntity) && (zero_distance > otherEntity->zero_distance))
661 return NSOrderedAscending;
662 else
663 return NSOrderedDescending;
664}
GLfloat zero_distance
Definition Entity.h:104

References zero_distance.

◆ dealloc

- (void) dealloc
implementation

Reimplemented from OOWeakRefObject.

Reimplemented in DockEntity, DustEntity, OOEntityWithDrawable, OOExplosionCloudEntity, OOFlasherEntity, OOLaserShotEntity, OOSunEntity, OOVisualEffectEntity, OOWaypointEntity, PlanetEntity, PlayerEntity, ShipEntity, SkyEntity, StationEntity, and WormholeEntity.

Definition at line 98 of file Entity.m.

99{
100 [UNIVERSE ensureEntityReallyRemoved:self];
103 [self deleteJSSelf];
104 [self setOwner:nil];
105 [atmosphereFogging release];
106
107#ifdef OO_DEBUG_MONITOR_ENABLED
108 gLiveEntityCount--;
109 gTotalEntityMemory -= [self oo_objectSize];
110#endif
111
112 [super dealloc];
113}
#define DESTROY(x)
CollisionRegion * collisionRegion
Definition Entity.m:505

References collidingEntities, collisionRegion, dealloc, OOWeakRefObject::dealloc, deleteJSSelf, DESTROY, and setOwner:.

Referenced by DustEntity::dealloc, dealloc, OOEntityWithDrawable::dealloc, OOExplosionCloudEntity::dealloc, OOFlasherEntity::dealloc, OOLaserShotEntity::dealloc, OOSunEntity::dealloc, OOWaypointEntity::dealloc, PlanetEntity::dealloc, and WormholeEntity::dealloc.

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

◆ deleteJSSelf [1/2]

- (void) deleteJSSelf

Provided by category Entity(OOJavaScriptExtensions).

Definition at line 78 of file EntityOOJavaScriptExtensions.m.

79{
80 if (JS_IsObject(_jsSelf)) {
81 /* Scripts may still hold the JS object. Its private data is a weak
82 reference, so it becomes stale (isValid false) when the entity is
83 deallocated.
84 */
85 JS_FreeValue(OOJSAcquireContext(), _jsSelf);
86 _jsSelf = JS_UNDEFINED;
87
88 [[NSNotificationCenter defaultCenter] removeObserver:self
89 name:kOOJavaScriptEngineWillResetNotification
91 }
92}
OOINLINE JSContext * OOJSAcquireContext(void)
struct JSObject * _jsSelf
Definition Entity.h:151
OOJavaScriptEngine * sharedEngine()

Referenced by dealloc, and PlayerEntity(OOJavaScriptExtensions)::setJSSelf:context:.

Here is the caller graph for this function:

◆ deleteJSSelf [2/2]

- (void) deleteJSSelf

Provided by category Entity(OOJavaScriptExtensions).

◆ descriptionComponents

- (NSString *) descriptionComponents
implementation

Reimplemented in OOLaserShotEntity, OOParticleSystem, OOQuiriumCascadeEntity, OORingEffectEntity, OOSunEntity, PlanetEntity, ShipEntity, StationEntity, and WormholeEntity.

Definition at line 115 of file Entity.m.

116{
117 return [NSString stringWithFormat:@"position: %@ scanClass: %@ status: %@", HPVectorDescription([self position]), OOStringFromScanClass([self scanClass]), OOStringFromEntityStatus([self status])];
118}

References descriptionComponents, position, scanClass, and status.

Referenced by descriptionComponents, OOLaserShotEntity::descriptionComponents, and ShipEntity::descriptionComponents.

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

◆ distanceTravelled

- (GLfloat) distanceTravelled

References distanceTravelled, and status.

Here is the call graph for this function:

◆ drawImmediate:translucent:

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

Reimplemented in DockEntity, DustEntity, OOBreakPatternEntity, OOECMBlastEntity, OOEntityWithDrawable, OOFlasherEntity, OOLaserShotEntity, OOLightParticleEntity, OOParticleSystem, OOQuiriumCascadeEntity, OORingEffectEntity, OOSunEntity, OOVisualEffectEntity, OOWaypointEntity, PlanetEntity, PlayerEntity, ShipEntity, SkyEntity, and WormholeEntity.

Definition at line 894 of file Entity.m.

894 :(bool)immediate translucent:(bool)translucent
895{
897}
#define OOLogGenericSubclassResponsibility()
Definition OOLogging.h:141

References OOLogGenericSubclassResponsibility.

Referenced by Universe::drawUniverse.

Here is the caller graph for this function:

◆ drawRotationMatrix

- (OOMatrix) drawRotationMatrix

Reimplemented in PlayerEntity.

Definition at line 808 of file Entity.m.

809{
810 return rotMatrix;
811}

References drawRotationMatrix, and rotMatrix.

Referenced by ShipEntity::absoluteIJKForSubentity, absolutePositionForSubentityOffset:, OOLightParticleEntity::drawImmediate:translucent:, drawRotationMatrix, OOLightParticleEntity::drawSubEntityImmediate:translucent:, ShipEntity::fireTurretCannon:, OOLaserShotEntity::initLaserFromShip:direction:offset:, maxEnergy, and OOLaserShotEntity::update:.

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

◆ drawSubEntityImmediate:translucent:

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

Reimplemented in OOExhaustPlumeEntity, OOFlasherEntity, OOLightParticleEntity, OOVisualEffectEntity, and ShipEntity.

Provided by category Entity(SubEntityRelationship).

Definition at line 12975 of file ShipEntity.m.

12975 :(bool)immediate translucent:(bool)translucent
12976{
12977 // Do nothing.
12978}

Referenced by OOVisualEffectEntity::drawImmediate:translucent:, and ShipEntity::drawImmediate:translucent:.

Here is the caller graph for this function:

◆ drawTransformationMatrix

- (OOMatrix) drawTransformationMatrix

Reimplemented in PlayerEntity.

Definition at line 819 of file Entity.m.

820{
821 OOMatrix result = rotMatrix;
822 return OOMatrixHPTranslate(result, position);
823}
OOINLINE OOMatrix OOMatrixHPTranslate(OOMatrix m, HPVector offset) INLINE_CONST_FUNC
Definition OOMatrix.h:259
struct OOMatrix OOMatrix

References drawTransformationMatrix, OOMatrixHPTranslate(), position, and rotMatrix.

Referenced by drawTransformationMatrix, maxEnergy, and OOExhaustPlumeEntity::resetPlume.

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

◆ dumpSelfState

- (void) dumpSelfState

Reimplemented in StationEntity, and WormholeEntity.

Definition at line 918 of file Entity.m.

919{
920 NSMutableArray* flags = nil;
921 NSString* flagsString = nil;
922 id owner = [self owner];
923
924 if (owner == self)
925 owner = @"self";
926 else if (owner == nil)
927 owner = @"none";
928
929 OOLog(@"dumpState.entity", @"Universal ID: %u", universalID);
930 OOLog(@"dumpState.entity", @"Scan class: %@", OOStringFromScanClass(scanClass));
931 OOLog(@"dumpState.entity", @"Status: %@", OOStringFromEntityStatus([self status]));
932 OOLog(@"dumpState.entity", @"Position: %@", HPVectorDescription(position));
933 OOLog(@"dumpState.entity", @"Orientation: %@", QuaternionDescription(orientation));
934 OOLog(@"dumpState.entity", @"Distance travelled: %g", distanceTravelled);
935 OOLog(@"dumpState.entity", @"Energy: %g of %g", energy, maxEnergy);
936 OOLog(@"dumpState.entity", @"Mass: %g", mass);
937 OOLog(@"dumpState.entity", @"Owner: %@", owner);
938
939 flags = [NSMutableArray array];
940#define ADD_FLAG_IF_SET(x) \
941 if (x) { \
942 [flags addObject:@ #x]; \
943 }
953 flagsString = [flags count] ? [flags componentsJoinedByString:@", "] : (NSString*)@"none";
954 OOLog(@"dumpState.entity", @"Flags: %@", flagsString);
955 OOLog(@"dumpState.entity", @"Collision Test Filter: %u", collisionTestFilter);
956}
NSString * OOStringFromScanClass(OOScanClass scanClass) CONST_FUNC
NSString * OOStringFromEntityStatus(OOEntityStatus status) CONST_FUNC
#define ADD_FLAG_IF_SET(x)
unsigned throw_sparks
Definition Entity.h:97
GLfloat maxEnergy
Definition Entity.m:763
OOUniversalID universalID
Definition Entity.m:522
unsigned hasMoved
Definition Entity.h:92
GLfloat energy
Definition Entity.m:753
unsigned isShip
Definition Entity.m:125
unsigned collisionTestFilter
Definition Entity.h:96
OOScanClass scanClass
Definition Entity.m:743
OOEntityStatus status()
Definition Entity.m:733
unsigned isWormhole
Definition Entity.m:175
GLfloat distanceTravelled
Definition Entity.m:718
unsigned isStation
Definition Entity.m:135
unsigned isPlayer
Definition Entity.m:145
unsigned isSunlit
Definition Entity.m:160
GLfloat mass
Definition Entity.m:671

References ADD_FLAG_IF_SET, collisionTestFilter, distanceTravelled, dumpSelfState, energy, hasMoved, hasRotated, isPlayer, isShip, isStation, isSubEntity, isSunlit, isWormhole, mass, maxEnergy, nil, OOLog, OOStringFromEntityStatus(), OOStringFromScanClass(), orientation, owner, position, scanClass, status, throw_sparks, and universalID.

Referenced by dumpSelfState, StationEntity::dumpSelfState, WormholeEntity::dumpSelfState, dumpState, and maxEnergy.

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

◆ dumpState

- (void) dumpState

Definition at line 903 of file Entity.m.

904{
905 if (OOLogWillDisplayMessagesInClass(@"dumpState")) {
906 OOLog(@"dumpState", @"State for %@:", self);
908 OOLogIndent();
909 @try {
910 [self dumpSelfState];
911 }
912 @catch (id exception) {
913 }
915 }
916}
void OOLogPushIndent(void)
Definition OOLogging.m:301
void OOLogPopIndent(void)
Definition OOLogging.m:323
BOOL OOLogWillDisplayMessagesInClass(NSString *inMessageClass)
Definition OOLogging.m:136
void OOLogIndent(void)
Definition OOLogging.m:345

References dumpSelfState, dumpState, OOLog, OOLogIndent(), OOLogPopIndent(), OOLogPushIndent(), and OOLogWillDisplayMessagesInClass().

Referenced by dumpState, maxEnergy, and PlayerEntity(OOPrivate)::updateTargeting.

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

◆ energy

- (GLfloat) energy

References energy.

◆ findCollisionRadius

- (double) findCollisionRadius

Reimplemented in OOEntityWithDrawable, OOExhaustPlumeEntity, and OOFlasherEntity.

Definition at line 888 of file Entity.m.

889{
891 return 0;
892}

References findCollisionRadius, and OOLogGenericSubclassResponsibility.

Referenced by findCollisionRadius, and lastDrawCounter.

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

◆ fogUniform

- (OOColor *) fogUniform

Definition at line 996 of file Entity.m.

997{
998 return [[atmosphereFogging retain] autorelease];
999}

References fogUniform.

Referenced by fogUniform, and spawnTime.

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

◆ frustumRadius

- (GLfloat) frustumRadius

Reimplemented in OOVisualEffectEntity, and ShipEntity.

Definition at line 835 of file Entity.m.

836{
837 return collision_radius;
838}

References collision_radius, and frustumRadius.

Referenced by cameraRangeBack, cameraRangeFront, frustumRadius, and maxEnergy.

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

◆ getJSClass:andPrototype:

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

Reimplemented in DockEntity, OOExhaustPlumeEntity, OOFlasherEntity, OOSunEntity, OOVisualEffectEntity, OOWaypointEntity, ShipEntity, StationEntity, and WormholeEntity.

Provided by category Entity(OOJavaScriptExtensions).

Definition at line 81 of file EntityOOJavaScriptExtensions.m.

81 :(JSClass**)outClass andPrototype:(JSObject**)outPrototype
82{
83 *outClass = JSEntityClass();
84 *outPrototype = JSEntityPrototype();
85}
OOINLINE JSClass * JSEntityClass(void)
Definition OOJSEntity.h:42
OOINLINE JSObject * JSEntityPrototype(void)
Definition OOJSEntity.h:43

Referenced by Entity(OOJavaScriptExtensions)::oo_jsValueInContext:.

Here is the caller graph for this function:

◆ init

- (id) init
implementation

Reimplemented in DustEntity, OOParticleSystem, OOSunEntity, OOVisualEffectEntity, PlanetEntity, PlayerEntity, ShipEntity, and WormholeEntity.

Definition at line 64 of file Entity.m.

65{
66 self = [super init];
67 if (EXPECT_NOT(self == nil))
68 return nil;
69
70 _sessionID = [UNIVERSE sessionID];
71
75
76 no_draw_distance = 100000.0; // 10 km
77
78 collidingEntities = [[NSMutableArray alloc] init];
79
80 scanClass = CLASS_NOT_SET;
81 [self setStatus:STATUS_COCKPIT_DISPLAY];
82
83 spawnTime = [UNIVERSE getTime];
84
85 isSunlit = YES;
86
87 atmosphereFogging = [[OOColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0] retain];
88
89#ifdef OO_DEBUG_MONITOR_ENABLED
90 gLiveEntityCount++;
91 gTotalEntityMemory += [self oo_objectSize];
92#endif
93
95 return self;
96}
#define EXPECT_NOT(x)
const HPVector kZeroHPVector
Definition OOHPVector.m:27
const OOMatrix kIdentityMatrix
Definition OOMatrix.m:28
const Quaternion kIdentityQuaternion
OOColor * atmosphereFogging
Definition Entity.h:111
OOTimeAbsolute spawnTime
Definition Entity.m:980
NSUInteger lastDrawCounter
Definition Entity.m:963
NSUInteger _sessionID
Definition Entity.h:156
GLfloat no_draw_distance
Definition Entity.h:106
OOColor * colorWithRed:green:blue:alpha:(float red,[green] float green,[blue] float blue,[alpha] float alpha)
Definition OOColor.m:107

References _sessionID, atmosphereFogging, collidingEntities, OOColor::colorWithRed:green:blue:alpha:, EXPECT_NOT, init, isSunlit, kIdentityMatrix, kIdentityQuaternion, kZeroHPVector, lastDrawCounter, nil, no_draw_distance, orientation, position, rotMatrix, scanClass, setStatus:, and spawnTime.

Referenced by DustEntity::init, init, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, ShipEntity(Hax)::initBypassForPlayer, OOExhaustPlumeEntity::initForShip:withDefinition:andScale:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, OOECMBlastEntity::initFromShip:, OOLaserShotEntity::initLaserFromShip:direction:offset:, OOQuiriumCascadeEntity::initQuiriumCascadeFromShip:, OORingEffectEntity::initRingFromEntity:, OOSunEntity::initSunWithColor:andDictionary:, SkyEntity::initWithColors:col2:andSystemInfo:, OOLightParticleEntity::initWithDiameter:, OOWaypointEntity::initWithDictionary:, OOVisualEffectEntity::initWithKey:definition:, ShipEntity::initWithKey:definition:, and OOBreakPatternEntity::initWithPolygonSides:startAngle:aspectRatio:.

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

◆ isBreakPattern

- (BOOL) isBreakPattern

Reimplemented in OOBreakPatternEntity, and OOVisualEffectEntity.

Provided by category Entity(OOBreakPatternEntity).

Definition at line 164 of file OOBreakPatternEntity.m.

165{
166 return NO;
167}

◆ isCascadeWeapon

- (BOOL) isCascadeWeapon

Reimplemented in OOQuiriumCascadeEntity.

Provided by category Entity(OOQuiriumCascadeExtensions).

Definition at line 160 of file OOQuiriumCascadeEntity.m.

161{
162 return NO;
163}

Referenced by PlayerEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, and StationEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:.

Here is the caller graph for this function:

◆ isDock

- (BOOL) isDock

Reimplemented in DockEntity.

Definition at line 130 of file Entity.m.

131{
132 return NO;
133}

References isDock.

Referenced by isDock, and isShip.

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

◆ isECMBlast

- (BOOL) isECMBlast

Reimplemented in OOECMBlastEntity.

Provided by category Entity(OOECMBlastEntity).

Definition at line 119 of file OOECMBlastEntity.m.

120{
121 return NO;
122}

◆ isEffect

- (BOOL) isEffect

Reimplemented in OOLaserShotEntity, OOLightParticleEntity, OOParticleSystem, OOQuiriumCascadeEntity, OORingEffectEntity, OOVisualEffectEntity, and OOWaypointEntity.

Definition at line 180 of file Entity.m.

181{
182 return NO;
183}

References isEffect.

Referenced by OOParticleSystem::checkCloseCollisionWith:, OOPlasmaShotEntity::checkCloseCollisionWith:, WormholeEntity::checkCloseCollisionWith:, isEffect, and isWormhole.

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

◆ isExhaust

- (BOOL) isExhaust

Reimplemented in OOExhaustPlumeEntity.

Provided by category Entity(OOExhaustPlume).

Definition at line 676 of file OOExhaustPlumeEntity.m.

677{
678 return NO;
679}

◆ isFlasher

- (BOOL) isFlasher

Reimplemented in OOFlasherEntity.

Provided by category Entity(OOFlasherEntityExtensions).

Definition at line 212 of file OOFlasherEntity.m.

213{
214 return NO;
215}

◆ isImmuneToBreakPatternHide

References isImmuneToBreakPatternHide, and universalTime.

Here is the call graph for this function:

◆ isInSpace

- (BOOL) isInSpace

Definition at line 1033 of file Entity.m.

1034{
1035 switch ([self status]) {
1036 case STATUS_IN_FLIGHT:
1037 case STATUS_DOCKING:
1038 case STATUS_LAUNCHING:
1039 case STATUS_AUTOPILOT_ENGAGED:
1040 case STATUS_WITCHSPACE_COUNTDOWN:
1041 case STATUS_BEING_SCOOPED:
1042 case STATUS_EFFECT:
1043 case STATUS_ACTIVE:
1044 return YES;
1045 default:
1046 return NO;
1047 }
1048}

References isInSpace, and status.

Referenced by ShipEntity::dealMomentumWithinDesiredRange:, isInSpace, lastDrawCounter, PlayerEntity::moveTargetMemoryBy:, and PlayerEntity::validateCompassTarget.

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

◆ isPlanet

- (BOOL) isPlanet

Reimplemented in PlanetEntity.

Definition at line 150 of file Entity.m.

151{
152 return NO;
153}

References isPlanet.

Referenced by ShipEntity::behaviour_land_on_planet:, isPlanet, isPlayer, isStellarObject, and PlayerEntity::lookingAtSunWithThresholdAngleCos:.

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

◆ isPlayer

- (BOOL) isPlayer

References isPlanet, isPlayer, and isSun.

Here is the call graph for this function:

◆ isPlayerLikeShip

- (BOOL) isPlayerLikeShip

Reimplemented in PlayerEntity, and ProxyPlayerEntity.

Provided by category Entity(ProxyPlayer).

Definition at line 194 of file ProxyPlayerEntity.m.

195{
196 return NO;
197}

◆ isShip

- (BOOL) isShip

References isDock, and isShip.

Here is the call graph for this function:

◆ isShipWithSubEntityShip:

- (BOOL) isShipWithSubEntityShip: (Entity*) other

Reimplemented in OOVisualEffectEntity, and ShipEntity.

Provided by category Entity(SubEntityRelationship).

Definition at line 12970 of file ShipEntity.m.

12970 :(Entity*)other
12971{
12972 return NO;
12973}

◆ isSky

- (BOOL) isSky

Reimplemented in SkyEntity.

Definition at line 170 of file Entity.m.

171{
172 return NO;
173}

References isSky.

Referenced by isSky, and isSunlit.

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

◆ isStation

- (BOOL) isStation

References isStation.

◆ isStellarObject

- (BOOL) isStellarObject

Definition at line 165 of file Entity.m.

166{
167 return [self isPlanet] || [self isSun];
168}

References isPlanet, isStellarObject, and isSun.

Referenced by Universe::drawUniverse, isStellarObject, isSunlit, and ShipEntity::manageCollisions.

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

◆ isSubEntity

- (BOOL) isSubEntity

References isSubEntity.

◆ isSun

- (BOOL) isSun

Reimplemented in OOSunEntity.

Definition at line 155 of file Entity.m.

156{
157 return NO;
158}

References isSun.

Referenced by PlayerEntity(OOPrivate)::checkEntityForMassLock:withScanClass:, ShipEntity::checkForAegis, isPlayer, isStellarObject, isSun, IsSunPredicate(), and ShipEntity::manageCollisions.

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

◆ isSunlit

- (BOOL) isSunlit

References isSky, isStellarObject, and isSunlit.

Here is the call graph for this function:

◆ isVisible

- (BOOL) isVisible

Reimplemented in OOSunEntity, PlanetEntity, ShipEntity, and SkyEntity.

Definition at line 1028 of file Entity.m.

1029{
1031}
#define ABSOLUTE_NO_DRAW_DISTANCE2
Definition Entity.h:50

References ABSOLUTE_NO_DRAW_DISTANCE2, cam_zero_distance, and isVisible.

Referenced by isVisible, lastDrawCounter, and OOExhaustPlumeEntity::update:.

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

◆ isVisibleToScripts [1/2]

- (BOOL) isVisibleToScripts

Reimplemented in OOExhaustPlumeEntity, OOExhaustPlumeEntity, OOFlasherEntity, OOFlasherEntity, OOSunEntity, OOVisualEffectEntity, OOVisualEffectEntity, OOWaypointEntity, OOWaypointEntity, ShipEntity, WormholeEntity, and WormholeEntity.

Provided by category Entity(OOJavaScriptExtensions).

Definition at line 38 of file EntityOOJavaScriptExtensions.m.

39{
40 return NO;
41}

Referenced by JSEntityIsJavaScriptVisiblePredicate().

Here is the caller graph for this function:

◆ isVisibleToScripts [2/2]

◆ isVisualEffect

- (BOOL) isVisualEffect

Reimplemented in OOVisualEffectEntity.

References addToLinkedLists, isVisualEffect, isWaypoint, removeFromLinkedLists, updateLinkedLists, validForAddToUniverse, warnAboutHostiles, wasAddedToUniverse, and wasRemovedFromUniverse.

Here is the call graph for this function:

◆ isWaypoint

- (BOOL) isWaypoint

Reimplemented in OOWaypointEntity.

Definition at line 190 of file Entity.m.

191{
192 return NO;
193}

References isWaypoint.

Referenced by isVisualEffect, and isWaypoint.

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

◆ isWormhole

- (BOOL) isWormhole

References isEffect, and isWormhole.

Here is the call graph for this function:

◆ lastDrawCounter

- (NSUInteger) lastDrawCounter

References findCollisionRadius, isInSpace, isVisible, and lastDrawCounter.

Here is the call graph for this function:

◆ mass

- (GLfloat) mass

References mass.

◆ maxEnergy

- (GLfloat) maxEnergy

References canCollide, collisionArray, collisionRadius, drawRotationMatrix, drawTransformationMatrix, dumpSelfState, dumpState, frustumRadius, maxEnergy, rotationMatrix, and transformationMatrix.

Here is the call graph for this function:

◆ moveForward:

- (void) moveForward: (double) amount

Reimplemented in PlayerEntity.

Definition at line 796 of file Entity.m.

796 :(double)amount
797{
799 position = HPvector_add(position, forward);
800 distanceTravelled += amount;
801}
HPVector HPvector_forward_from_quaternion(Quaternion quat) CONST_FUNC

References distanceTravelled, HPvector_add(), HPvector_forward_from_quaternion(), HPvector_multiply_scalar(), orientation, and position.

Referenced by ShipEntity::applyThrust:.

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

◆ normalOrientation

- (Quaternion) normalOrientation

Reimplemented in PlayerEntity.

Definition at line 687 of file Entity.m.

688{
689 return [self orientation];
690}

References normalOrientation, and orientation.

Referenced by ShipEntity::absoluteTractorPosition, ShipEntity::ballTrackLeadingTarget:atTarget:, ShipEntity::becomeExplosion, ShipEntity::dumpItem:, ShipEntity::fireMissileWithIdentifier:andTarget:, Universe::firstShipHitByLaserFromShip:inDirection:offset:gettingRangeFound:, OOLaserShotEntity::initLaserFromShip:direction:offset:, normalOrientation, orientation, ShipEntity(LoadRestore)::savedShipDictionaryWithContext:, OOExhaustPlumeEntity(Private)::saveToLastFrame, ShipEntity::throwSparks, OOExhaustPlumeEntity::update:, and OOLaserShotEntity::update:.

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

◆ oo_jsClassID

- (JSClassID) oo_jsClassID

◆ oo_jsClassName [1/2]

◆ oo_jsClassName [2/2]

◆ oo_jsValueInContext:

- (JSValue) oo_jsValueInContext: (JSContext*) context
implementation

Provided by category Entity(OOJavaScriptExtensions).

Definition at line 49 of file EntityOOJavaScriptExtensions.m.

49 :(JSContext*)context
50{
51 JSClass* class = NULL;
52 JSObject* prototype = NULL;
53 jsval result = JSVAL_NULL;
54
55 if (_jsSelf == NULL && [self isVisibleToScripts]) {
56 // Create JS object
57 [self getJSClass:&class andPrototype:&prototype];
58
59 _jsSelf = JS_NewObject(context, class, prototype, NULL);
60 if (_jsSelf != NULL) {
61 if (!JS_SetPrivate(context, _jsSelf, OOConsumeReference([self weakRetain])))
62 _jsSelf = NULL;
63 }
64
65 if (_jsSelf != NULL) {
66 OOJSAddGCObjectRoot(context, &_jsSelf, "Entity jsSelf");
67 [[NSNotificationCenter defaultCenter] addObserver:self
68 selector:@selector(deleteJSSelf)
69 name:kOOJavaScriptEngineWillResetNotification
71 }
72 }
73
74 if (_jsSelf != NULL)
75 result = OBJECT_TO_JSVAL(_jsSelf);
76
77 return result;
78 // Analyzer: object leaked. [Expected, object is retained by JS object.]
79}
id OOConsumeReference(id OO_NS_CONSUMED value)
#define OOJSAddGCObjectRoot(context, root, name)

Referenced by JSFunctionPredicate(), MissionRunScreen(), and MissionRunScreen().

Here is the caller graph for this function:

◆ orientation

References normalOrientation, orientation, and orientationChanged.

Here is the call graph for this function:

◆ orientationChanged

- (void) orientationChanged

Reimplemented in OOVisualEffectEntity, PlayerEntity, and ShipEntity.

Definition at line 697 of file Entity.m.

698{
701}
OOMatrix OOMatrixForQuaternionRotation(Quaternion orientation)
Definition OOMatrix.m:56
OOINLINE void quaternion_normalize(Quaternion *quat) NONNULL_FUNC ALWAYS_INLINE_FUNC

References OOMatrixForQuaternionRotation(), orientation, orientationChanged, quaternion_normalize(), and rotMatrix.

Referenced by applyRoll:andClimb:, applyRoll:climb:andYaw:, orientation, orientationChanged, OOVisualEffectEntity::orientationChanged, ShipEntity::orientationChanged, setOrientation:, and PlanetEntity::update:.

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

◆ owner

- (id) owner

Definition at line 548 of file Entity.m.

549{
550 return [_owner weakRefUnderlyingObject];
551}

References owner, and OOWeakReference::weakRefUnderlyingObject.

Referenced by ShipEntity::abandonShip, ShipEntity::absoluteIJKForSubentity, absolutePositionForSubentityOffset:, ShipEntity::adjustMissedShots:, ShipEntity::ballTrackLeadingTarget:atTarget:, ShipEntity::behaviour_formation_form_up:, ShipEntity::behaviour_track_as_turret:, ShipEntity::behaviour_tractored:, OOParticleSystem::checkCloseCollisionWith:, OOPlasmaShotEntity::checkCloseCollisionWith:, ShipEntity::dealEnergyDamage:atRange:withBias:, ShipEntity::dealEnergyDamageWithinDesiredRange, ShipEntity::dockEscorts, OOLightParticleEntity::drawImmediate:translucent:, ShipEntity::drawImmediate:translucent:, OOExhaustPlumeEntity::drawSubEntityImmediate:translucent:, OOLightParticleEntity::drawSubEntityImmediate:translucent:, dumpSelfState, EntityGetProperty(), EntityGetProperty(), ShipEntity(PureAI)::escortCheckMother, ExhaustPlumeRemove(), ExhaustPlumeRemove(), ShipEntity(PureAI)::fightOrFleeMissile, ShipEntity::fireMissileWithIdentifier:andTarget:, ShipEntity::fireSubentityLaserShot:, ShipEntity::fireTurretCannon:, FlasherRemove(), FlasherRemove(), OOQuiriumCascadeEntity::initQuiriumCascadeFromShip:, ShipEntity(PureAI)::messageMother:, ShipEntity::missedShots, owner, parentEntity, OOExhaustPlumeEntity::resetPlume, OOExhaustPlumeEntity(Private)::saveToLastFrame, ShipEntity(Private)::setUpOneEscort:inGroup:withRole:atPosition:andCount:, DockEntity::shipIsInDockingQueue:, ShipEntity(ScriptMethods)::spawnShipsWithRole:count:, PlayerEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, ShipEntity::takeHeatDamage:, ShipEntity(PureAI)::thargonCheckMother, universalID, update:, OOExhaustPlumeEntity::update:, OOLaserShotEntity::update:, OOPlasmaShotEntity::update:, OOQuiriumCascadeEntity::update:, ShipEntity::update:, VisualEffectRemove(), and VisualEffectRemove().

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

◆ parentEntity

◆ position

References position.

◆ pseudoFixedD100

- (unsigned) pseudoFixedD100
implementation

Provided by category Entity(ShaderBindings).

Definition at line 41 of file EntityShaderBindings.m.

42{
43 return [PLAYER systemPseudoRandom100];
44}

◆ pseudoFixedD256

- (unsigned) pseudoFixedD256
implementation

Provided by category Entity(ShaderBindings).

Definition at line 46 of file EntityShaderBindings.m.

47{
48 return [PLAYER systemPseudoRandom256];
49}

◆ relativePosition

- (Vector) relativePosition
implementation

Definition at line 598 of file Entity.m.

599{
601}
OOINLINE HPVector HPvector_subtract(HPVector a, HPVector b) INLINE_CONST_FUNC
Definition OOHPVector.h:236
OOINLINE Vector HPVectorToVector(HPVector v) INLINE_CONST_FUNC
Definition OOHPVector.h:175
#define PLAYER

References HPvector_subtract(), HPVectorToVector(), PLAYER, position, and relativePosition.

Referenced by PlayerEntity::lookingAtSunWithThresholdAngleCos:, ShipEntity::lookingAtSunWithThresholdAngleCos:, and relativePosition.

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

◆ removeFromLinkedLists

- (void) removeFromLinkedLists

Definition at line 269 of file Entity.m.

270{
271#ifdef OO_DEBUG_MONITOR_ENABLED
273 OOLog(kOOLogEntityRemoveFromList, @"DEBUG removing entity %@ from linked lists", self);
274#endif
275
276 if ((x_next == nil) && (x_previous == nil)) // removed already!
277 return;
278
279 // make sure the starting point is still correct
280 if (UNIVERSE) {
281 if ((UNIVERSE->x_list_start == self) && (x_next))
282 UNIVERSE->x_list_start = x_next;
283 if ((UNIVERSE->y_list_start == self) && (y_next))
284 UNIVERSE->y_list_start = y_next;
285 if ((UNIVERSE->z_list_start == self) && (z_next))
286 UNIVERSE->z_list_start = z_next;
287 }
288 //
289 if (x_previous)
290 x_previous->x_next = x_next;
291 if (x_next)
292 x_next->x_previous = x_previous;
293 //
294 if (y_previous)
295 y_previous->y_next = y_next;
296 if (y_next)
297 y_next->y_previous = y_previous;
298 //
299 if (z_previous)
300 z_previous->z_next = z_next;
301 if (z_next)
302 z_next->z_previous = z_previous;
303 //
304 x_previous = nil;
305 x_next = nil;
306 y_previous = nil;
307 y_next = nil;
308 z_previous = nil;
309 z_next = nil;
310
311#ifdef OO_DEBUG_MONITOR_ENABLED
313 if (![self checkLinkedLists]) {
314 OOLog(kOOLogEntityRemoveFromListError, @"DEBUG LINKED LISTS - problem encountered while removing %@ from linked lists", self);
315 [UNIVERSE debugDumpEntities];
316 }
317 }
318#endif
319}

References checkLinkedLists, DEBUG_LINKED_LISTS, gDebugFlags, nil, OOLog, removeFromLinkedLists, UNIVERSE, x_next, x_previous, y_next, y_previous, z_next, and z_previous.

Referenced by Universe(OOPrivate)::doRemoveEntity:, isVisualEffect, and removeFromLinkedLists.

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

◆ rootShipEntity

- (ShipEntity *) rootShipEntity

Definition at line 566 of file Entity.m.

567{
568 ShipEntity* parent = [self parentEntity];
569 if (parent != nil)
570 return [parent rootShipEntity];
571 if ([self isShip])
572 return (ShipEntity*)self;
573 return nil;
574}
ShipEntity * rootShipEntity()
Definition Entity.m:566

References isShip, nil, parentEntity, and rootShipEntity.

Referenced by OOPlasmaShotEntity::checkCloseCollisionWith:, ShipEntity::entityForShaderProperties, ShipEntity::fireTurretCannon:, OOLaserShotEntity::initLaserFromShip:direction:offset:, rootShipEntity, ShipEntity(ScriptMethods)::spawnShipsWithRole:count:, ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, universalID, and OOPlasmaShotEntity::update:.

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

◆ rotationMatrix

- (OOMatrix) rotationMatrix

Definition at line 803 of file Entity.m.

804{
805 return rotMatrix;
806}

References rotationMatrix, and rotMatrix.

Referenced by maxEnergy, and rotationMatrix.

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

◆ scanClass

Reimplemented in ShipEntity.

References scanClass.

◆ sessionID

- (NSUInteger) sessionID

Reimplemented in PlayerEntity.

Definition at line 120 of file Entity.m.

121{
122 return _sessionID;
123}

References _sessionID, and sessionID.

Referenced by sessionID, and validForAddToUniverse.

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

◆ setAtmosphereFogging:

- (void) setAtmosphereFogging: (OOColor*) fogging

Definition at line 990 of file Entity.m.

990 :(OOColor*)fogging
991{
992 [atmosphereFogging release];
993 atmosphereFogging = [fogging retain];
994}

References atmosphereFogging.

Referenced by Universe::drawUniverse.

Here is the caller graph for this function:

◆ setCollisionRadius:

- (void) setCollisionRadius: (GLfloat) amount

Definition at line 840 of file Entity.m.

840 :(GLfloat)amount
841{
842 collision_radius = amount;
843}

References collision_radius.

Referenced by OOPlasmaBurstEntity::initWithPosition:, OOSparkEntity::initWithPosition:velocity:duration:size:color:, OOPlasmaShotEntity::initWithPosition:velocity:energy:duration:color:, and OOLaserShotEntity::setRange:.

Here is the caller graph for this function:

◆ setCollisionRegion:

- (void) setCollisionRegion: (CollisionRegion*) region

Definition at line 510 of file Entity.m.

510 :(CollisionRegion*)region
511{
512 if (collisionRegion)
513 [collisionRegion release];
514 collisionRegion = [region retain];
515}

References collisionRegion.

Referenced by CollisionRegion::checkEntity:.

Here is the caller graph for this function:

◆ setDistanceTravelled:

- (void) setDistanceTravelled: (GLfloat) value

Definition at line 723 of file Entity.m.

723 :(GLfloat)value
724{
725 distanceTravelled = value;
726}

References distanceTravelled.

Referenced by ShipEntity::fireMissileWithIdentifier:andTarget:.

Here is the caller graph for this function:

◆ setEnergy:

- (void) setEnergy: (GLfloat) amount

Definition at line 748 of file Entity.m.

748 :(GLfloat)amount
749{
750 energy = amount;
751}

References energy.

Referenced by Universe::addWreckageFrom:withRole:at:scale:lifetime:, ShipEntity::deserializeShipSubEntitiesFrom:, EntitySetProperty(), EntitySetProperty(), ShipEntity::fireSubentityLaserShot:, OOPlasmaShotEntity::initWithPosition:velocity:energy:duration:color:, ShipEntity::launchCascadeMine, Universe::setUpSpace, and ShipEntity(LoadRestore)::shipRestoredFromDictionary:useFallback:context:.

Here is the caller graph for this function:

◆ setLastDrawCounter:

- (void) setLastDrawCounter: (NSUInteger) drawCounter

Definition at line 968 of file Entity.m.

968 :(NSUInteger)drawCounter
969{
970 lastDrawCounter = drawCounter;
971 return;
972}

References lastDrawCounter.

Referenced by Universe::drawUniverse.

Here is the caller graph for this function:

◆ setMaxEnergy:

- (void) setMaxEnergy: (GLfloat) amount

Definition at line 758 of file Entity.m.

758 :(GLfloat)amount
759{
760 maxEnergy = amount;
761}

References maxEnergy.

Referenced by EntitySetProperty(), and EntitySetProperty().

Here is the caller graph for this function:

◆ setNormalOrientation:

- (void) setNormalOrientation: (Quaternion) quat

Reimplemented in PlayerEntity.

Definition at line 692 of file Entity.m.

692 :(Quaternion)quat
693{
694 [self setOrientation:quat];
695}
struct Quaternion Quaternion

References setOrientation:.

Referenced by EntitySetProperty(), EntitySetProperty(), DockEntity::launchShip:, ShipEntity(LoadRestore)::shipRestoredFromDictionary:useFallback:context:, WaypointSetProperty(), and WaypointSetProperty().

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

◆ setOrientation:

- (void) setOrientation: (Quaternion) quat

Reimplemented in OOWaypointEntity, and PlanetEntity.

Definition at line 676 of file Entity.m.

676 :(Quaternion)quat
677{
678 orientation = quat;
679 [self orientationChanged];
680}

References orientation, and orientationChanged.

Referenced by Universe::addShipAt:withRole:withinRadius:, Universe::addShips:withRole:atPosition:withCoordinateSystem:, Universe::addWreckageFrom:withRole:at:scale:lifetime:, ShipEntity::becomeExplosion, WormholeEntity::disgorgeShips, PlayerEntity::docked, ShipEntity::dumpItem:, PlayerEntity::enterDock:, ShipEntity::fireDirectLaserShotAt:, ShipEntity::fireMissileWithIdentifier:andTarget:, OOLaserShotEntity::initLaserFromShip:direction:offset:, OORingEffectEntity::initRingFromEntity:, ShipEntity::launchCascadeMine, PlanetEntity::launchShuttle, PlayerEntity::leaveWitchspace, PlayerEntity(LoadSave)::loadPlayerFromFile:asNew:, Universe::makeDemoShipWithRole:spinning:, PlayerEntity(Scripting)::processSceneString:atOffset:, ShipEntity::releaseCargoPodsDebris, setNormalOrientation:, PlayerEntity::setNormalOrientation:, OOWaypointEntity::setOrientation:, PlanetEntity::setOrientation:, Universe::setUpBreakPattern:orientation:forDocking:, Universe(OOPrivate)::setUpInitialUniverse, Universe::setupIntroFirstGo:, OOVisualEffectEntity(Private)::setUpOneStandardSubentity:, ShipEntity::setUpOneStandardSubentity:asTurret:, Universe::setUpSpace, Universe::setUpWitchspaceBetweenSystem:andSystem:, PlayerEntity::showShipModelWithKey:shipData:personality:factorX:factorY:factorZ:inContext:, Universe::spawnShip:, Universe::spawnShipWithRole:near:, OOLaserShotEntity::update:, ShipEntity::update:, and Universe::update:.

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

◆ setOwner:

- (void) setOwner: (Entity*) ent

Reimplemented in ShipEntity.

Definition at line 542 of file Entity.m.

542 :(Entity*)ent
543{
544 [_owner release];
545 _owner = [ent weakRetain];
546}
OOWeakReference * _owner
Definition Entity.h:158

References _owner, and OOWeakRefObject::weakRetain.

Referenced by dealloc, ShipEntity::fireTurretCannon:, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, OOExhaustPlumeEntity::initForShip:withDefinition:andScale:, OOLaserShotEntity::initLaserFromShip:direction:offset:, OOQuiriumCascadeEntity::initQuiriumCascadeFromShip:, OORingEffectEntity::initRingFromEntity:, OOVisualEffectEntity(SubEntityRelationship)::isShipWithSubEntityShip:, ShipEntity(SubEntityRelationship)::isShipWithSubEntityShip:, ShipEntity::removeExhaust:, ShipEntity::removeFlasher:, ShipEntity::setOwner:, and ShipEntity::throwSparks.

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

◆ setPosition:

- (void) setPosition: (HPVector) posn

Reimplemented in OOSunEntity, and PlanetEntity.

Definition at line 608 of file Entity.m.

608 :(HPVector)posn
609{
610 position = posn;
611 [self updateCameraRelativePosition];
612}

References position, and updateCameraRelativePosition.

Referenced by Universe::addLaserHitEffectsAt:against:damage:color:, Universe::addShipAt:withRole:withinRadius:, Universe::addShips:withRole:atPosition:withCoordinateSystem:, Universe::addShipWithRole:launchPos:rfactor:, Universe::addWreckageFrom:withRole:at:scale:lifetime:, ShipEntity::becomeExplosion, DockEntity::clearDockingCorridor, ShipEntity::collideWithShip:, WormholeEntity::disgorgeShips, PlayerEntity::docked, ShipEntity::dumpItem:, EntitySetProperty(), EntitySetProperty(), ShipEntity::fireDirectLaserShotAt:, ShipEntity::fireMissileWithIdentifier:andTarget:, OOExhaustPlumeEntity::initForShip:withDefinition:andScale:, OOECMBlastEntity::initFromShip:, OOLaserShotEntity::initLaserFromShip:direction:offset:, OOQuiriumCascadeEntity::initQuiriumCascadeFromShip:, OORingEffectEntity::initRingFromEntity:, OOPlasmaBurstEntity::initWithPosition:, OOFlashEffectEntity(Private)::initWithPosition:size:color:duration:, OOParticleSystem::initWithPosition:velocity:count:minSpeed:maxSpeed:duration:baseColor:, OOSparkEntity::initWithPosition:velocity:duration:size:color:, OOPlasmaShotEntity::initWithPosition:velocity:energy:duration:color:, ShipEntity::launchCascadeMine, DockEntity::launchShip:, PlanetEntity::launchShuttle, ShipEntity::leaveWitchspace, PlayerEntity::moveForward:, PlayerEntity(Scripting)::processSceneString:atOffset:, ShipEntity::releaseCargoPodsDebris, OOVisualEffectEntity::rescaleBy:, ShipEntity(Private)::rescaleBy:writeToCache:, WormholeEntity::setExitPosition:, OOSunEntity::setPosition:, OOVisualEffectEntity::setScaleX:, OOVisualEffectEntity::setScaleY:, OOVisualEffectEntity::setScaleZ:, Universe::setUpBreakPattern:orientation:forDocking:, Universe(OOPrivate)::setUpInitialUniverse, ShipEntity(Private)::setUpOneEscort:inGroup:withRole:atPosition:andCount:, OOVisualEffectEntity(Private)::setUpOneFlasher:, ShipEntity(Private)::setUpOneFlasher:, OOVisualEffectEntity(Private)::setUpOneStandardSubentity:, ShipEntity::setUpOneStandardSubentity:asTurret:, Universe::setUpSpace, Universe::setUpUniverseFromStation, DockEntity::shipIsInDockingCorridor:, ShipEntity(LoadRestore)::shipRestoredFromDictionary:useFallback:context:, Universe::spawnShip:, OOLaserShotEntity::update:, and Universe::update:.

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

◆ setPositionX:y:z:

- (void) setPositionX: (OOHPScalar) x
y: (OOHPScalar) y
z: (OOHPScalar) z 

Definition at line 614 of file Entity.m.

615{
616 position.x = x;
617 position.y = y;
618 position.z = z;
619 [self updateCameraRelativePosition];
620}
double OOHPScalar
Definition OOMaths.h:51
float y
float x

References position, updateCameraRelativePosition, x, and y.

Referenced by Universe::makeDemoShipWithRole:spinning:, Universe::setupIntroFirstGo:, PlayerEntity::showShipModelWithKey:shipData:personality:factorX:factorY:factorZ:inContext:, and Universe::update:.

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

◆ setScanClass:

- (void) setScanClass: (OOScanClass) sClass

Definition at line 738 of file Entity.m.

738 :(OOScanClass)sClass
739{
740 scanClass = sClass;
741}
OOScanClass
Definition Entity.h:69

References scanClass.

Referenced by ShipEntity::abandonShip, Universe::addShipAt:withRole:withinRadius:, Universe::addShips:withRole:atPosition:withCoordinateSystem:, Universe::addShipWithRole:launchPos:rfactor:, PlayerEntity(ScriptMethods)::awardCommodityType:amount:, ShipEntity::becomeExplosion, PlayerEntity::createCargoPodWithType:andAmount:, ShipEntity::dumpItem:, EntitySetProperty(), EntitySetProperty(), ShipEntity::fireDirectLaserShotAt:, ShipEntity::fireLaserShotInDirection:weaponIdentifier:, ShipEntity::fireMissileWithIdentifier:andTarget:, ShipEntity::fireSubentityLaserShot:, OOECMBlastEntity::initFromShip:, OORingEffectEntity::initRingFromEntity:, OOLightParticleEntity::initWithDiameter:, OOWaypointEntity::initWithDictionary:, OOBreakPatternEntity::initWithPolygonSides:startAngle:aspectRatio:, ShipEntity::launchCascadeMine, StationEntity::launchDefenseShip, StationEntity::launchEscort, StationEntity::launchIndependentShip:, PlayerEntity::launchMine:, StationEntity::launchMiner, StationEntity::launchPatrol, StationEntity::launchPirateShip, StationEntity::launchPolice, StationEntity::launchScavenger, StationEntity::launchShipWithRole:, PlanetEntity::launchShuttle, StationEntity::launchShuttle, PlayerEntity::loadCargoPodsForType:amount:, Universe::makeDemoShipWithRole:spinning:, Universe::newShipWithRole:, PlayerEntity(Scripting)::processSceneString:atOffset:, ShipEntity::releaseCargoPodsDebris, Universe(OOPrivate)::setUpCargoPods, Universe::setupIntroFirstGo:, ShipEntity(Private)::setUpOneEscort:inGroup:withRole:atPosition:andCount:, Universe::setUpSpace, Universe::setUpWitchspaceBetweenSystem:andSystem:, PlayerEntity::showShipModelWithKey:shipData:personality:factorX:factorY:factorZ:inContext:, Universe::update:, and Universe::witchspaceShipWithPrimaryRole:.

Here is the caller graph for this function:

◆ setStatus:

◆ setThrowSparks:

- (void) setThrowSparks: (BOOL) value

Definition at line 532 of file Entity.m.

532 :(BOOL)value
533{
534 throw_sparks = value;
535}

References throw_sparks.

Referenced by ShipEntity(PureAI)::ai_throwSparks, and Universe::setUpSpace.

Here is the caller graph for this function:

◆ setUniversalID:

- (void) setUniversalID: (OOUniversalID) uid

Definition at line 517 of file Entity.m.

517 :(OOUniversalID)uid
518{
519 universalID = uid;
520}
uint16_t OOUniversalID
Definition OOTypes.h:165

References universalID.

Referenced by Universe(OOPrivate)::doRemoveEntity:.

Here is the caller graph for this function:

◆ setVelocity:

◆ spawnTime

- (GLfloat) spawnTime

References fogUniform, spawnTime, and timeElapsedSinceSpawn.

Here is the call graph for this function:

◆ speed

- (double) speed

Definition at line 713 of file Entity.m.

714{
715 return magnitude([self velocity]);
716}

References magnitude(), speed, and velocity.

Referenced by ShipEntity::behaviour_attack_break_off_target:, ShipEntity::behaviour_attack_fly_from_target:, ShipEntity::behaviour_attack_fly_to_target:, ShipEntity::behaviour_attack_slow_dogfight:, ShipEntity::behaviour_evasive_action:, ShipEntity::behaviour_fly_to_target_six:, ShipEntity::behaviour_intercept_target:, OOParticleSystem::initWithPosition:velocity:count:minSpeed:maxSpeed:duration:baseColor:, ShipEntity::missileTrackPrimaryTarget:, StationEntity::OOMakeDockingInstructions, WormholeEntity::setExitSpeed:, speed, OOExhaustPlumeEntity::update:, and velocity.

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

◆ status

- (OOEntityStatus) status

Definition at line 733 of file Entity.m.

734{
735 return _status;
736}

References _status, and status.

Referenced by DockEntity::abortAllDockings, DockEntity::abortDockingForShip:, ShipEntity::acceptAsEscort:, PlayerEntity::addTarget:, ShipEntity::alertCondition, ShipEntity::becomeExplosion, StationEntity::becomeExplosion, ShipEntity::becomeLargeExplosion:, ShipEntity::behaviour_tractored:, PlayerEntity::canCollide, ShipEntity::canCollide, PlayerEntity::cargoQuantityForType:, PlayerEntity(Scripting)::checkScript, DockEntity::clearDockingCorridor, PlayerEntity::collectBountyFor:, descriptionComponents, PlayerEntity::dialFuelScoopStatus, WormholeEntity::disgorgeShips, distanceTravelled, PlayerEntity::doBookkeeping:, PlayerEntity::docked, PlayerEntity(ScriptMethods)::dockedAtMainStation, DockEntity::dockingCorridorIsEmpty, PlayerEntity::drawImmediate:translucent:, Universe::drawUniverse, dumpSelfState, PlayerEntity::engageAutopilotToStation:, PlayerEntity::enterDock:, PlayerEntity::enterWormhole:, ShipEntity::enterWormhole:replacing:, EntityGetProperty(), EntityGetProperty(), ShipEntity::getTractoredBy:, PlayerEntity::interpretAIMessage:, PlayerEntity::isDocked, isInSpace, PlayerEntity::isValidTarget:, ShipEntity::isValidTarget:, PlayerEntity::launchEscapeCapsule, StationEntity::legalStatusOfManifest:export:, StationEntity::noteDockedShip:, ShipEntity::noteKilledBy:damageType:, ShipEntity::onTarget:withWeapon:, PlayerEntity(OOControlsPrivate)::pollGuiScreenControlsWithFKeyAlias:, ShipEntity::realAlertCondition, PlayerEntity::receiveCommsMessage:from:, ShipEntity::removeEquipmentItem:, ShipEntity::scoopUpProcess:processEvents:processMessages:, PlayerEntity::setCargoQuantityForType:amount:, PlayerEntity::setFoundTarget:, PlayerEntity::setGuiToChartScreenFrom:, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToIntroFirstGo:, PlayerEntity(KeyMapper)::setGuiToKeyboardLayoutScreen:resetCurrentRow:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToLoadSaveScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity::setGuiToStatusScreen, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, ShipEntity::setProximityAlert:, ShipEntity::setStatus:, DockEntity::shipIsInDockingCorridor:, StationEntity::shipIsInDockingCorridor:, DockEntity::shipIsInDockingQueue:, status, WormholeEntity::suckInShip:, PlayerEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, PlayerEntity::takeHeatDamage:, ShipEntity::takeHeatDamage:, PlayerEntity::takeScrapeDamage:from:, ShipEntity::takeScrapeDamage:from:, DockEntity::update:, update:, OOECMBlastEntity::update:, PlayerEntity::update:, ShipEntity::update:, StationEntity::update:, PlayerEntity::validateCompassTarget, ShipEntity::validateDefenseTargets, ShipEntity::wasAddedToUniverse, and PlayerEntity::witchJumpChecklist:.

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

◆ subEntityReallyDied:

- (void) subEntityReallyDied: (ShipEntity*) sub
implementation

Reimplemented in ShipEntity.

Definition at line 958 of file Entity.m.

958 :(ShipEntity*)sub
959{
960 OOLog(@"entity.bug", @"%s called for non-ship entity %p by %p", __PRETTY_FUNCTION__, self, sub);
961}

References OOLog.

◆ superShaderBindingTarget

- (id< OOWeakReferenceSupport >) superShaderBindingTarget
implementation

Definition at line 561 of file Entity.m.

562{
563 return [self parentEntity];
564}

References parentEntity, and superShaderBindingTarget.

Referenced by superShaderBindingTarget.

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

◆ systemEconomy

- (unsigned) systemEconomy
implementation

Provided by category Entity(ShaderBindings).

Definition at line 57 of file EntityShaderBindings.m.

58{
59 return [[PLAYER systemEconomy_number] unsignedIntValue];
60}

◆ systemGovernment

- (unsigned) systemGovernment
implementation

Provided by category Entity(ShaderBindings).

Definition at line 52 of file EntityShaderBindings.m.

53{
54 return [[PLAYER systemGovernment_number] unsignedIntValue];
55}

◆ systemPopulation

- (unsigned) systemPopulation
implementation

Provided by category Entity(ShaderBindings).

Definition at line 67 of file EntityShaderBindings.m.

68{
69 return [[PLAYER systemPopulation_number] unsignedIntValue];
70}

◆ systemProductivity

- (unsigned) systemProductivity
implementation

Provided by category Entity(ShaderBindings).

Definition at line 72 of file EntityShaderBindings.m.

73{
74 return [[PLAYER systemProductivity_number] unsignedIntValue];
75}

◆ systemTechLevel

- (unsigned) systemTechLevel
implementation

Provided by category Entity(ShaderBindings).

Definition at line 62 of file EntityShaderBindings.m.

63{
64 return [[PLAYER systemTechLevel_number] unsignedIntValue];
65}

◆ takeEnergyDamage:from:becauseOf:weaponIdentifier:

- (void) takeEnergyDamage: (double) amount
from: (Entity*) ent
becauseOf: (Entity*) other
weaponIdentifier: (NSString*) weaponIdentifier 

Reimplemented in DockEntity, PlayerEntity, ShipEntity, and StationEntity.

Definition at line 899 of file Entity.m.

899 :(double)amount from:(Entity*)ent becauseOf:(Entity*)other weaponIdentifier:(NSString*)weaponIdentifier
900{
901}

Referenced by ShipEntity::dealEnergyDamage:atRange:withBias:, ShipEntity::dealEnergyDamageWithinDesiredRange, OOPlasmaShotEntity::update:, and OOQuiriumCascadeEntity::update:.

Here is the caller graph for this function:

◆ throwingSparks

- (BOOL) throwingSparks

Definition at line 527 of file Entity.m.

528{
529 return throw_sparks;
530}

References throw_sparks, and throwingSparks.

Referenced by throwingSparks, and universalID.

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

◆ throwSparks

- (void) throwSparks

Reimplemented in ShipEntity.

Definition at line 537 of file Entity.m.

538{
539 // do nothing for now
540}

References throwSparks.

Referenced by throwSparks, and universalID.

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

◆ timeElapsedSinceSpawn

- (GLfloat) timeElapsedSinceSpawn

Definition at line 985 of file Entity.m.

986{
987 return [UNIVERSE getTime] - spawnTime;
988}

References spawnTime, and timeElapsedSinceSpawn.

Referenced by spawnTime, timeElapsedSinceSpawn, OOFlashEffectEntity::update:, OOPlasmaBurstEntity::update:, and OOPlasmaShotEntity::update:.

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

◆ transformationMatrix

- (OOMatrix) transformationMatrix

Definition at line 813 of file Entity.m.

814{
815 OOMatrix result = rotMatrix;
816 return OOMatrixHPTranslate(result, position);
817}

References OOMatrixHPTranslate(), position, rotMatrix, and transformationMatrix.

Referenced by maxEnergy, and transformationMatrix.

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

◆ universalID

References owner, parentEntity, rootShipEntity, throwingSparks, throwSparks, and universalID.

Here is the call graph for this function:

◆ universalTime

- (GLfloat) universalTime

Definition at line 975 of file Entity.m.

976{
977 return [UNIVERSE getTime];
978}

References universalTime.

Referenced by isImmuneToBreakPatternHide, and universalTime.

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

◆ update:

- (void) update: (OOTimeDelta) delta_t

Reimplemented in DockEntity, DustEntity, OOBigFragmentBurstEntity, OOBreakPatternEntity, OOECMBlastEntity, OOExhaustPlumeEntity, OOExplosionCloudEntity, OOFlashEffectEntity, OOFlasherEntity, OOLaserShotEntity, OOParticleSystem, OOPlasmaBurstEntity, OOPlasmaShotEntity, OOQuiriumCascadeEntity, OORingEffectEntity, OOSmallFragmentBurstEntity, OOSparkEntity, OOSunEntity, OOVisualEffectEntity, PlanetEntity, PlayerEntity, ShipEntity, SkyEntity, StationEntity, and WormholeEntity.

Definition at line 850 of file Entity.m.

850 :(OOTimeDelta)delta_t
851{
852 if (_status != STATUS_COCKPIT_DISPLAY) {
853 if ([self isSubEntity]) {
854 zero_distance = [[self owner] zeroDistance];
855 cam_zero_distance = [[self owner] camZeroDistance];
856 [self updateCameraRelativePosition];
857 } else {
859 cam_zero_distance = HPdistance2([PLAYER viewpointPosition], position);
860 [self updateCameraRelativePosition];
861 }
862 } else {
866 }
867
868 if ([self status] != STATUS_COCKPIT_DISPLAY) {
869 [self applyVelocity:delta_t];
870 }
871
876}
OOINLINE bool HPvector_equal(HPVector a, HPVector b) INLINE_CONST_FUNC
Definition OOHPVector.h:250
OOINLINE OOHPScalar HPdistance2(HPVector v1, HPVector v2) INLINE_CONST_FUNC
Definition OOHPVector.h:293
OOINLINE OOHPScalar HPmagnitude2(HPVector vec) INLINE_CONST_FUNC
Definition OOHPVector.h:255
OOINLINE bool quaternion_equal(Quaternion a, Quaternion b) INLINE_CONST_FUNC
Quaternion lastOrientation
Definition Entity.h:130
HPVector lastPosition
Definition Entity.h:129

References _status, applyVelocity:, cam_zero_distance, cameraRelativePosition, camZeroDistance, hasMoved, hasRotated, HPdistance2(), HPmagnitude2(), HPvector_equal(), HPVectorToVector(), isSubEntity, lastOrientation, lastPosition, orientation, owner, PLAYER, position, quaternion_equal(), status, updateCameraRelativePosition, zero_distance, and zeroDistance.

Referenced by OOBreakPatternEntity::update:, OOFlashEffectEntity::update:, OOFlasherEntity::update:, OOLaserShotEntity::update:, OOParticleSystem::update:, OOPlasmaBurstEntity::update:, OOPlasmaShotEntity::update:, OOQuiriumCascadeEntity::update:, OORingEffectEntity::update:, OOSparkEntity::update:, OOSunEntity::update:, OOVisualEffectEntity::update:, PlanetEntity::update:, ShipEntity::update:, Universe::update:, and WormholeEntity::update:.

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

◆ updateCameraRelativePosition

- (void) updateCameraRelativePosition

Reimplemented in DustEntity, and OOSunEntity.

Definition at line 622 of file Entity.m.

623{
625}
HPVector absolutePositionForSubentity()
Definition Entity.m:627

References absolutePositionForSubentity, cameraRelativePosition, HPvector_subtract(), HPVectorToVector(), PLAYER, and updateCameraRelativePosition.

Referenced by cameraRelativePosition, Universe::drawUniverse, setPosition:, setPositionX:y:z:, update:, and updateCameraRelativePosition.

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

◆ updateLinkedLists

- (void) updateLinkedLists

Definition at line 393 of file Entity.m.

394{
395 if (!UNIVERSE)
396 return; // not in the UNIVERSE - don't do this!
397 if ((x_next == nil) && (x_previous == nil))
398 return; // not in the lists - don't do this!
399
400#ifdef OO_DEBUG_MONITOR_ENABLED
402 if (![self checkLinkedLists]) {
403 OOLog(kOOLogEntityVerificationError, @"DEBUG LINKED LISTS problem encountered before updating linked lists for %@", self);
404 [UNIVERSE debugDumpEntities];
405 }
406 }
407#endif
408
409 // update position in linked list for position.x
410 // take self out of list..
411 if (x_previous)
412 x_previous->x_next = x_next;
413 if (x_next)
414 x_next->x_previous = x_previous;
415 // sink DOWN the list
416 while ((x_previous) && (x_previous->position.x - x_previous->collision_radius > position.x - collision_radius)) {
418 x_previous = x_previous->x_previous;
419 }
420 // bubble UP the list
421 while ((x_next) && (x_next->position.x - x_next->collision_radius < position.x - collision_radius)) {
423 x_next = x_next->x_next;
424 }
425 if (x_next) // insert self into the list before x_next..
426 x_next->x_previous = self;
427 if (x_previous) // insert self into the list after x_previous..
428 x_previous->x_next = self;
429 if ((x_previous == nil) && (UNIVERSE)) // if we're the first then tell the UNIVERSE!
430 UNIVERSE->x_list_start = self;
431
432 // update position in linked list for position.y
433 // take self out of list..
434 if (y_previous)
435 y_previous->y_next = y_next;
436 if (y_next)
437 y_next->y_previous = y_previous;
438 // sink DOWN the list
439 while ((y_previous) && (y_previous->position.y - y_previous->collision_radius > position.y - collision_radius)) {
441 y_previous = y_previous->y_previous;
442 }
443 // bubble UP the list
444 while ((y_next) && (y_next->position.y - y_next->collision_radius < position.y - collision_radius)) {
446 y_next = y_next->y_next;
447 }
448 if (y_next) // insert self into the list before y_next..
449 y_next->y_previous = self;
450 if (y_previous) // insert self into the list after y_previous..
451 y_previous->y_next = self;
452 if ((y_previous == nil) && (UNIVERSE)) // if we're the first then tell the UNIVERSE!
453 UNIVERSE->y_list_start = self;
454
455 // update position in linked list for position.z
456 // take self out of list..
457 if (z_previous)
458 z_previous->z_next = z_next;
459 if (z_next)
460 z_next->z_previous = z_previous;
461 // sink DOWN the list
462 while ((z_previous) && (z_previous->position.z - z_previous->collision_radius > position.z - collision_radius)) {
464 z_previous = z_previous->z_previous;
465 }
466 // bubble UP the list
467 while ((z_next) && (z_next->position.z - z_next->collision_radius < position.z - collision_radius)) {
469 z_next = z_next->z_next;
470 }
471 if (z_next) // insert self into the list before z_next..
472 z_next->z_previous = self;
473 if (z_previous) // insert self into the list after z_previous..
474 z_previous->z_next = self;
475 if ((z_previous == nil) && (UNIVERSE)) // if we're the first then tell the UNIVERSE!
476 UNIVERSE->z_list_start = self;
477
478 // done
479#ifdef OO_DEBUG_MONITOR_ENABLED
481 if (![self checkLinkedLists]) {
482 OOLog(kOOLogEntityUpdateError, @"DEBUG LINKED LISTS problem encountered after updating linked lists for %@", self);
483 [UNIVERSE debugDumpEntities];
484 }
485 }
486#endif
487}

References checkLinkedLists, collision_radius, DEBUG_LINKED_LISTS, gDebugFlags, kOOLogEntityVerificationError, nil, OOLog, position, UNIVERSE, updateLinkedLists, x_next, x_previous, y_next, y_previous, z_next, and z_previous.

Referenced by isVisualEffect, Universe::update:, and updateLinkedLists.

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

◆ validForAddToUniverse

- (BOOL) validForAddToUniverse

Reimplemented in PlayerEntity, and ShipEntity.

Definition at line 195 of file Entity.m.

196{
197 NSUInteger mySessionID = [self sessionID];
198 NSUInteger currentSessionID = [UNIVERSE sessionID];
199 if (EXPECT_NOT(mySessionID != currentSessionID)) {
200 OOLogERR(@"entity.invalidSession", @"Entity %@ from session %zu cannot be added to universe in session %zu. This is an internal error, please report it.", [self shortDescription], mySessionID, currentSessionID);
201 return NO;
202 }
203
204 return YES;
205}
#define OOLogERR(class, format,...)
Definition OOLogging.h:125

References EXPECT_NOT, OOLogERR, sessionID, and validForAddToUniverse.

Referenced by isVisualEffect, validForAddToUniverse, and ShipEntity::validForAddToUniverse.

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

◆ vectorTo:

- (Vector) vectorTo: (Entity*) entity

Definition at line 603 of file Entity.m.

603 :(Entity*)entity
604{
605 return HPVectorToVector(HPvector_subtract([entity position], [self position]));
606}

References HPvector_subtract(), HPVectorToVector(), and position.

Referenced by ShipEntity::dealEnergyDamage:atRange:withBias:, ShipEntity::dealEnergyDamageWithinDesiredRange, ShipEntity::dealMomentumWithinDesiredRange:, ShipEntity::missileTrackPrimaryTarget:, and ShipEntity::trackOntoTarget:withDForward:.

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

◆ velocity

Reimplemented in ShipEntity.

References speed, and velocity.

Here is the call graph for this function:

◆ warnAboutHostiles

- (void) warnAboutHostiles

Reimplemented in PlayerEntity.

Definition at line 499 of file Entity.m.

500{
501 // do nothing for now, this can be expanded in sub classes
502 OOLog(@"general.error.subclassResponsibility.Entity-warnAboutHostiles", @"%@", @"***** Entity does nothing in warnAboutHostiles");
503}

References OOLog, and warnAboutHostiles.

Referenced by isVisualEffect, and warnAboutHostiles.

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

◆ wasAddedToUniverse

- (void) wasAddedToUniverse

Reimplemented in ShipEntity.

Definition at line 489 of file Entity.m.

490{
491 // Do nothing
492}

References wasAddedToUniverse.

Referenced by isVisualEffect, wasAddedToUniverse, and ShipEntity::wasAddedToUniverse.

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

◆ wasRemovedFromUniverse

- (void) wasRemovedFromUniverse

Reimplemented in ShipEntity.

Definition at line 494 of file Entity.m.

495{
496 // Do nothing
497}

References wasRemovedFromUniverse.

Referenced by Universe(OOPrivate)::doRemoveEntity:, isVisualEffect, and wasRemovedFromUniverse.

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

◆ zeroDistance

- (double) zeroDistance

Definition at line 648 of file Entity.m.

649{
650 return zero_distance;
651}

References zero_distance, and zeroDistance.

Referenced by cameraRelativePosition, update:, and zeroDistance.

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

Member Data Documentation

◆ _jsSelf

- (struct JSObject*) _jsSelf
protected

Definition at line 151 of file Entity.h.

◆ _owner

- (OOWeakReference*) _owner
private

Definition at line 158 of file Entity.h.

Referenced by setOwner:.

◆ _sessionID

- (NSUInteger) _sessionID
private

Definition at line 156 of file Entity.h.

Referenced by init, and sessionID.

◆ _status

- (OOEntityStatus) _status
private

Definition at line 159 of file Entity.h.

Referenced by setStatus:, status, and update:.

◆ atmosphereFogging

- (OOColor*) atmosphereFogging

Definition at line 111 of file Entity.h.

Referenced by init, and setAtmosphereFogging:.

◆ boundingBox

◆ cam_zero_distance

◆ cameraRelativePosition

◆ collider

- (Entity*) collider

Definition at line 124 of file Entity.h.

Referenced by ShipEntity::checkCloseCollisionWith:, and CollisionRegion::findCollisions.

◆ collidingEntities

- (NSMutableArray*) collidingEntities
protected

◆ collision_chain

- (Entity*) collision_chain

Definition at line 120 of file Entity.h.

Referenced by Universe::filterSortedLists, and CollisionRegion::findCollisions.

◆ collision_radius

- (GLfloat) collision_radius

Definition at line 107 of file Entity.h.

Referenced by Universe::addShips:withRole:atPosition:withCoordinateSystem:, addToLinkedLists, ShipEntity::avoidCollision, ShipEntity::becomeExplosion, ShipEntity::behaviour_attack_slow_dogfight:, ShipEntity::behaviour_avoid_collision:, ShipEntity::behaviour_intercept_target:, ShipEntity::behaviour_tractored:, ShipEntity::checkCloseCollisionWith:, PlayerEntity(OOPrivate)::checkEntityForMassLock:withScanClass:, OOVisualEffectEntity::clearSubEntities, ShipEntity::clearSubEntities, collisionRadius, OOVisualEffectEntity::collisionRadius, Universe::countEntitiesMatchingPredicate:parameter:inRange:ofEntity:, PlayerEntity::customViewZoomIn:, PlayerEntity::customViewZoomOut:, PlayerEntity::dialAltitude, PlayerEntity::doBookkeeping:, DockEntity::dockingInstructionsForShip:, OOEntityWithDrawable::drawImmediate:translucent:, OOParticleSystem::drawImmediate:translucent:, OOQuiriumCascadeEntity::drawImmediate:translucent:, WormholeEntity::drawImmediate:translucent:, HeadUpDisplay(Private)::drawScanner:, OOSunEntity::drawStarGlare, PlanetEntity::drawUnconditionally, ShipEntity::dumpItem:, CollisionRegion::entityByEntityOcclusionToValue, Universe::EntityInRange, Universe::filterSortedLists, OOExhaustPlumeEntity::findCollisionRadius, CollisionRegion::findCollisions, ShipEntity::fireMissileWithIdentifier:andTarget:, ShipEntity::fireTurretCannon:, Universe::firstShipHitByLaserFromShip:inDirection:offset:gettingRangeFound:, frustumRadius, Universe::getSafeVectorFromEntity:toDistance:fromPoint:, Universe::getSunSkimEndPositionForShip:, Universe::getSunSkimStartPositionForShip:, Universe::hazardOnRouteFromEntity:toDistance:fromPoint:, HeadUpDisplay::hudDrawReticleOnTarget, DustEntity::init, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, OOSunEntity::initSunWithColor:andDictionary:, WormholeEntity::initWormholeTo:fromShip:, Universe::isVectorClearFromEntity:toDistance:fromPoint:, ShipEntity::launchCascadeMine, PlanetEntity::launchShuttle, ShipEntity::legalStatus, PlanetEntity::miniaturize, ShipEntity::onTarget:withWeapon:, OOSunEntity::radius, PlanetEntity::radius, ShipEntity::rangeToSecondaryTarget:, OOVisualEffectEntity::rescaleBy:, setCollisionRadius:, ShipEntity(PureAI)::setDestinationWithinTarget, OOEntityWithDrawable::setDrawable:, ShipEntity::setProximityAlert:, ShipEntity(PureAI)::setRacepointsFromTarget, PlanetEntity::setRadius:, OOSunEntity::setRadius:andCorona:, ShipEntity(Private)::setUpOneEscort:inGroup:withRole:atPosition:andCount:, OOVisualEffectEntity::setUpSubEntities, ShipEntity::setUpSubEntities, OOVisualEffectEntity::setUpVisualEffectFromDictionary:, CollisionRegion::shadowAtPointOcclusionToValue, Universe::spawnShipWithRole:near:, WormholeEntity::suckInShip:, ShipEntity::trackOntoTarget:withDForward:, ShipEntity::trackPrimaryTarget:retreat:, OOExhaustPlumeEntity::update:, OOParticleSystem::update:, OOQuiriumCascadeEntity::update:, OOSunEntity::update:, PlanetEntity::update:, ShipEntity::update:, WormholeEntity::update:, and updateLinkedLists.

◆ collisionRegion

- (CollisionRegion *) collisionRegion

Definition at line 505 of file Entity.m.

506{
507 return collisionRegion;
508}

Referenced by collisionRegion, dealloc, and setCollisionRegion:.

◆ collisionTestFilter

- (unsigned) collisionTestFilter

Definition at line 96 of file Entity.h.

Referenced by dumpSelfState, Universe::filterSortedLists, and CollisionRegion::findCollisions.

◆ distanceTravelled

- (GLfloat) distanceTravelled
protected

◆ energy

◆ hasCollided

- (unsigned) hasCollided

Definition at line 94 of file Entity.h.

Referenced by CollisionRegion::findCollisions.

◆ hasMoved

- (unsigned) hasMoved

Definition at line 92 of file Entity.h.

Referenced by dumpSelfState, CollisionRegion::findShadowedEntities, and update:.

◆ hasRotated

◆ isExplicitlyNotMainStation

- (unsigned) isExplicitlyNotMainStation

◆ isImmuneToBreakPatternHide

◆ isPlayer

- (BOOL) isPlayer

Definition at line 145 of file Entity.m.

146{
147 return isPlayer;
148}

Referenced by ShipEntity::abandonShip, DockEntity::abortDockingForShip:, StationEntity::abortDockingForShip:, StationEntity::acceptDockingClearanceRequestFrom:, ShipEntity::addEquipmentItem:withValidation:inContext:, PlayerEntity::addRoleForAggression:, DockEntity::allowsLaunchingOf:, ShipEntity::becomeExplosion, ShipEntity::becomeLargeExplosion:, ShipEntity::behaviour_tractored:, ShipEntity(AI)::broadcastDistressMessageWithDumping:, ShipEntity::broadcastMessage:withUnpilotedOverride:, ShipEntity::canScoop:, ShipEntity::checkShipsInVicinityForWitchJumpExit, PlayerEntity::deferredInit, DockEntity::dockingCorridorIsEmpty, StationEntity::dockingInstructionsForShip:, OOExhaustPlumeEntity::drawSubEntityImmediate:translucent:, ShipEntity::dumpItem:, dumpSelfState, ShipEntity::equipmentValidToAdd:whileLoading:inContext:, ShipEntity::fireLaserShotInDirection:weaponIdentifier:, ShipEntity::fireMissileWithIdentifier:andTarget:, ShipEntity::fireSubentityLaserShot:, ShipEntity::fireTurretCannon:, WormholeEntity::initWormholeTo:fromShip:, isPlayer, PlayerEntity::lookingAtSunWithThresholdAngleCos:, ShipEntity::manageCollisions, StationEntity::noteDockedShip:, ShipEntity::realAlertCondition, ShipEntity::releaseCargoPodsDebris, ShipEntity::removeEquipmentItem:, ShipEntity::rollToMatchUp:rotating:, ShipEntity(PureAI)::scanForFormationLeader, ShipEntity(PureAI)::scanForNearestMerchantman, ShipEntity::scoopUpProcess:processEvents:processMessages:, ShipEntity::sendMessage:toShip:withUnpilotedOverride:, DockEntity::shipIsInDockingCorridor:, StationEntity::shipIsInDockingCorridor:, DockEntity::shipIsInDockingQueue:, ShipEntity::trackDestination:retreat:, OOExhaustPlumeEntity::update:, and OOLaserShotEntity::update:.

◆ isShip

- (BOOL) isShip

Definition at line 125 of file Entity.m.

126{
127 return isShip;
128}

Referenced by DockEntity::abortAllDockings, ShipEntity::addDefenseTarget:, PlayerEntity::addTarget:, DockEntity::allowsLaunchingOf:, ShipEntity::approachAspectToPrimaryTarget, ShipEntity::behaviour_attack_break_off_target:, ShipEntity::behaviour_attack_fly_to_target:, ShipEntity::behaviour_attack_sniper:, ShipEntity::behaviour_attack_target:, ShipEntity::behaviour_flee_target:, ShipEntity::behaviour_fly_to_target_six:, ShipEntity::behaviour_formation_form_up:, ShipEntity::behaviour_tractored:, ShipEntity::broadcastEnergyBlastImminent, PlanetEntity::checkCloseCollisionWith:, ShipEntity::checkCloseCollisionWith:, PlayerEntity(OOPrivate)::checkEntityForMassLock:withScanClass:, ShipEntity::checkScanner, ShipEntity::checkScannerIgnoringUnpowered, ShipEntity::checkShipsInVicinityForWitchJumpExit, DockEntity::clearDockingCorridor, ShipEntity::dealMomentumWithinDesiredRange:, PlayerEntity::doBookkeeping:, DockEntity::dockingCorridorIsEmpty, ShipEntity::doOctreesCollide, OOEntityWithDrawable::drawImmediate:translucent:, dumpSelfState, CollisionRegion::findCollisions, ShipEntity::fireLaserShotInDirection:weaponIdentifier:, ShipEntity::fireMissileWithIdentifier:andTarget:, StationEntity::fitsInDock:andLogNoFit:, PlayerEntity::hasHostileTarget, ShipEntity::hasHostileTarget, OOLaserShotEntity::initLaserFromShip:direction:offset:, ShipEntity::initWithKey:definition:, ShipEntity::interpretAIMessage:, isShip, IsShipPredicate(), PlayerEntity::isValidTarget:, ShipEntity::isValidTarget:, DockEntity::launchShip:, PlayerEntity::lookingAtSunWithThresholdAngleCos:, PlayerEntity::loseTargetStatus, ShipEntity::manageCollisions, ShipEntity::missileTrackPrimaryTarget:, PlayerEntity::moveTargetMemoryBy:, ShipEntity::noteKilledBy:damageType:, ShipEntity::noteLostTarget, ShipEntity::noteTakingDamage:from:type:, ShipEntity::realAlertCondition, HeadUpDisplay::refreshLastTransmitter, ShipEntity::respondToAttackFrom:becauseOf:, rootShipEntity, ShipEntity::setSubEntityTakingDamage:, ShipEntity(PureAI)::setTargetToPrimaryAggressor, DockEntity::setUpShipFromDictionary:, ShipEntity::setUpShipFromDictionary:, StationEntity::setUpShipFromDictionary:, DockEntity::shipIsInDockingCorridor:, StationEntity::shipIsInDockingCorridor:, DockEntity::shipIsInDockingQueue:, PlayerEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, StationEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, ShipEntity::takeScrapeDamage:from:, ShipEntity::trackPrimaryTarget:retreat:, ShipEntity::update:, PlayerEntity(OOPrivate)::updateAlertConditionForNearbyEntities, and ShipEntity::updateTrackingCurve.

◆ isStation

◆ isSubEntity

◆ isSunlit

◆ isVisualEffect

- (BOOL) isVisualEffect

Definition at line 185 of file Entity.m.

186{
187 return NO;
188}

Referenced by OOEntityWithDrawable::drawImmediate:translucent:, isVisualEffect, and IsVisualEffectPredicate().

◆ isWormhole

◆ lastDrawCounter

- (NSUInteger) lastDrawCounter
protected

Definition at line 963 of file Entity.m.

964{
965 return lastDrawCounter;
966}

Referenced by init, lastDrawCounter, and setLastDrawCounter:.

◆ lastOrientation

- (Quaternion) lastOrientation
protected

Definition at line 130 of file Entity.h.

Referenced by PlayerEntity::applyRoll:andClimb:, and update:.

◆ lastPosition

- (HPVector) lastPosition
protected

Definition at line 129 of file Entity.h.

Referenced by update:.

◆ mass

◆ maxEnergy

◆ no_draw_distance

◆ orientation

- (Quaternion) orientation

Definition at line 682 of file Entity.m.

683{
684 return orientation;
685}

Referenced by applyRoll:andClimb:, PlayerEntity::applyRoll:andClimb:, ShipEntity::applyRoll:andClimb:, applyRoll:climb:andYaw:, ShipEntity::applyRoll:climb:andYaw:, PlayerEntity::applyYaw:, ShipEntity::ballTrackLeadingTarget:atTarget:, StationEntity::beaconPosition, PlayerEntity::breakPatternPosition, DockEntity::clearDockingCorridor, OOLaserShotEntity::descriptionComponents, DockEntity::dockingCorridorIsEmpty, DockEntity::dockingInstructionsForShip:, dumpSelfState, ShipEntity::fireDirectLaserShotAt:, ShipEntity::fireLaserShotInDirection:weaponIdentifier:, ShipEntity::fireSubentityLaserShot:, ShipEntity::fireTurretCannon:, Universe::firstShipHitByLaserFromShip:inDirection:offset:gettingRangeFound:, HeadUpDisplay::hudRotateViewpointForVirtualDepth, init, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, PlanetEntity::initFromDictionary:withAtmosphere:andSeed:, OORingEffectEntity::initRingFromEntity:, DockEntity::isOffCentre, JSObjectGetQuaternion(), JSObjectGetQuaternion(), DockEntity::launchShip:, PlayerEntity::lookingAtSunWithThresholdAngleCos:, moveForward:, normalOrientation, PlayerEntity::normalOrientation, orientation, orientationChanged, OOVisualEffectEntity::orientationChanged, PlayerEntity::orientationChanged, ShipEntity::orientationChanged, DockEntity::portUpVectorForShipsBoundingBox:, ShipEntity::setDemoShip:, DockEntity::setDimensionsAndCorridor:ddc:launching:, setOrientation:, ShipEntity::setUpShipFromDictionary:, OOVisualEffectEntity::setUpVisualEffectFromDictionary:, DockEntity::shipIsInDockingCorridor:, PlayerEntity::showShipModelWithKey:shipData:personality:factorX:factorY:factorZ:inContext:, ShipEntity::trackOntoTarget:withDForward:, ShipEntity::trackPrimaryTarget:retreat:, update:, PlanetEntity::update:, WaypointGetProperty(), WaypointGetProperty(), and ShipEntity::witchspaceLeavingEffects.

◆ position

- (HPVector) position

Definition at line 576 of file Entity.m.

577{
578 return position;
579}

Referenced by DockEntity::abortAllDockings, DockEntity::abortDockingForShip:, absolutePositionForSubentityOffset:, ShipEntity::absoluteTractorPosition, Universe::addShipsToRoute:withRole:quantity:routeFraction:asGroup:, DockEntity(OOPrivate)::addShipToShipsOnApproach:, addToLinkedLists, applyVelocity:, ShipEntity::approachAspectToPrimaryTarget, ShipEntity::AuthorityPredicate, ShipEntity::avoidCollision, ShipEntity::ballTrackLeadingTarget:atTarget:, StationEntity::beaconPosition, ShipEntity::becomeExplosion, ShipEntity::behaviour_avoid_collision:, ShipEntity::behaviour_fly_thru_navpoints:, ShipEntity::behaviour_intercept_target:, ShipEntity::behaviour_land_on_planet:, ShipEntity::behaviour_track_as_turret:, ShipEntity::behaviour_tractored:, PlayerEntity::breakPatternPosition, ShipEntity::broadcastMessage:withUnpilotedOverride:, ShipEntity::calculateTargetPosition, ShipEntity::canScoop:, ShipEntity::canStillTrackPrimaryTarget, PlanetEntity::checkCloseCollisionWith:, ShipEntity::checkCloseCollisionWith:, CollisionRegion::checkEntity:, ShipEntity::checkForAegis, ShipEntity(PureAI)::checkForMotherStation, ShipEntity::checkScanner, ShipEntity::checkScannerIgnoringUnpowered, ShipEntity::checkShipsInVicinityForWitchJumpExit, DockEntity::clearDockingCorridor, ShipEntity::collideWithShip:, PlayerEntity::commanderDataDictionary, ShipEntity::ComparePlanetsBySurfaceDistance, Universe::coordinatesForPosition:withCoordinateSystem:returningScalar:, Universe::countEntitiesMatchingPredicate:parameter:inRange:ofEntity:, PlayerEntity::createDoppelganger, ShipEntity::currentAimTolerance, descriptionComponents, OOSunEntity::descriptionComponents, PlanetEntity::descriptionComponents, ShipEntity::descriptionComponents, WormholeEntity::disgorgeShips, ShipEntity::distance_six:, ShipEntity::distance_twelve:withOffset:, PlayerEntity::doBookkeeping:, PlayerEntity::docked, DockEntity::dockingCorridorIsEmpty, DockEntity::dockingInstructionsForShip:, StationEntity::dockingInstructionsForShip:, ShipEntity::doesHitLine:v1:, PlayerEntity::doesHitLine:v1:hitEntity:, ShipEntity::doesHitLine:v1:hitEntity:, OOSunEntity::drawDirectVisionSunGlare, OOParticleSystem::drawImmediate:translucent:, OOLightParticleEntity::drawSubEntityImmediate:translucent:, ShipEntity::drawSubEntityImmediate:translucent:, drawTransformationMatrix, PlayerEntity::drawTransformationMatrix, Universe::drawUniverse, dumpSelfState, StationEntity::dumpSelfState, ShipEntity(AI)::enterTargetWormhole, CollisionRegion::entityByEntityOcclusionToValue, Universe::EntityInRange, OOFlashEffectEntity::explosionFlashFromEntity:, Universe::filterSortedLists, ShipEntity::findBoundingBoxRelativeTo:i:j:k:, CollisionRegion::findCollisions, Universe::findEntitiesMatchingPredicate:parameter:inRange:ofEntity:, ShipEntity::findNearestPlanet, ShipEntity::fireDirectLaserShotAt:, ShipEntity::fireLaserShotInDirection:weaponIdentifier:, ShipEntity::fireMissileWithIdentifier:andTarget:, ShipEntity::fireSubentityLaserShot:, ShipEntity::fireTurretCannon:, Universe::firstShipHitByLaserFromShip:inDirection:offset:gettingRangeFound:, OOBigFragmentBurstEntity::fragmentBurstFromEntity:, OOSmallFragmentBurstEntity::fragmentBurstFromEntity:, Universe::getSafeVectorFromEntity:toDistance:fromPoint:, Universe::getStationMarkets, Universe::getSunSkimEndPositionForShip:, Universe::getSunSkimStartPositionForShip:, Universe::hazardOnRouteFromEntity:toDistance:fromPoint:, init, PlanetEntity(OOPrivate)::initAsAtmosphereForPlanet:dictionary:, OOExplosionCloudEntity(OOPrivate)::initExplosionCloudWithEntity:size:andSettings:, OOECMBlastEntity::initFromShip:, OOLaserShotEntity::initLaserFromShip:direction:offset:, OOQuiriumCascadeEntity::initQuiriumCascadeFromShip:, OORingEffectEntity::initRingFromEntity:, WormholeEntity::initWithDict:, OOWaypointEntity::initWithDictionary:, WormholeEntity::initWormholeTo:fromShip:, PlayerEntity::interpretAIMessage:, DockEntity::isOffCentre, Universe::isVectorClearFromEntity:toDistance:fromPoint:, JSObjectGetVector(), JSObjectGetVector(), ShipEntity::launchCascadeMine, PlayerEntity::launchEscapeCapsule, PlanetEntity::launchShuttle, PlayerEntity::leaveWitchspace, Universe::legacyPositionFrom:asCoordinateSystem:, PlayerEntity(LoadSave)::loadPlayerFromFile:asNew:, PlayerEntity::lookingAtSunWithThresholdAngleCos:, ShipEntity::lookingAtSunWithThresholdAngleCos:, moveForward:, Universe::nearestEntityMatchingPredicate:parameter:relativeToEntity:, ShipEntity::onTarget:withWeapon:, Universe::populateNormalSpace, position, DockEntity::pruneAndCountShipsOnApproach, ShipEntity::rangeToDestination, ShipEntity::rangeToSecondaryTarget:, ShipEntity::realAlertCondition, relativePosition, ShipEntity::releaseCargoPodsDebris, OOVisualEffectEntity::rescaleBy:, ShipEntity(Private)::rescaleBy:writeToCache:, OOExhaustPlumeEntity::resetPlume, ShipEntity(LoadRestore)::savedShipDictionaryWithContext:, ShipEntity::sendExpandedMessage:toShip:, ShipEntity::sendMessage:toShip:withUnpilotedOverride:, ShipEntity(PureAI)::setDestinationToDockingAbort, ShipEntity(PureAI)::setDestinationToTarget, ShipEntity(PureAI)::setDestinationWithinTarget, DockEntity::setDimensionsAndCorridor:ddc:launching:, Universe::setLighting, ShipEntity(PureAI)::setPlanetPatrolCoordinates, setPosition:, PlanetEntity::setPosition:, setPositionX:y:z:, ShipEntity::setProximityAlert:, ShipEntity(PureAI)::setRacepointsFromTarget, OOVisualEffectEntity::setScaleX:, OOVisualEffectEntity::setScaleY:, OOVisualEffectEntity::setScaleZ:, ShipEntity(PureAI)::setSunSkimExitCoordinates, ShipEntity::setTargetToNearestStationIncludingHostiles:, Universe(OOPrivate)::setUpInitialUniverse, CollisionRegion::shadowAtPointOcclusionToValue, DockEntity::shipIsInDockingCorridor:, Universe::spawnShip:, ShipEntity::startTrackingCurve, WormholeEntity::suckInShip:, ShipEntity::SurfaceDistanceSqared, ShipEntity::SurfaceDistanceSqaredV, PlayerEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, PlayerEntity::takeScrapeDamage:from:, ShipEntity(PureAI)::thargonCheckMother, ShipEntity::throwSparks, ShipEntity::trackDestination:retreat:, ShipEntity::trackPrimaryTarget:retreat:, ShipEntity::trackSideTarget:leftside:, transformationMatrix, update:, OOExhaustPlumeEntity::update:, OOLaserShotEntity::update:, OOPlasmaShotEntity::update:, OOQuiriumCascadeEntity::update:, OOSunEntity::update:, ShipEntity::update:, SkyEntity::update:, WormholeEntity::update:, updateLinkedLists, ShipEntity::updateTrackingCurve, vectorTo:, and PlayerEntity::viewpointPosition.

◆ rotMatrix

◆ scanClass

◆ shadingEntityID

- (OOUniversalID) shadingEntityID

Definition at line 122 of file Entity.h.

Referenced by CollisionRegion::findShadowedEntities.

◆ spawnTime

- (GLfloat) spawnTime
protected

Definition at line 980 of file Entity.m.

981{
982 return spawnTime;
983}

Referenced by OOPlasmaShotEntity::canCollide, init, spawnTime, and timeElapsedSinceSpawn.

◆ throw_sparks

◆ universalID

◆ velocity

◆ x_next

◆ x_previous

◆ y_next

◆ y_previous

◆ z_next

◆ z_previous

◆ zero_distance

◆ zero_index

- (int) zero_index

Definition at line 113 of file Entity.h.

Referenced by Universe(OOPrivate)::doRemoveEntity:, and Universe::update:.


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