Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
ShipEntity.m File Reference
import "ShipEntity.h"
import "ShipEntityAI.h"
import "ShipEntityScriptMethods.h"
import "OOMaths.h"
import "Universe.h"
import "OOShaderMaterial.h"
import "OOOpenGLExtensionManager.h"
import "ResourceManager.h"
import "OOStringExpander.h"
import "OOStringParsing.h"
import "OOCollectionExtractors.h"
import "OOConstToString.h"
import "OOConstToJSString.h"
import "NSScannerOOExtensions.h"
import "OOFilteringEnumerator.h"
import "OORoleSet.h"
import "OOShipGroup.h"
import "OOExcludeObjectEnumerator.h"
import "OOWeakSet.h"
import "GameController.h"
import "MyOpenGLView.h"
import "OOSystemDescriptionManager.h"
import "OOCharacter.h"
import "AI.h"
import "OOMesh.h"
import "OOPlanetDrawable.h"
import "Octree.h"
import "OOColor.h"
import "OOPolygonSprite.h"
import "OOParticleSystem.h"
import "StationEntity.h"
import "DockEntity.h"
import "OOSunEntity.h"
import "OOPlanetEntity.h"
import "PlanetEntity.h"
import "PlayerEntity.h"
import "WormholeEntity.h"
import "OOFlasherEntity.h"
import "OOExhaustPlumeEntity.h"
import "OOSparkEntity.h"
import "OOECMBlastEntity.h"
import "OOPlasmaShotEntity.h"
import "OOFlashEffectEntity.h"
import "OOExplosionCloudEntity.h"
import "ProxyPlayerEntity.h"
import "OOLaserShotEntity.h"
import "OOQuiriumCascadeEntity.h"
import "OORingEffectEntity.h"
import "PlayerEntityLegacyScriptEngine.h"
import "PlayerEntitySound.h"
import "GuiDisplayGen.h"
import "HeadUpDisplay.h"
import "OOEntityFilterPredicate.h"
import "OOShipRegistry.h"
import "OOEquipmentType.h"
import "OODebugGLDrawing.h"
import "OODebugFlags.h"
import "OODebugStandards.h"
import "OOJSScript.h"
import "OOJSVector.h"
import "OOJSEngineTimeManagement.h"
+ Include dependency graph for ShipEntity.m:

Go to the source code of this file.

Classes

category  ShipEntity(Private)
 

Macros

#define USEMASC   1
 
#define kBoulderRole   (@"boulder")
 
#define MAKE_VECTOR_ARRAY(v)   [[[OONativeVector alloc] initWithVector:v] autorelease]
 
#define ADD_FLAG_IF_SET(x)   if (x) { [flags addObject:@#x]; }
 

Functions

static ShipEntitydoOctreesCollide (ShipEntity *prime, ShipEntity *other)
 
NSDictionary * OODefaultShipShaderMacros (void)
 
BOOL OOUniformBindingPermitted (NSString *propertyName, id bindingTarget)
 
GLfloat getWeaponRangeFromType (OOWeaponType weapon_type)
 
BOOL isWeaponNone (OOWeaponType weapon)
 

Variables

static NSString *const kOOLogSyntaxAddShips = @"script.debug.syntax.addShips"
 
static NSString *const kOOLogEntityBehaviourChanged = @"entity.behaviour.changed"
 
static GLfloat cargo_color [4] = { 0.9, 0.9, 0.9, 1.0}
 
static GLfloat hostile_color [4] = { 1.0, 0.25, 0.0, 1.0}
 
static GLfloat neutral_color [4] = { 1.0, 1.0, 0.0, 1.0}
 
static GLfloat friendly_color [4] = { 0.0, 1.0, 0.0, 1.0}
 
static GLfloat missile_color [4] = { 0.0, 1.0, 1.0, 1.0}
 
static GLfloat police_color1 [4] = { 0.5, 0.0, 1.0, 1.0}
 
static GLfloat police_color2 [4] = { 1.0, 0.0, 0.5, 1.0}
 
static GLfloat jammed_color [4] = { 0.0, 0.0, 0.0, 0.0}
 
static GLfloat mascem_color1 [4] = { 0.3, 0.3, 0.3, 1.0}
 
static GLfloat mascem_color2 [4] = { 0.4, 0.1, 0.4, 1.0}
 
static GLfloat scripted_color [4] = { 0.0, 0.0, 0.0, 0.0}
 

Macro Definition Documentation

◆ ADD_FLAG_IF_SET

#define ADD_FLAG_IF_SET ( x)    if (x) { [flags addObject:@#x]; }

◆ kBoulderRole

#define kBoulderRole   (@"boulder")

Definition at line 1657 of file ShipEntity.m.

◆ MAKE_VECTOR_ARRAY

#define MAKE_VECTOR_ARRAY ( v)    [[[OONativeVector alloc] initWithVector:v] autorelease]

Definition at line 1999 of file ShipEntity.m.

◆ USEMASC

#define USEMASC   1

Definition at line 96 of file ShipEntity.m.

Function Documentation

◆ doOctreesCollide()

static ShipEntity * doOctreesCollide ( ShipEntity * prime,
ShipEntity * other )
static

Referenced by ShipEntity::absoluteIJKForSubentity.

+ Here is the caller graph for this function:

◆ getWeaponRangeFromType()

GLfloat getWeaponRangeFromType ( OOWeaponType weapon_type)

Definition at line 14948 of file ShipEntity.m.

14949{
14950 return [weapon_type weaponRange];
14951}

References OOEquipmentType::weaponRange.

+ Here is the call graph for this function:

◆ isWeaponNone()

BOOL isWeaponNone ( OOWeaponType weapon)

Definition at line 14954 of file ShipEntity.m.

14955{
14956 return weapon == nil || [[weapon identifier] isEqualToString:@"EQ_WEAPON_NONE"];
14957}
return nil

Referenced by ShipThreatAssessment(), and StationAddShipToShipyard().

+ Here is the caller graph for this function:

◆ OODefaultShipShaderMacros()

NSDictionary * OODefaultShipShaderMacros ( void )

Definition at line 14898 of file ShipEntity.m.

14899{
14900 static NSDictionary *macros = nil;
14901
14902 if (macros == nil)
14903 {
14904 macros = [[[ResourceManager materialDefaults] oo_dictionaryForKey:@"ship-prefix-macros" defaultValue:[NSDictionary dictionary]] retain];
14905 }
14906
14907 return macros;
14908}

References ResourceManager::materialDefaults, and nil.

+ Here is the call graph for this function:

◆ OOUniformBindingPermitted()

BOOL OOUniformBindingPermitted ( NSString * propertyName,
id bindingTarget )

Definition at line 14911 of file ShipEntity.m.

14912{
14913 static NSSet *entityWhitelist = nil;
14914 static NSSet *shipWhitelist = nil;
14915 static NSSet *playerShipWhitelist = nil;
14916 static NSSet *visualEffectWhitelist = nil;
14917
14918 if (entityWhitelist == nil)
14919 {
14920 NSDictionary *wlDict = [ResourceManager whitelistDictionary];
14921 entityWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_entity_binding_methods"]];
14922 shipWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_ship_binding_methods"]];
14923 playerShipWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_player_ship_binding_methods"]];
14924 visualEffectWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_visual_effect_binding_methods"]];
14925 }
14926
14927 if ([bindingTarget isKindOfClass:[Entity class]])
14928 {
14929 if ([entityWhitelist containsObject:propertyName]) return YES;
14930 if ([bindingTarget isShip])
14931 {
14932 if ([shipWhitelist containsObject:propertyName]) return YES;
14933 }
14934 if ([bindingTarget isPlayerLikeShip])
14935 {
14936 if ([playerShipWhitelist containsObject:propertyName]) return YES;
14937 }
14938 if ([bindingTarget isVisualEffect])
14939 {
14940 if ([visualEffectWhitelist containsObject:propertyName]) return YES;
14941 }
14942 }
14943
14944 return NO;
14945}

References nil, and ResourceManager::whitelistDictionary.

+ Here is the call graph for this function:

Variable Documentation

◆ cargo_color

GLfloat cargo_color[4] = { 0.9, 0.9, 0.9, 1.0}
static

Definition at line 6486 of file ShipEntity.m.

6486{ 0.9, 0.9, 0.9, 1.0}; // gray

◆ friendly_color

GLfloat friendly_color[4] = { 0.0, 1.0, 0.0, 1.0}
static

Definition at line 6489 of file ShipEntity.m.

6489{ 0.0, 1.0, 0.0, 1.0}; // green

◆ hostile_color

GLfloat hostile_color[4] = { 1.0, 0.25, 0.0, 1.0}
static

Definition at line 6487 of file ShipEntity.m.

6487{ 1.0, 0.25, 0.0, 1.0}; // red/orange

◆ jammed_color

GLfloat jammed_color[4] = { 0.0, 0.0, 0.0, 0.0}
static

Definition at line 6493 of file ShipEntity.m.

6493{ 0.0, 0.0, 0.0, 0.0}; // clear black

◆ kOOLogEntityBehaviourChanged

NSString* const kOOLogEntityBehaviourChanged = @"entity.behaviour.changed"
static

Definition at line 101 of file ShipEntity.m.

◆ kOOLogSyntaxAddShips

NSString* const kOOLogSyntaxAddShips = @"script.debug.syntax.addShips"
static

Definition at line 99 of file ShipEntity.m.

◆ mascem_color1

GLfloat mascem_color1[4] = { 0.3, 0.3, 0.3, 1.0}
static

Definition at line 6494 of file ShipEntity.m.

6494{ 0.3, 0.3, 0.3, 1.0}; // dark gray

◆ mascem_color2

GLfloat mascem_color2[4] = { 0.4, 0.1, 0.4, 1.0}
static

Definition at line 6495 of file ShipEntity.m.

6495{ 0.4, 0.1, 0.4, 1.0}; // purple

◆ missile_color

GLfloat missile_color[4] = { 0.0, 1.0, 1.0, 1.0}
static

Definition at line 6490 of file ShipEntity.m.

6490{ 0.0, 1.0, 1.0, 1.0}; // cyan

◆ neutral_color

GLfloat neutral_color[4] = { 1.0, 1.0, 0.0, 1.0}
static

Definition at line 6488 of file ShipEntity.m.

6488{ 1.0, 1.0, 0.0, 1.0}; // yellow

◆ police_color1

GLfloat police_color1[4] = { 0.5, 0.0, 1.0, 1.0}
static

Definition at line 6491 of file ShipEntity.m.

6491{ 0.5, 0.0, 1.0, 1.0}; // purpley-blue

◆ police_color2

GLfloat police_color2[4] = { 1.0, 0.0, 0.5, 1.0}
static

Definition at line 6492 of file ShipEntity.m.

6492{ 1.0, 0.0, 0.5, 1.0}; // purpley-red

◆ scripted_color

GLfloat scripted_color[4] = { 0.0, 0.0, 0.0, 0.0}
static

Definition at line 6496 of file ShipEntity.m.

6496{ 0.0, 0.0, 0.0, 0.0}; // to be defined by script