Code Monkey home page Code Monkey logo

bevy_tickles's Introduction

Bevy Tickles

workflow

MIT licensed unsafe forbidden

CPU based Particle systems plugin for bevy inspired by Unity3D shuriken 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

Add ParticlesPlugin to your bevy App

use bevy::prelude::*;
use bevy_particles::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(ParticlesPlugin)
        .run();
}

You can then use ParticleSystemBundle 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 the example)

Components

bevy_tickles provides two kinds of components:

  • The Main Components which are part of the ParticleSystemBundle
  • The modifiers which are optional effects on the particles or the entire system

Built-in modifiers

name description
MaxParticleCount Limits the amount of particles (PERF)
MaxParticleSize Limits the size of particles
MaxParticleSpeed Limits the speed of particles
ParticleGravity Adds a custom gravity force to particles
SpeedOverTime Changes particle speed over time
VelocityOverTime Changes particle velocity over time
AngularVelocityOverTime Changes particle angular velocity (z rotation) over time
OrbitalVelocityOverLifeTime Changes the particle velocity around the center over its lifetime
LinearVelocityOverLifeTime Changes the particle velocity linearly over its lifetime
SizeOverTime Changes particle size over time
SizeOverSpeed Changes particle size over its speed
RotationOverVelocity Rotates particles according to its velocity and direction
RotationOverTime Rotates particles over time
ColorOverLifeTime Sets color of a particle over time using a color gradient
ColorOverSpeed Sets color of a particle over its using a color gradient
PerlinNoise Uses a perlin noise to change particle velocity/Size/Rotation

Common mistakes

  • Rotating and scaling the particle system entity's Transform is often a bad idea, prefer using the ParticleEmitter::transform field.
  • Using conflicting modifers like ColorOverLifetime/ColorOverSpeed or SizeOverTime/SizeOverSpeed can lead to unexpected behaviors

Cargo Features

  1. inspector

This feature enables bevy_inspector_egui integration, allowing dynamic customization of your particle systems

Examples

  1. Basic example

Run with cargo run --example basic_example --features inspector

Alt

  1. Animated example

Run with cargo run --example animated_example --features inspector

Alt

  1. Explosion example

Run with cargo run --example explosion_example --features inspector

Alt

  1. Mesh example

Run with cargo 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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.