Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radial and tangent acceleration modifiers do not use local coordinates #180

Open
NiseVoid opened this issue Apr 29, 2023 · 2 comments
Open
Labels
A - documentation Improvements or additions to documentation A - modifiers Change related to modifiers C - enhancement New feature or request

Comments

@NiseVoid
Copy link
Contributor

Crate versions
bevy version: 0.10.1
bevy_hanabi version: current main

Describe the bug
Radial and tangent acceleration modifiers do not use effect-local coordinates for center.

Expected behavior
The modifiers using local coordinates, or having a way to specify if it's local or global

To Reproduce
Place an effect with these modifiers on a non-0,0,0 coordinate.

@djeedai
Copy link
Owner

djeedai commented May 1, 2023

I think we need an option to configure. Those modifiers are acting during the update phase, and so the modifier may move and have a different origin each frame. So using effect-local coordinates means the effect origin will move with the effect, which is not the case for any other update modifier (like force field). So to that respect this is not really a bug, although there is a discrepancy between init modifiers working in local coordinates currently, and update one working in global coordinates.

@djeedai djeedai added A - documentation Improvements or additions to documentation C - enhancement New feature or request A - modifiers Change related to modifiers labels May 1, 2023
@djeedai
Copy link
Owner

djeedai commented Jul 2, 2023

Note: the new Graph API merged in #191 allows defining the exact behavior needed via the AccelModifier, as a workaround. Eventually the radial and tangent acceleration modifier will likely get removed in favor of this approach. Although I'm waiting a bit here to see how things go with the Graph API and if we need some convenience utility to avoid having to write those expression by hand.

djeedai added a commit that referenced this issue Jul 24, 2023
Add a new alternative `SimulationSpace::Local` for simulating particles
in the space defined by the `GlobalTransform` attached to the entity of
their `ParticleEffect`. This allows applying the effect's transform to
all particles after they are simulated. This is opposed to the default
global-space simulation offered by `SimulationSpace::Global` where
particles are "detached" from the effect when they spawn, and are
simulated in the global world space.

Add a new `OrientModifier` and its associated `OrientMode` enum,
allowing to orient the particles to face the camera and/or their
velocity, both when simulated in local and global space. This unified
modifier replaces both the `BillboardModifier` and the
`OrientAlongVelocityModifier`.

Bug: #180
djeedai added a commit that referenced this issue Jul 24, 2023
Add a new alternative `SimulationSpace::Local` for simulating particles
in the space defined by the `GlobalTransform` attached to the entity of
their `ParticleEffect`. This allows applying the effect's transform to
all particles after they are simulated. This is opposed to the default
global-space simulation offered by `SimulationSpace::Global` where
particles are "detached" from the effect when they spawn, and are
simulated in the global world space.

Add a new `OrientModifier` and its associated `OrientMode` enum,
allowing to orient the particles to face the camera and/or their
velocity, both when simulated in local and global space. This unified
modifier replaces both the `BillboardModifier` and the
`OrientAlongVelocityModifier`.

Bug: #180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - documentation Improvements or additions to documentation A - modifiers Change related to modifiers C - enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants