MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / destructionUpdate

Method destructionUpdate

source/game/StarParticle.cpp:222–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void Particle::destructionUpdate() {
223 if (destructionTime > 0) {
224 float destructionFactor = (timeToLive + destructionTime) / destructionTime;
225 if (destructionAction == DestructionAction::Shrink) {
226 size = baseSize * destructionFactor;
227 } else if (destructionAction == DestructionAction::Fade) {
228 color.setAlphaF(destructionFactor);
229 } else if (destructionAction == DestructionAction::Image) {
230 if (!destructionSet) {
231 size = 1.0f;
232 color = Color::White;
233 type = Particle::Type::Textured;
234 image = destructionImage;
235 angularVelocity = 0.0f;
236 length = 0.0f;
237 rotation = 0.0f;
238 destructionSet = true;
239 }
240 }
241 }
242}
243
244void Particle::initializeAnimation() {
245 if (!animation) {

Callers

nothing calls this directly

Calls 1

setAlphaFMethod · 0.80

Tested by

no test coverage detected