Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Particle Systems in bevy

License

NotificationsYou must be signed in to change notification settings

ManevilleF/bevy_tickles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workflow

MIT licensedunsafe forbidden

CPU based Particle systems plugin forbevy inspired byUnity3Dshuriken particle system.

This is a work in progress with many missing features, it is not suitable for production.As this lib is in very early stage, expect the API to change often

Usage

AddParticlesPlugin to your bevyApp

use bevy::prelude::*;use bevy_particles::prelude::*;fnmain(){App::new().add_plugins(DefaultPlugins).add_plugin(ParticlesPlugin).run();}

You can then useParticleSystemBundle to spawn particle systems.

Note: The particle modifiers are not included in the bundle,insert the modifiers you want to the particle system entity. (See theexample)

Components

bevy_tickles provides two kinds of components:

  • TheMain Components which are part of theParticleSystemBundle
  • Themodifiers which are optional effects on the particles or the entire system

Built-in modifiers

namedescription
MaxParticleCountLimits the amount of particles (PERF)
MaxParticleSizeLimits the size of particles
MaxParticleSpeedLimits the speed of particles
ParticleGravityAdds a custom gravity force to particles
SpeedOverTimeChanges particle speed over time
VelocityOverTimeChanges particle velocity over time
AngularVelocityOverTimeChanges particle angular velocity (z rotation) over time
OrbitalVelocityOverLifeTimeChanges the particle velocity around the center over its lifetime
LinearVelocityOverLifeTimeChanges the particle velocity linearly over its lifetime
SizeOverTimeChanges particle size over time
SizeOverSpeedChanges particle size over its speed
RotationOverVelocityRotates particles according to its velocity and direction
RotationOverTimeRotates particles over time
ColorOverLifeTimeSets color of a particle over time using a color gradient
ColorOverSpeedSets color of a particle over its using a color gradient
PerlinNoiseUses a perlin noise to change particle velocity/Size/Rotation

Common mistakes

  • Rotating and scaling the particle system entity'sTransform is often a bad idea, prefer using theParticleEmitter::transform field.
  • Using conflicting modifers likeColorOverLifetime/ColorOverSpeed orSizeOverTime/SizeOverSpeed can lead to unexpected behaviors

Cargo Features

  1. inspector

This feature enablesbevy_inspector_egui integration, allowing dynamic customization of your particle systems

Examples

  1. Basic example

Run withcargo run --example basic_example --features inspector

Alt

  1. Animated example

Run withcargo run --example animated_example --features inspector

Alt

  1. Explosion example

Run withcargo run --example explosion_example --features inspector

Alt

  1. Mesh example

Run withcargo run --example mesh_example --features inspector

Alt

TODO:

  • computed visibility with AAB
  • Duration/Looping/Infinite particle emission
  • Complete modifier list
  • Sub Emitters and callbacks (trails/death)
  • Curves
  • Color gradients
  • Multi camera support
  • Lit particles
  • Perlin noise
  • Spread emission
  • Emission Stop/Pause behaviors
  • particle stretching
  • examples of classic particle systems:
    • Fire
    • Explosion
    • Mesh emission
    • Sci Fi Shield

Contributions welcome !

Similar projects:

About

Particle Systems in bevy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp