-
-
Notifications
You must be signed in to change notification settings - Fork 291
Emitter mapping #567
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
Merged
Merged
Emitter mapping #567
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nd buffer and assignment logic Next up, prepare details from graphics.defineEffect()
…from Program Slight redesign of TimeTransform with caching (to synchronize multiple invocations with a frame) and slightly less heavyweight call site
Err, was calling Modulo for sine method, heh That said, time transform seems to work in basic test
Fixed error detection for positive number time transform inputs Relaxed amplitude positivity requirement
Maintenance Revert Test
My mistake adding back changes made
This reverts commit 0b5e1e9.
…so affects rotation)
Shchvova
approved these changes
Jun 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current behavior of emitters, given their
particleSize
, is to literally emit particles of that size, even if they or their parents have non-1 scale factors.The problem: the particle center is transformed, but the edges of the particle geometry are found by doing raw displacements by the size from the new position.
By also transforming the positions one unit to the right and one unit below the center, respectively, we can find displacements that honor the scale (and rotation, for that matter).
This PR adds several "remap" options, depending on whether you want uniform particles:
"rescale"
: the default; use the raw transformed results"rescaleX"
: find the displacement to the right; the vertical displacement is a 90-degree rotation"rescaleY"
: the other way around"rescaleMin"
: use the shorter displacement; rotate it 90 degrees to find its partner"rescaleMax"
: similar, but use the longer one"rescaleMean"
: displacements are the same length, using the averageThe current policy is on by default. You can use
display.setDefault("emitterMapping", option)
(with one of the above, or"legacy"
to restore the original) and it will use it when you calldisplay.newEmitter()
. You can also pass one of those todisplay.newEmitter()
via the emitterMapping param, and it will use that instead.