@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
2 lines (1 loc) • 932 B
JavaScript
var n="\nuniform mat3 spawnBounds;\nuniform float spawnBoundsSphere;\nuniform float spawnBoundsSphereInnerRatio;\nuniform float spawnBoundsLength;\nuniform float spawnBoundsLengthInnerRatio;\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\tfloat rnd4 = fract(rndFactor * 1000.0);\n\tvec2 norm = normalize(inBounds.xy - vec2(0.5));\n\tfloat r = rnd4 * (1.0 - spawnBoundsSphereInnerRatio) + spawnBoundsSphereInnerRatio;\n\tfloat l = inBounds.z * (1.0 - spawnBoundsLengthInnerRatio) + spawnBoundsLengthInnerRatio;\n#ifndef LOCAL_SPACE\n\treturn emitterPos + spawnBounds * vec3(norm * r * l * spawnBoundsSphere, (l - 0.5) * spawnBoundsLength);\n#else\n\treturn spawnBounds * vec3(norm * r * l * spawnBoundsSphere, (l - 0.5) * spawnBoundsLength);\n#endif\n}\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\tlocalVelocity += normalize(inBounds - vec3(0.5)) * initialVelocity;\n}\n";export{n as default};