Oolite 1.91.0.7665-250419-c535bfe
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
DustEntity Class Reference

#include <DustEntity.h>

+ Inheritance diagram for DustEntity:
+ Collaboration diagram for DustEntity:

Instance Methods

(void) - setDustColor:
 
(OOColor *) - dustColor
 
(id) - init [implementation]
 
(void) - dealloc [implementation]
 
(BOOL) - canCollide [implementation]
 
(void) - updateCameraRelativePosition [implementation]
 
(void) - update: [implementation]
 
(Vector) - warpVector [implementation]
 
(void) - drawImmediate:translucent: [implementation]
 
(void) - resetGraphicsState [implementation]
 
(NSString *) - descriptionForObjDump [implementation]
 
(void) - checkShaderMode [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
 
(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
 
(GLfloat) - collisionRadius
 
(GLfloat) - frustumRadius
 
(void) - setCollisionRadius:
 
(NSMutableArray *) - collisionArray
 
(void) - applyVelocity:
 
(BOOL) - checkCloseCollisionWith:
 
(void) - takeEnergyDamage:from:becauseOf:weaponIdentifier:
 
(void) - dumpState
 
(void) - dumpSelfState
 
(double) - findCollisionRadius
 
(BOOL) - isVisible
 
(BOOL) - isInSpace
 
(BOOL) - isImmuneToBreakPatternHide
 
(GLfloat) - universalTime
 
(GLfloat) - spawnTime
 
(GLfloat) - timeElapsedSinceSpawn
 
(void) - setAtmosphereFogging:
 
(OOColor *) - fogUniform
 
(NSString *) - descriptionForObjDumpBasic
 
(NSSet *) - allTextures
 
(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

OOColordust_color
 
Vector vertices [DUST_N_PARTICLES *2]
 
GLushort indices [DUST_N_PARTICLES *2]
 
GLfloat color_fv [4]
 
OOTexturetexture
 
bool hasPointSprites
 
bool drawDust
 

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 37 of file DustEntity.h.

Method Documentation

◆ canCollide

- (BOOL) canCollide
implementation

Reimplemented from Entity.

Definition at line 150 of file DustEntity.m.

151{
152 return NO;
153}

References canCollide.

Referenced by canCollide.

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

◆ checkShaderMode

- (void) checkShaderMode
implementation

Provided by category DustEntity(Private).

Referenced by drawImmediate:translucent:, and update:.

+ Here is the caller graph for this function:

◆ dealloc

- (void) dealloc
implementation

Reimplemented from Entity.

Definition at line 121 of file DustEntity.m.

122{
125
127#if OO_SHADERS
128 DESTROY(shader);
129 DESTROY(uniforms);
130#endif
131
132 [super dealloc];
133}
#define DESTROY(x)
Definition OOCocoa.h:77
OOColor * dust_color
Definition DustEntity.h:40
OOTexture * texture
Definition DustEntity.h:44
void unregisterClient:(id< OOGraphicsResetClient > client)
OOGraphicsResetManager * sharedManager()

References dealloc, Entity::dealloc, DESTROY, dust_color, OOGraphicsResetManager::sharedManager, texture, and OOGraphicsResetManager::unregisterClient:.

Referenced by dealloc.

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

◆ descriptionForObjDump

- (NSString *) descriptionForObjDump
implementation

Reimplemented from Entity.

Definition at line 446 of file DustEntity.m.

447{
448 // Don't include range and visibility flag as they're irrelevant.
449 return [self descriptionForObjDumpBasic];
450}

References descriptionForObjDump, and Entity::descriptionForObjDumpBasic.

Referenced by descriptionForObjDump.

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

◆ drawImmediate:translucent:

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

Reimplemented from Entity.

Definition at line 269 of file DustEntity.m.

269 :(bool)immediate translucent:(bool)translucent
270{
271 if (!drawDust || [UNIVERSE breakPatternHide] || !translucent) return; // DON'T DRAW
272
273 PlayerEntity* player = PLAYER;
274 assert(player != nil);
275
276#ifndef NDEBUG
277 if (gDebugFlags & DEBUG_NO_DUST) return;
278#endif
279
280#if OO_SHADERS
281 if (EXPECT_NOT(shaderMode == kShaderModeUnknown)) [self checkShaderMode];
282 BOOL useShader = (shaderMode == kShaderModeOn);
283#endif
284
285
286 GLfloat *fogcolor = [UNIVERSE skyClearColor];
287 float idealDustSize = [[UNIVERSE gameView] viewSize].width / 800.0f;
288
289 BOOL warp_stars = [player atHyperspeed];
290 float dustIntensity;
291
294 OOGL(glDisableClientState(GL_NORMAL_ARRAY));
295
296 if (!warp_stars)
297 {
298 // Draw points.
299 float dustPointSize = ceil(idealDustSize);
300 if (dustPointSize < 1.0f) dustPointSize = 1.0f;
301 OOGL(GLScaledPointSize(dustPointSize));
302 dustIntensity = OOClamp_0_1_f(idealDustSize / dustPointSize);
303 }
304 else
305 {
306 // Draw lines.
307 float idealLineSize = idealDustSize * 0.5f;
308 float dustLineSize = ceil(idealLineSize);
309 if (dustLineSize < 1.0f) dustLineSize = 1.0f;
310 GLScaledLineWidth(dustLineSize);
311 dustIntensity = OOClamp_0_1_f(idealLineSize / dustLineSize);
312 }
313 if (fogcolor[3] > 0.0)
314 {
315 // fade out dust when entering atmosphere (issue #100)
316 dustIntensity = OOClamp_0_1_f(dustIntensity-(fogcolor[3]*3.0));
317 }
318
319
320 if (dustIntensity > 0.0)
321 {
322
323 float *color = NULL;
324 if (player->isSunlit) color = color_fv;
325 else color = UNIVERSE->stars_ambient;
326 OOGL(glColor4f(color[0], color[1], color[2], dustIntensity));
327
328#if OO_SHADERS
329 if (useShader)
330 {
331 [[self shader] apply];
332 [uniforms makeObjectsPerformSelector:@selector(apply)];
333 }
334 else
335#endif
336 {
337 OOGL(glEnable(GL_FOG));
338 OOGL(glFogi(GL_FOG_MODE, GL_LINEAR));
339 OOGL(glFogfv(GL_FOG_COLOR, fogcolor));
340 OOGL(glHint(GL_FOG_HINT, GL_NICEST));
341 OOGL(glFogf(GL_FOG_START, NEAR_PLANE));
342 OOGL(glFogf(GL_FOG_END, FAR_PLANE));
343 }
344
345 OOGL(glEnable(GL_BLEND));
346 OOGL(glDepthMask(GL_FALSE));
347
348 if (warp_stars)
349 {
350 OOGL(glDisable(GL_TEXTURE_2D));
351#if OO_SHADERS
352 if (useShader)
353 {
354 OOGL(glEnableVertexAttribArrayARB(kTangentAttributeIndex));
355 OOGL(glVertexAttribPointerARB(kTangentAttributeIndex, 1, GL_FLOAT, GL_FALSE, 0, warpinessAttr));
356 }
357 else
358#endif
359 {
360 Vector warpVector = [self warpVector];
361 unsigned vi;
362 for (vi = 0; vi < DUST_N_PARTICLES; vi++)
363 {
364 vertices[vi + DUST_N_PARTICLES] = vector_subtract(vertices[vi], warpVector);
365 }
366 }
367
368 OOGL(glVertexPointer(3, GL_FLOAT, 0, vertices));
369 OOGL(glDrawElements(GL_LINES, DUST_N_PARTICLES * 2, GL_UNSIGNED_SHORT, indices));
370
371#if OO_SHADERS
372 if (useShader)
373 {
374 OOGL(glDisableVertexAttribArrayARB(kTangentAttributeIndex));
375 }
376#endif
377 OOGL(glEnable(GL_TEXTURE_2D));
378
379 }
380 else
381 {
382 if (hasPointSprites)
383 {
384#if OO_SHADERS
385 if (!useShader)
386#endif
387 {
388 OOGL(glBlendFunc(GL_SRC_ALPHA, GL_ONE));
389 }
390 OOGL(glEnable(GL_POINT_SPRITE_ARB));
391 [texture apply];
392 OOGL(glVertexPointer(3, GL_FLOAT, 0, vertices));
393 OOGL(glDrawArrays(GL_POINTS, 0, DUST_N_PARTICLES));
394 OOGL(glDisable(GL_POINT_SPRITE_ARB));
395 }
396 else
397 {
398 OOGL(glDisable(GL_TEXTURE_2D));
399 OOGL(glVertexPointer(3, GL_FLOAT, 0, vertices));
400 OOGL(glDrawArrays(GL_POINTS, 0, DUST_N_PARTICLES));
401 OOGL(glEnable(GL_TEXTURE_2D));
402 }
403 }
404
405 // reapply normal conditions
406#if OO_SHADERS
407 if (useShader)
408 {
409 [OOShaderProgram applyNone];
410 }
411 else
412#endif
413 {
414 OOGL(glDisable(GL_FOG));
415 OOGL(glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA));
416 }
417
418 OOGL(glDisable(GL_BLEND));
419 OOGL(glDepthMask(GL_TRUE));
420
421 }
422 OOGL(glEnableClientState(GL_NORMAL_ARRAY));
423
425 OOCheckOpenGLErrors(@"DustEntity after drawing %@", self);
426}
NSUInteger gDebugFlags
Definition main.m:7
#define DUST_N_PARTICLES
Definition DustEntity.h:32
#define NEAR_PLANE
Definition DustEntity.m:45
#define FAR_PLANE
Definition DustEntity.m:44
@ DEBUG_NO_DUST
#define EXPECT_NOT(x)
#define OO_ENTER_OPENGL()
@ OPENGL_STATE_OPAQUE
Definition OOOpenGL.h:123
#define OOVerifyOpenGLState()
Definition OOOpenGL.h:136
BOOL OOCheckOpenGLErrors(NSString *format,...)
Definition OOOpenGL.m:39
void GLScaledLineWidth(GLfloat width)
Definition OOOpenGL.m:218
#define OOSetOpenGLState(STATE)
Definition OOOpenGL.h:135
#define OOGL(statement)
Definition OOOpenGL.h:251
void GLScaledPointSize(GLfloat size)
Definition OOOpenGL.m:225
return nil
#define PLAYER
#define UNIVERSE
Definition Universe.h:840
Vector vertices[DUST_N_PARTICLES *2]
Definition DustEntity.h:41
bool drawDust
Definition DustEntity.h:46
bool hasPointSprites
Definition DustEntity.h:45
GLushort indices[DUST_N_PARTICLES *2]
Definition DustEntity.h:42
GLfloat color_fv[4]
Definition DustEntity.h:43
Vector warpVector()
Definition DustEntity.m:263
unsigned isSunlit
Definition Entity.m:173

References OOTexture::apply, PlayerEntity::atHyperspeed, checkShaderMode, color_fv, DEBUG_NO_DUST, drawDust, DUST_N_PARTICLES, EXPECT_NOT, FAR_PLANE, gDebugFlags, GLScaledLineWidth(), GLScaledPointSize(), hasPointSprites, indices, Entity::isSunlit, NEAR_PLANE, nil, OO_ENTER_OPENGL, OOCheckOpenGLErrors(), OOGL, OOSetOpenGLState, OOVerifyOpenGLState, OPENGL_STATE_OPAQUE, PLAYER, UNIVERSE, vertices, and warpVector.

+ Here is the call graph for this function:

◆ dustColor

- (OOColor *) dustColor

Definition at line 144 of file DustEntity.m.

145{
146 return dust_color;
147}

References dust_color, and dustColor.

Referenced by dustColor.

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

◆ init

- (id) init
implementation

Reimplemented from Entity.

Definition at line 67 of file DustEntity.m.

68{
69 int vi;
70
71// this should be unnecessary
72// ranrot_srand((uint32_t)[[NSDate date] timeIntervalSince1970]); // seed randomiser by time
73
74 self = [super init];
75
76 for (vi = 0; vi < DUST_N_PARTICLES; vi++)
77 {
78 vertices[vi].x = (ranrot_rand() % DUST_SCALE) - DUST_SCALE / 2;
79 vertices[vi].y = (ranrot_rand() % DUST_SCALE) - DUST_SCALE / 2;
80 vertices[vi].z = (ranrot_rand() % DUST_SCALE) - DUST_SCALE / 2;
81
82 // Set up element index array for warp mode.
83 indices[vi * 2] = vi;
84 indices[vi * 2 + 1] = vi + DUST_N_PARTICLES;
85
86#if OO_SHADERS
87 vertices[vi + DUST_N_PARTICLES] = vertices[vi];
88 warpinessAttr[vi] = 0.0f;
89 warpinessAttr[vi + DUST_N_PARTICLES] = 1.0f;
90#endif
91 }
92
93#if OO_SHADERS
94 shaderMode = kShaderModeUnknown;
95#endif
96
97 drawDust = ![[[NSProcessInfo processInfo] arguments] containsObject:@"-nodust"];
98
99 dust_color = [[OOColor colorWithRed:0.5 green:1.0 blue:1.0 alpha:1.0] retain];
100 [self setStatus:STATUS_ACTIVE];
101
103
104 if (hasPointSprites)
105 {
106 texture = [[OOTexture textureWithName:@"oolite-particle-dust.png"
107 inFolder:@"Textures"
108 options:kOOTextureMinFilterMipMap | kOOTextureMagFilterLinear | kOOTextureAlphaMask
109 anisotropy:kOOTextureDefaultAnisotropy / 2.0
110 lodBias:0.0] retain];
111 }
112
113 collision_radius = DUST_SCALE; // for draw pass calculations
114
116
117 return self;
118}
#define DUST_SCALE
Definition DustEntity.h:31
GLfloat collision_radius
Definition Entity.h:111
OOColor * colorWithRed:green:blue:alpha:(float red,[green] float green,[blue] float blue,[alpha] float alpha)
Definition OOColor.m:95
void registerClient:(id< OOGraphicsResetClient > client)
OOOpenGLExtensionManager * sharedManager()
BOOL haveExtension:(NSString *extension)
id textureWithName:inFolder:options:anisotropy:lodBias:(NSString *name,[inFolder] NSString *directory,[options] OOTextureFlags options,[anisotropy] GLfloat anisotropy,[lodBias] GLfloat lodBias)
Definition OOTexture.m:134
#define ranrot_rand()

References Entity::collision_radius, OOColor::colorWithRed:green:blue:alpha:, drawDust, dust_color, DUST_N_PARTICLES, DUST_SCALE, hasPointSprites, OOOpenGLExtensionManager::haveExtension:, indices, init, Entity::init, ranrot_rand, OOGraphicsResetManager::registerClient:, Entity::setStatus:, OOGraphicsResetManager::sharedManager, OOOpenGLExtensionManager::sharedManager, texture, OOTexture::textureWithName:inFolder:options:anisotropy:lodBias:, and vertices.

Referenced by init.

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

◆ resetGraphicsState

- (void) resetGraphicsState
implementation

Definition at line 429 of file DustEntity.m.

430{
431#if OO_SHADERS
432 DESTROY(shader);
433 DESTROY(uniforms);
434
435 shaderMode = kShaderModeUnknown;
436
437 /* Duplicate vertex data. This is only required if we're switching from
438 non-shader mode to a shader mode, but let's KISS.
439 */
441#endif
442}

References DESTROY, DUST_N_PARTICLES, resetGraphicsState, and vertices.

Referenced by resetGraphicsState.

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

◆ setDustColor:

- (void) setDustColor: (OOColor *) color

Definition at line 136 of file DustEntity.m.

136 :(OOColor *) color
137{
138 if (dust_color) [dust_color release];
139 dust_color = [color retain];
140 [dust_color getRed:&color_fv[0] green:&color_fv[1] blue:&color_fv[2] alpha:&color_fv[3]];
141}

References dust_color, and OOColor::getRed:green:blue:alpha:.

Referenced by Universe::setSystemDataForGalaxy:planet:key:value:fromManifest:forLayer:, and Universe::setUpSpace.

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

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from Entity.

Definition at line 163 of file DustEntity.m.

163 :(OOTimeDelta) delta_t
164{
165 // [self setPosition:position];
166 zero_distance = 0.0;
167
168#if OO_SHADERS
169 if (EXPECT_NOT(shaderMode == kShaderModeUnknown)) [self checkShaderMode];
170
171 // Shader takes care of repositioning.
172 if (shaderMode == kShaderModeOn) return;
173#endif
174
175 Vector offset = vector_flip(cameraRelativePosition);
176 GLfloat half_scale = DUST_SCALE * 0.50;
177 int vi;
178 for (vi = 0; vi < DUST_N_PARTICLES; vi++)
179 {
180 while (vertices[vi].x - offset.x < -half_scale)
181 vertices[vi].x += DUST_SCALE;
182 while (vertices[vi].x - offset.x > half_scale)
183 vertices[vi].x -= DUST_SCALE;
184
185 while (vertices[vi].y - offset.y < -half_scale)
186 vertices[vi].y += DUST_SCALE;
187 while (vertices[vi].y - offset.y > half_scale)
188 vertices[vi].y -= DUST_SCALE;
189
190 while (vertices[vi].z - offset.z < -half_scale)
191 vertices[vi].z += DUST_SCALE;
192 while (vertices[vi].z - offset.z > half_scale)
193 vertices[vi].z -= DUST_SCALE;
194 }
195}
float y
float x
double OOTimeDelta
Definition OOTypes.h:224
GLfloat zero_distance
Definition Entity.h:108
Vector cameraRelativePosition
Definition Entity.m:617
voidpf uLong offset
Definition ioapi.h:140

References Entity::cameraRelativePosition, checkShaderMode, DUST_N_PARTICLES, DUST_SCALE, EXPECT_NOT, vertices, x, y, and Entity::zero_distance.

+ Here is the call graph for this function:

◆ updateCameraRelativePosition

- (void) updateCameraRelativePosition
implementation

Reimplemented from Entity.

Definition at line 156 of file DustEntity.m.

157{
158 HPVector c_pos = [PLAYER viewpointPosition];
159 cameraRelativePosition = make_vector((OOScalar)-fmod(c_pos.x,DUST_SCALE),(OOScalar)-fmod(c_pos.y,DUST_SCALE),(OOScalar)-fmod(c_pos.z,DUST_SCALE));
160}
GLfloat OOScalar
Definition OOMaths.h:64

References Entity::cameraRelativePosition, DUST_SCALE, and updateCameraRelativePosition.

Referenced by updateCameraRelativePosition.

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

◆ warpVector

- (Vector) warpVector
implementation

Definition at line 263 of file DustEntity.m.

264{
265 return vector_multiply_scalar([PLAYER velocity], 1.0f / HYPERSPEED_FACTOR);
266}
#define HYPERSPEED_FACTOR
Vector velocity
Definition Entity.m:763

References HYPERSPEED_FACTOR, PLAYER, Entity::velocity, and warpVector.

Referenced by drawImmediate:translucent:, and warpVector.

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

Member Data Documentation

◆ color_fv

- (GLfloat color_fv[4])
private

Definition at line 43 of file DustEntity.h.

Referenced by drawImmediate:translucent:.

◆ drawDust

- (bool) drawDust
private

Definition at line 46 of file DustEntity.h.

Referenced by drawImmediate:translucent:, and init.

◆ dust_color

- (OOColor*) dust_color
private

Definition at line 40 of file DustEntity.h.

Referenced by dealloc, dustColor, init, and setDustColor:.

◆ hasPointSprites

- (bool) hasPointSprites
private

Definition at line 45 of file DustEntity.h.

Referenced by drawImmediate:translucent:, and init.

◆ indices

- (GLushort indices[DUST_N_PARTICLES *2])
private

Definition at line 42 of file DustEntity.h.

Referenced by drawImmediate:translucent:, and init.

◆ texture

- (OOTexture*) texture
private

Definition at line 44 of file DustEntity.h.

Referenced by dealloc, and init.

◆ vertices

- (Vector vertices[DUST_N_PARTICLES *2])
private

Definition at line 41 of file DustEntity.h.

Referenced by drawImmediate:translucent:, init, resetGraphicsState, and update:.


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