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

feat: 331 new context for state tino #340

Conversation

Tinoooo
Copy link
Contributor

@Tinoooo Tinoooo commented Jul 6, 2023

No description provided.

@Tinoooo Tinoooo requested a review from alvarosabu July 6, 2023 15:02
@alvarosabu alvarosabu changed the title Feature/331 new context for state tino feat: 331 new context for state tino Jul 7, 2023
@alvarosabu
Copy link
Member

alvarosabu commented Jul 7, 2023

I just pushed the DebugUI.vue component without cientos, but the page is blank, it does not render unless you force a HMR change. Same for the rest of components of the playground like TheFirstScene.vue

src/composables/useCamera/index.ts Outdated Show resolved Hide resolved
src/components/TresCanvas.vue Show resolved Hide resolved
src/components/TresCanvas.vue Outdated Show resolved Hide resolved
src/components/TresCanvas.vue Show resolved Hide resolved
src/composables/useRenderer/index.ts Outdated Show resolved Hide resolved
src/composables/useRenderer/index.ts Outdated Show resolved Hide resolved
src/composables/useRenderer/index.ts Outdated Show resolved Hide resolved
src/core/nodeOps.ts Outdated Show resolved Hide resolved
@Tinoooo
Copy link
Contributor Author

Tinoooo commented Jul 7, 2023

@alvarosabu

I just pushed the DebugUI.vue component without cientos, but the page is blank, it does not render unless you force a HMR change. Same for the rest of components of the playground like TheFirstScene.vue

I fixed this one in a7c0ada. The loop didn't start right away. Was/Is there a special necessity for it to not start immediately? Maybe I'm missing something here.

@Tinoooo
Copy link
Contributor Author

Tinoooo commented Jul 7, 2023

Mmm, we should call the loop once the renderer is created

I changed it that way 👍.

@alvarosabu
Copy link
Member

alvarosabu commented Jul 13, 2023

@Tinoooo we need to add this to the state appContext', getCurrentInstance() for the Tresjs/cientos#23 implementation

@alvarosabu
Copy link
Member

@Tinoooo at the end we don't need to add the appContext but we do need to add the 'raycaster' on the state for the HTML implementation Tresjs/cientos#23 implementation

When you have some time please check what's left on this PR?

@Tinoooo
Copy link
Contributor Author

Tinoooo commented Jul 17, 2023

@alvarosabu I am now back from vacation, so I think I can find today or in the coming days.

Copy link
Member

@alvarosabu alvarosabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elegant solution, I like it

@alvarosabu alvarosabu merged commit 2c6707c into feature/331-new-context-for-state Jul 24, 2023
@Tinoooo Tinoooo deleted the feature/331-new-context-for-state__tino branch July 24, 2023 12:01
alvarosabu added a commit that referenced this pull request Jul 29, 2023
* feat: tres context provider

* feat: useContextProvider onMounted

* feat: revert width height composables

* feat: fixed renderer watch for aspectRatio changes

* chore: clean up

* feat: refactor raycaster

* feat: 331 new context for state  tino (#340)

* feat: refactored composables; seperated logic from TresCanvas

* chore: more changes concerning renderer composable

* feat: made window size reactive

* chore: made compasable params more uniform

* chore: refactored useRenderer

* chore: type cleanup

* feat: added user data key for active cameras

* feat: made renderer constructor params reactive

* feat: made multiple cameras work

* feat: made camera handling work properly and fixed event handler problem

* feat: added option to set a camera active by it's uuid and the object itself

* chore: moved composable to composables

* chore: removed obsolete todo comments

* chore: set antialias to be true by default in TresCanvas

* chore: fix debugUI playground

* chore: pnpm lock

* chore: added localOrbitControls

* chore: made render loop start initially

* chore: changes concerning PR review

* chore: changes concerning PR review

* chore: remove camera test for now

* chore: release v2.4.0-next.4

* chore: ci update for pnpm actions

* chore: correct typo on test action name

* chore: restored reactivity of renderer composable

* chore: replaced userData handling in keys.ts by types

* chore: made tests temporarily work

* chore: disabled test temporarily

* chore: removed readonly on scene for post-processing

* chore: release v2.4.0-next.5

* chore: restored readonly on scene and removed it from renderer

* chore: release v2.4.0-next.6

* chore: fixed hmr

* chore: made usePointerEventHandler more uniform to other composables

* feat: made renderer presets have less priority than explicitly defined props

---------

Co-authored-by: Tino Koch <[email protected]>
Co-authored-by: alvarosabu <[email protected]>

* chore: release v2.4.0-next.7

* feat: remove readonly for scene on state context

* chore: release v2.4.0-next.8

* feat: add defaults props for trescanvas to match renderer ones

* chore: release v2.4.0-next.9

* feat: changed camera behavior so that the first added camera is always the active one

* chore: release v2.4.0-next.10

* docs: updated docs concerning useTresContext composable

* feat: added useTres alias for useTresContext

* chore: changed useTresContext to useTres in the docs

* chore: removed wrong dependency

* fix: fixed issue caused by merge of main

* chore: switched camera from ref to shallowRef

* chore: removed obsolete comment

* fix: revert shallorRef for cameras

---------

Co-authored-by: Tino Koch <[email protected]>
Co-authored-by: Tino Koch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants