-
Notifications
You must be signed in to change notification settings - Fork 372
AF Manager class for dynamic animation frame request/cancel #1407
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
Open
phoenixbf
wants to merge
18
commits into
NASA-AMMOS:master
Choose a base branch
from
phoenixbf:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+224
−8
Open
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
74aed37
AFManager class for dynamic animation frame request/cancel
phoenixbf 59e1230
Merge branch 'NASA-AMMOS:master' into master
phoenixbf eafb6b7
spacing
phoenixbf e4b313f
spacing
phoenixbf ecffd60
rename class
phoenixbf a7fb47b
Merge branch 'NASA-AMMOS:master' into master
phoenixbf 0cf8ae5
Add pending AF management
phoenixbf 3fa5aae
minor comment
phoenixbf 6079607
Merge branch 'NASA-AMMOS:master' into master
phoenixbf f6eb5eb
spacing
phoenixbf d78ab44
FrameScheduler referenced by LRUCache,PriorityQueue, throttle and Que…
phoenixbf f8ab031
camel casing; intialization in LRU, PriorityQueue and QueryManager
phoenixbf edeab4b
Merge branch 'NASA-AMMOS:master' into master
phoenixbf 743dc61
- replace "removeXRSession" with "setXRSession( null )"
gkjohnson c3c0051
Add tests for FrameScheduler
gkjohnson 72e0260
small cleanup
gkjohnson ca0a22f
comment
gkjohnson c65fbc7
variable rename
gkjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| class AFManager { | ||
|
|
||
| constructor() { | ||
|
|
||
| // XR session | ||
| this.xrsession = null; | ||
|
|
||
| } | ||
|
|
||
| // Set active XR session | ||
| setXRSession( xrsession ) { | ||
|
|
||
| this.xrsession = xrsession; | ||
|
|
||
| } | ||
|
|
||
| removeXRSession() { | ||
|
|
||
| this.xrsession = null; | ||
|
|
||
| } | ||
|
|
||
| // Request animation frame (defer to XR session if present) | ||
| requestAnimationFrame( cb ) { | ||
|
|
||
| if ( ! this.xrsession ) return window.requestAnimationFrame( cb ); | ||
|
|
||
| return this.xrsession.requestAnimationFrame( cb ); | ||
|
|
||
| }; | ||
|
|
||
| // Cancel animation frame via handle (defer to XR session if present) | ||
| cancelAnimationFrame( handle ) { | ||
|
|
||
| if ( ! this.xrsession ) window.cancelAnimationFrame( handle ); | ||
|
|
||
| else this.xrsession.cancelAnimationFrame( handle ); | ||
|
|
||
| } | ||
|
|
||
| } | ||
|
|
||
| export { AFManager }; | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets call this
FrameSchedulerfor now.