Oolite
Loading...
Searching...
No Matches
OOSparkEntity(Private) Category Reference

Instance Methods

(void) - performUpdate:

Detailed Description

Definition at line 31 of file OOSparkEntity.m.

Method Documentation

◆ performUpdate:

- (void) performUpdate: (OOTimeDelta) delta_t

Extends class OOSparkEntity.

Definition at line 64 of file OOSparkEntity.m.

64 :(OOTimeDelta)delta_t
65{
66 _timeRemaining -= delta_t;
67
68 float mix = OOClamp_0_1_f(_timeRemaining / _duration);
69
70 // Fade towards red while fading out.
71 _colorComponents[0] = mix * _baseRGBA[0] + (1.0f - mix);
72 _colorComponents[1] = mix * _baseRGBA[1];
73 _colorComponents[2] = mix * _baseRGBA[2];
74 _colorComponents[3] = mix * _baseRGBA[3];
75
76 // Disappear when gone.
77 if (mix == 0)
78 [UNIVERSE removeEntity:self];
79}
OOINLINE float OOClamp_0_1_f(float value) INLINE_CONST_FUNC
double OOTimeDelta
Definition OOTypes.h:193

References OOClamp_0_1_f().

Referenced by OOSparkEntity::initWithPosition:velocity:duration:size:color:, and OOSparkEntity::update:.

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

The documentation for this category was generated from the following file: