MCPcopy Create free account
hub / github.com/defold/defold / NonZeroVector3

Function NonZeroVector3

engine/particle/src/particle.cpp:1481–1489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1479 }
1480
1481 static Vector3 NonZeroVector3(Vector3 v, float sq_length, Vector3 fallback)
1482 {
1483 Vector3 result;
1484 float neg_sq_length = -sq_length;
1485 result.setX(dmMath::Select(neg_sq_length, fallback.getX(), v.getX()));
1486 result.setY(dmMath::Select(neg_sq_length, fallback.getY(), v.getY()));
1487 result.setZ(dmMath::Select(neg_sq_length, fallback.getZ(), v.getZ()));
1488 return result;
1489 }
1490
1491 void ApplyRadial(dmArray<Particle>& particles, Property* modifier_properties, const Point3& position, float scale, float emitter_t, float dt)
1492 {

Callers 2

ApplyRadialFunction · 0.85
ApplyVortexFunction · 0.85

Calls 7

setZMethod · 0.80
SelectFunction · 0.50
setXMethod · 0.45
getXMethod · 0.45
setYMethod · 0.45
getYMethod · 0.45
getZMethod · 0.45

Tested by

no test coverage detected