playcanvas / playcanvas/engine

Particle Emitter Circle Shape

Open
#2,269 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: particles enhancement
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Hi guys, here I come with a new feature request por the particle emitter.

It's basically a Circle Shape, which means Y axis is capped to 0, particles would spawn on the x&z axis but not on the vertical one. This can be sorta done by using a box/shape shape with the emitter extents/radius set to 0 and just increment the particles velocity on x&z, but when you need to use the emitterRadiusInner to make particles spawn away from the center, they are allowed to spawn along the vertical axis as well, so if you want to prevent them from doing so, it's not possible.

This would be useful to create many effects that need to show up at "ground" level, imagine an explosion shockwave, or a rocket before it takes off, etc.

I've tweaked around with the engine code but I've got stuck as even though i've been capable of restricting the vertical position & velocity with a new circle shape, for some reason the particle emitter gets rotated when the camera changes orientation, something to do with the matrices.

Here's a modified snow particle example showcasing the thing: http://sakigames.com/playcanvas/examples/graphics/particles-snow-circle.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the particle emitter's shape handling and reviewing the linked snow particle example. Verify how the proposed circle shape uses the x and z axes, including emitterRadiusInner, while keeping position and velocity stable as the camera orientation changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.