Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOEntityWithDrawable Class Reference

#include <OOEntityWithDrawable.h>

+ Inheritance diagram for OOEntityWithDrawable:
+ Collaboration diagram for OOEntityWithDrawable:

Instance Methods

(OODrawable *) - drawable
 
(void) - setDrawable:
 
(void) - dealloc [implementation]
 
(double) - findCollisionRadius [implementation]
 
(void) - drawImmediate:translucent: [implementation]
 
(NSSet *) - allTextures [implementation]
 
- Instance Methods inherited from Entity
(NSUInteger) - sessionID
 
(BOOL) - isShip
 
(BOOL) - isDock
 
(BOOL) - isStation
 
(BOOL) - isSubEntity
 
(BOOL) - isPlayer
 
(BOOL) - isPlanet
 
(BOOL) - isSun
 
(BOOL) - isSunlit
 
(BOOL) - isStellarObject
 
(BOOL) - isSky
 
(BOOL) - isWormhole
 
(BOOL) - isEffect
 
(BOOL) - isVisualEffect
 
(BOOL) - isWaypoint
 
(BOOL) - validForAddToUniverse
 
(void) - addToLinkedLists
 
(void) - removeFromLinkedLists
 
(void) - updateLinkedLists
 
(void) - wasAddedToUniverse
 
(void) - wasRemovedFromUniverse
 
(void) - warnAboutHostiles
 
(CollisionRegion *) - collisionRegion
 
(void) - setCollisionRegion:
 
(void) - setUniversalID:
 
(OOUniversalID- universalID
 
(BOOL) - throwingSparks
 
(void) - setThrowSparks:
 
(void) - throwSparks
 
(void) - setOwner:
 
(id) - owner
 
(ShipEntity *) - parentEntity
 
(ShipEntity *) - rootShipEntity
 
(void) - setPosition:
 
(void) - setPositionX:y:z:
 
(HPVector) - position
 
(Vector) - cameraRelativePosition
 
(GLfloat) - cameraRangeFront
 
(GLfloat) - cameraRangeBack
 
(void) - updateCameraRelativePosition
 
(Vector) - vectorTo:
 
(HPVector) - absolutePositionForSubentity
 
(HPVector) - absolutePositionForSubentityOffset:
 
(double) - zeroDistance
 
(double) - camZeroDistance
 
(NSComparisonResult) - compareZeroDistance:
 
(BoundingBox) - boundingBox
 
(GLfloat) - mass
 
(Quaternion) - orientation
 
(void) - setOrientation:
 
(Quaternion) - normalOrientation
 
(void) - setNormalOrientation:
 
(void) - orientationChanged
 
(void) - setVelocity:
 
(Vector) - velocity
 
(double) - speed
 
(GLfloat) - distanceTravelled
 
(void) - setDistanceTravelled:
 
(void) - setStatus:
 
(OOEntityStatus- status
 
(void) - setScanClass:
 
(OOScanClass- scanClass
 
(void) - setEnergy:
 
(GLfloat) - energy
 
(void) - setMaxEnergy:
 
(GLfloat) - maxEnergy
 
(void) - applyRoll:andClimb:
 
(void) - applyRoll:climb:andYaw:
 
(void) - moveForward:
 
(OOMatrix) - rotationMatrix
 
(OOMatrix) - drawRotationMatrix
 
(OOMatrix) - transformationMatrix
 
(OOMatrix) - drawTransformationMatrix
 
(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
 
(BOOL) - isVisible
 
(BOOL) - isInSpace
 
(BOOL) - isImmuneToBreakPatternHide
 
(GLfloat) - universalTime
 
(GLfloat) - spawnTime
 
(GLfloat) - timeElapsedSinceSpawn
 
(void) - setAtmosphereFogging:
 
(OOColor *) - fogUniform
 
(NSString *) - descriptionForObjDumpBasic
 
(NSString *) - descriptionForObjDump
 
(id) - init [implementation]
 
(NSString *) - descriptionComponents [implementation]
 
(BOOL) - checkLinkedLists [implementation]
 
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
 
(Vector) - relativePosition [implementation]
 
(void) - subEntityReallyDied: [implementation]
 
(BOOL) - isBreakPattern
 
(void) - inspect [implementation]
 
(BOOL) - isECMBlast
 
(NSArray *) - debugInspectorModules [implementation]
 
(NSString *) - inspScanClassLine
 
(NSString *) - inspStatusLine
 
(NSString *) - inspRetainCountLine
 
(NSString *) - inspPositionLine
 
(NSString *) - inspVelocityLine
 
(NSString *) - inspOrientationLine
 
(NSString *) - inspEnergyLine
 
(NSString *) - inspOwnerLine
 
(NSString *) - inspTargetLine
 
(NSString *) - inspDescription [implementation]
 
(NSString *) - inspBasicIdentityLine [implementation]
 
(BOOL) - isExhaust
 
(BOOL) - isFlasher
 
(BOOL) - isVisibleToScripts
 
(NSString *) - oo_jsClassName
 
(void) - getJSClass:andPrototype:
 
(void) - deleteJSSelf
 
(jsval) - oo_jsValueInContext: [implementation]
 
(BOOL) - isCascadeWeapon
 
(BOOL) - isPlayerLikeShip
 
(GLfloat) - clock [implementation]
 
(unsigned) - pseudoFixedD100 [implementation]
 
(unsigned) - pseudoFixedD256 [implementation]
 
(unsigned) - systemGovernment [implementation]
 
(unsigned) - systemEconomy [implementation]
 
(unsigned) - systemTechLevel [implementation]
 
(unsigned) - systemPopulation [implementation]
 
(unsigned) - systemProductivity [implementation]
 
(BOOL) - isShipWithSubEntityShip:
 
(void) - drawSubEntityImmediate:translucent: [implementation]
 
- Instance Methods inherited from OOWeakRefObject
(id) - weakSelf
 
(id) - weakRetain [implementation]
 
(void) - weakRefDied: [implementation]
 
- Instance Methods inherited from <OOWeakReferenceSupport>
(id) - OO_RETURNS_RETAINED
 

Private Attributes

OODrawabledrawable
 

Additional Inherited Members

- Public Attributes inherited from Entity
OOUniversalID universalID
 
unsigned isShip: 1
 
unsigned isStation: 1
 
unsigned isPlayer: 1
 
unsigned isWormhole: 1
 
unsigned isSubEntity: 1
 
unsigned hasMoved: 1
 
unsigned hasRotated: 1
 
unsigned hasCollided: 1
 
unsigned isSunlit: 1
 
unsigned collisionTestFilter: 2
 
unsigned throw_sparks: 1
 
unsigned isImmuneToBreakPatternHide: 1
 
unsigned isExplicitlyNotMainStation: 1
 
unsigned isVisualEffect: 1
 
OOScanClass scanClass
 
GLfloat zero_distance
 
GLfloat cam_zero_distance
 
GLfloat no_draw_distance
 
GLfloat collision_radius
 
HPVector position
 
Vector cameraRelativePosition
 
Quaternion orientation
 
OOColoratmosphereFogging
 
int zero_index
 
Entityx_previous
 
Entityx_next
 
Entityy_previous
 
Entityy_next
 
Entityz_previous
 
Entityz_next
 
Entitycollision_chain
 
OOUniversalID shadingEntityID
 
Entitycollider
 
CollisionRegioncollisionRegion
 
- Protected Attributes inherited from Entity
HPVector lastPosition
 
Quaternion lastOrientation
 
GLfloat distanceTravelled
 
OOMatrix rotMatrix
 
Vector velocity
 
GLfloat energy
 
GLfloat maxEnergy
 
BoundingBox boundingBox
 
GLfloat mass
 
NSMutableArray * collidingEntities
 
OOTimeAbsolute spawnTime
 
struct JSObject * _jsSelf
 
- Protected Attributes inherited from OOWeakRefObject
OOWeakReferenceweakSelf
 

Detailed Description

Definition at line 44 of file OOEntityWithDrawable.h.

Method Documentation

◆ allTextures

- (NSSet *) allTextures
implementation

Reimplemented from Entity.

Definition at line 1 of file OOEntityWithDrawable.m.

131{
132 return [[self drawable] allTextures];
133}

References Entity::dealloc, drawable, and nil.

+ Here is the call graph for this function:

◆ dealloc

- (void) dealloc
implementation

Reimplemented from Entity.

Reimplemented in DockEntity, OOVisualEffectEntity, PlayerEntity, ShipEntity, SkyEntity, and StationEntity.

Definition at line 1 of file OOEntityWithDrawable.m.

35{
36 [drawable release];
37 drawable = nil;
38
39 [super dealloc];
40}
return nil

◆ drawable

- (OODrawable *) drawable

Definition at line 1 of file OOEntityWithDrawable.m.

44{
45 return drawable;
46}

◆ drawImmediate:translucent:

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

Reimplemented from Entity.

Reimplemented in DockEntity, OOVisualEffectEntity, PlayerEntity, ShipEntity, and SkyEntity.

Definition at line 1 of file OOEntityWithDrawable.m.

70 :(bool)immediate translucent:(bool)translucent
71{
73 {
74 // Don't draw.
75 return;
76 }
77
78 if (no_draw_distance != INFINITY && ![self isImmuneToBreakPatternHide])
79 {
80 // (always draw sky, always draw break patterns)
81 if (![self isSubEntity])
82 {
83 GLfloat clipradius = collision_radius;
84 if ([self isShip])
85 {
86 ShipEntity* shipself = (ShipEntity*)self;
87 clipradius = [shipself frustumRadius];
88 }
89 else if ([self isVisualEffect])
90 {
92 clipradius = [veself frustumRadius];
93 }
94 // don't bother with frustum culling within/near collision radius, as
95 // potential for problems with floating point inaccuracy causing
96 // unwanted disappearance maybe fix
97 // http://aegidian.org/bb/viewtopic.php?f=3&t=13619 - CIM
98 if (cam_zero_distance > (clipradius+1000)*(clipradius+1000))
99 {
100 if (![UNIVERSE viewFrustumIntersectsSphereAt:cameraRelativePosition withRadius:clipradius])
101 {
102 return;
103 }
104 }
105 }
106 else // is subentity
107 {
108 // don't bother with frustum culling within 1km, as above - CIM
110 {
111 // check correct sub-entity position
112 if (![UNIVERSE viewFrustumIntersectsSphereAt:cameraRelativePosition withRadius:[self collisionRadius]])
113 {
114 return;
115 }
116 }
117 }
118 }
119
120 if ([UNIVERSE wireframeGraphics]) OOGLWireframeModeOn();
121
122 if (translucent) [drawable renderTranslucentParts];
123 else [drawable renderOpaqueParts];
124
125 if ([UNIVERSE wireframeGraphics]) OOGLWireframeModeOff();
126}
void OOGLWireframeModeOn(void)
Definition OOOpenGL.m:87
void OOGLWireframeModeOff(void)
Definition OOOpenGL.m:103
#define UNIVERSE
Definition Universe.h:840
unsigned isImmuneToBreakPatternHide
Definition Entity.h:102
GLfloat collision_radius
Definition Entity.h:111
unsigned isVisualEffect
Definition Entity.h:104
unsigned isSubEntity
Definition Entity.h:95
unsigned isShip
Definition Entity.h:91
GLfloat collisionRadius()
Definition Entity.m:905
Vector cameraRelativePosition
Definition Entity.h:113
GLfloat cam_zero_distance
Definition Entity.h:109
GLfloat no_draw_distance
Definition Entity.h:110
GLfloat frustumRadius()
Definition ShipEntity.m:890

◆ findCollisionRadius

- (double) findCollisionRadius
implementation

Reimplemented from Entity.

Definition at line 1 of file OOEntityWithDrawable.m.

65{
66 return [drawable collisionRadius];
67}

◆ setDrawable:

- (void) setDrawable: (OODrawable *) drawable

Definition at line 1 of file OOEntityWithDrawable.m.

49 :(OODrawable *)inDrawable
50{
51 if (inDrawable != drawable)
52 {
53 [drawable autorelease];
54 drawable = [inDrawable retain];
55 [drawable setBindingTarget:self];
56
59 boundingBox = [drawable boundingBox];
60 }
61}
BoundingBox boundingBox
Definition Entity.h:145
GLfloat collisionRadius()
Definition OODrawable.m:58
GLfloat maxDrawDistance()
Definition OODrawable.m:64
BoundingBox boundingBox()
Definition OODrawable.m:70
void setBindingTarget:(id< OOWeakReferenceSupport > target)
Definition OODrawable.m:76

Member Data Documentation

◆ drawable

- (OODrawable*) drawable
private

Definition at line 47 of file OOEntityWithDrawable.h.

Referenced by allTextures.


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