Link Search Menu Expand Document

arena-py API v0.9.6

arena.attributes.spe_particles

SpeParticles attribute class to manage its properties in the ARENA: GPU based particle systems in A-Frame. More properties at https://github.com/harlyq/aframe-spe-particles-component A-Frame SPE Particles component. Usage: spe_particles=SpeParticles(...)

Parameters
  • dict acceleration: For sphere and disc distributions, only the x axis is used. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • str accelerationDistribution: Distribution of particle acceleration, for disc and sphere, only the x component will be used. if set to NONE use the 'distribution' attribute for accelerationDistribution. Allows [none, box, sphere, disc] Defaults to 'none' (optional)
  • dict accelerationSpread: Spread of the particle's acceleration. for sphere and disc distributions, only the x axis is used. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • float activeMultiplier: Multiply the rate of particles emission, if larger than 1 then the particles will be emitted in bursts. note, very large numbers will emit all particles at once. Defaults to '1' (optional)
  • bool affectedByFog: If true, the particles are affected by THREE js fog. Defaults to 'True' (optional)
  • float alphaTest: Alpha values below the alphaTest threshold are considered invisible. Defaults to '0' (optional)
  • list[float] angle: 2D rotation of the particle over the particle's lifetime, max 4 elements. Defaults to '[0]' (optional)
  • list[float] angleSpread: Spread in angle over the particle's lifetime, max 4 elements. Defaults to '[0]' (optional)
  • str blending: Blending mode, when drawing particles. Allows [no, normal, additive, subtractive, multiply, custom] Defaults to 'normal' (optional)
  • list[str] color: Array of colors over the particle's lifetime, max 4 elements. Defaults to '['#fff']' (optional)
  • list[dict] colorSpread: Spread to apply to colors, spread an array of vec3 (r g b) with 0 for no spread. note the spread will be re-applied through-out the lifetime of the particle. (optional)
  • bool depthTest: If true, don't render a particle's pixels if something is closer in the depth buffer. Defaults to 'True' (optional)
  • bool depthWrite: If true, particles write their depth into the depth buffer. this should be false if we use transparent particles. (optional)
  • str direction: Make the emitter operate forward or backward in time. Allows [forward, backward] Defaults to 'forward' (optional)
  • str distribution: Distribution for particle positions, velocities and acceleration. will be overridden by specific '...Distribution' attributes. Allows [box, sphere, disc] Defaults to 'box' (optional)
  • float drag: Apply resistance to moving the particle, 0 is no resistance, 1 is full resistance, particle will stop moving at half of it's maxAge. Defaults to '0' (optional)
  • float dragSpread: Spread to apply to the drag attribute. Defaults to '0' (optional)
  • float duration: Duration of the emitter (seconds), if less than 0 then continuously emit particles. Defaults to '-1' (optional)
  • float emitterScale: Global scaling factor for all particles from the emitter. Defaults to '100' (optional)
  • bool enableInEditor: Enable the emitter while the editor is active (i.e. while scene is paused). (optional)
  • bool enabled: Enable/disable the emitter. Defaults to 'True' (optional)
  • bool frustumCulled: Enable/disable frustum culling. (optional)
  • bool hasPerspective: If true, particles will be larger the closer they are to the camera. Defaults to 'True' (optional)
  • float maxAge: Maximum age of a particle before reusing. Defaults to '1' (optional)
  • float maxAgeSpread: Variance for the 'maxAge' attribute. Defaults to '0' (optional)
  • list[float] opacity: Opacity over the particle's lifetime, max 4 elements. Defaults to '[1]' (optional)
  • list[float] opacitySpread: Spread in opacity over the particle's lifetime, max 4 elements. Defaults to '[0]' (optional)
  • int particleCount: Maximum number of particles for this emitter. Defaults to '100' (optional)
  • str positionDistribution: Distribution of particle positions, disc and sphere will use the radius attributes. For box particles emit at 0,0,0, for sphere they emit on the surface of the sphere and for disc on the edge of a 2D disc on the XY plane. Allows [none, box, sphere, disc] Defaults to 'none' (optional)
  • dict positionOffset: Fixed offset to the apply to the emitter relative to its parent entity. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • dict positionSpread: Particles are positioned within +- of these local bounds. for sphere and disc distributions only the x axis is used. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • float radius: Radius of the disc or sphere emitter (ignored for box). note radius of 0 will prevent velocity and acceleration if they use a sphere or disc distribution. Defaults to '1' (optional)
  • dict radiusScale: Scales the emitter for sphere and disc shapes to form oblongs and ellipses. Defaults to '{'x': 1, 'y': 1, 'z': 1}' (optional)
  • bool randomizeAcceleration: If true, re-randomize acceleration when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizeAngle: If true, re-randomize angle when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizeColor: If true, re-randomize colour when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizeDrag: If true, re-randomize drag when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizeOpacity: If true, re-randomize opacity when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizePosition: If true, re-randomize position when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizeRotation: If true, re-randomize rotation when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizeSize: If true, re-randomize size when re-spawning a particle, can incur a performance hit. (optional)
  • bool randomizeVelocity: If true, re-randomize velocity when re-spawning a particle, can incur a performance hit. (optional)
  • str relative: World relative particles move relative to the world, while local particles move relative to the emitter (i.e. if the emitter moves, all particles move with it). Allows [local, world] Defaults to 'local' (optional)
  • float rotation: Rotation in degrees. Defaults to '0' (optional)
  • dict rotationAxis: Local axis when using rotation. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • dict rotationAxisSpread: Variance in the axis of rotation. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • float rotationSpread: Rotation variance in degrees. Defaults to '0' (optional)
  • bool rotationStatic: If true, the particles are fixed at their initial rotation value. if false, the particle will rotate from 0 to the 'rotation' value. (optional)
  • list[float] size: Array of sizes over the particle's lifetime, max 4 elements. Defaults to '[1]' (optional)
  • list[float] sizeSpread: Spread in size over the particle's lifetime, max 4 elements. Defaults to '[0]' (optional)
  • str texture: Texture to be used for each particle, may be a spritesheet. Examples: [blob.png, fog.png, square.png, explosion_sheet.png, fireworks_sheet.png], like path 'static/images/textures/blob.png'. (optional)
  • int textureFrameCount: Number of frames in the spritesheet, negative numbers default to textureFrames.x * textureFrames.y. Defaults to '-1' (optional)
  • int textureFrameLoop: Number of times the spritesheet should be looped over the lifetime of a particle. Defaults to '1' (optional)
  • dict textureFrames: X and Y frames for a spritesheet. each particle will transition through every frame of the spritesheet over its lifetime (see textureFramesLoop). Defaults to '{'x': 1, 'y': 1}' (optional)
  • bool useTransparency: Should the particles be rendered with transparency? Defaults to 'True' (optional)
  • dict velocity: For sphere and disc distributions, only the x axis is used. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • str velocityDistribution: Distribution of particle velocities, for disc and sphere, only the x component will be used. if set to NONE use the 'distribution' attribute for velocityDistribution. Allows [none, box, sphere, disc] Defaults to 'none' (optional)
  • dict velocitySpread: Variance for the velocity. Defaults to '{'x': 0, 'y': 0, 'z': 0}' (optional)
  • float wiggle: Extra distance the particle moves over its lifetime. Defaults to '0' (optional)
  • float wiggleSpread: +- spread for the wiggle attribute. Defaults to '0' (optional)
SpeParticles(**kwargs)
class Particles(SpeParticles):

Alternate name for SpeParticles. Usage: spe_particles=Particles(...)