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

"Nebula.System.update( delta )" affects particle position. #61

Closed
MasatoMakino opened this issue Sep 24, 2019 · 2 comments
Closed

"Nebula.System.update( delta )" affects particle position. #61

MasatoMakino opened this issue Sep 24, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@MasatoMakino
Copy link
Contributor

MasatoMakino commented Sep 24, 2019

Expected Behavior

Reproduced particle position even if System.update(delta) changes in a variable frame rate environment.

Actual Behavior

When System.update(delta) changes, the particle position not reproduced.

Steps to Reproduce the Problem

  1. get delta time from timestamp of requestAnimationFrame.
  2. Nebula.System.update( delta );
  3. If dropped frames, the position of the particles changes.

codepen

Here is the sample code.
Anyone can change the DELTA_COEFFICIENT value.

delta = 0.0167 (DEFAULT_SYSTEM_DELTA)

delta = 0.00551

Why

Nebula.Emitter.damping is not corrected by delta time.

integrate() function.

Velocity and Acceleration corrected by delta time.

In the sample code, if you change FIX_DAMPING = true, the particle positions will be reproduced.

Specifications

  • Version: three-nebula v5.0.1 + three.js r108
  • Platform: macOS 10.14.6
  • Subsystem: Google Chrome 77.0.3865.90
@rohan-deshpande
Copy link
Collaborator

rohan-deshpande commented Sep 25, 2019

Hi! Thanks very much for this issue and the codepen, I'm looking into it, cc @manthrax

@rohan-deshpande rohan-deshpande self-assigned this Sep 25, 2019
@rohan-deshpande rohan-deshpande added the bug Something isn't working label Sep 25, 2019
@rohan-deshpande
Copy link
Collaborator

Resolved by #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants