Oolite
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]
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
(NSUInteger) - lastDrawCounter
(void) - setLastDrawCounter:
(BOOL) - isVisible
(BOOL) - isInSpace
(BOOL) - isImmuneToBreakPatternHide
(GLfloat) - universalTime
(GLfloat) - spawnTime
(GLfloat) - timeElapsedSinceSpawn
(void) - setAtmosphereFogging:
(OOColor *) - fogUniform
(id) - init [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

Private Attributes

OODrawable * drawable

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

Detailed Description

Definition at line 42 of file OOEntityWithDrawable.h.

Method Documentation

◆ dealloc

- (void) dealloc
implementation

Reimplemented from Entity.

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

Definition at line 33 of file OOEntityWithDrawable.m.

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

References Entity::dealloc, dealloc, drawable, and nil.

Referenced by dealloc, OOVisualEffectEntity::dealloc, ShipEntity::dealloc, and SkyEntity::dealloc.

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

◆ drawable

Definition at line 41 of file OOEntityWithDrawable.m.

42{
43 return drawable;
44}

◆ drawImmediate:translucent:

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

Reimplemented from Entity.

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

Definition at line 64 of file OOEntityWithDrawable.m.

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

References Entity::cam_zero_distance, Entity::cameraRelativePosition, Entity::collision_radius, Entity::collisionRadius, OOVisualEffectEntity::frustumRadius, ShipEntity::frustumRadius, Entity::isImmuneToBreakPatternHide, Entity::isShip, Entity::isSubEntity, Entity::isVisualEffect, Entity::no_draw_distance, OOGLWireframeModeOff(), OOGLWireframeModeOn(), OODrawable::renderOpaqueParts, OODrawable::renderTranslucentParts, and UNIVERSE.

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

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

◆ findCollisionRadius

- (double) findCollisionRadius
implementation

Reimplemented from Entity.

Definition at line 59 of file OOEntityWithDrawable.m.

60{
61 return [drawable collisionRadius];
62}

References OODrawable::collisionRadius, and findCollisionRadius.

Referenced by OOVisualEffectEntity::clearSubEntities, ShipEntity::clearSubEntities, findCollisionRadius, and ShipEntity::frustumRadius.

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

◆ setDrawable:

- (void) setDrawable: (OODrawable*) drawable

Definition at line 46 of file OOEntityWithDrawable.m.

46 :(OODrawable*)inDrawable
47{
48 if (inDrawable != drawable) {
49 [drawable autorelease];
50 drawable = [inDrawable retain];
51 [drawable setBindingTarget:self];
52
55 boundingBox = [drawable boundingBox];
56 }
57}
BoundingBox boundingBox
Definition Entity.m:666
GLfloat collisionRadius()
Definition OODrawable.m:51
GLfloat maxDrawDistance()
Definition OODrawable.m:56
BoundingBox boundingBox()
Definition OODrawable.m:61
void setBindingTarget:(id< OOWeakReferenceSupport > target)
Definition OODrawable.m:66

References OODrawable::boundingBox, Entity::boundingBox, Entity::collision_radius, OODrawable::collisionRadius, drawable, OODrawable::maxDrawDistance, Entity::no_draw_distance, and OODrawable::setBindingTarget:.

Referenced by SkyEntity::initWithColors:col2:andSystemInfo:, OOVisualEffectEntity::setMesh:, and ShipEntity::setMesh:.

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

Member Data Documentation

◆ drawable

- (OODrawable*) drawable
private

Definition at line 41 of file OOEntityWithDrawable.m.

42{
43 return drawable;
44}

Referenced by dealloc, OOVisualEffectEntity::mesh, ShipEntity::mesh, setDrawable:, and ShipEntity::setOwner:.


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