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

Exposed Scene.sky properties #7041

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ export { shaderChunks } from './scene/shader-lib/chunks/chunks.js';
export { shaderChunksLightmapper } from './scene/shader-lib/chunks/chunks-lightmapper.js';
export { ChunkBuilder } from './scene/shader-lib/chunk-builder.js'; // used by shed

// SCENE / SKY
export { Sky } from './scene/skybox/sky.js';

// SCENE / SPLAT
export { GSplatData } from './scene/gsplat/gsplat-data.js';
export { GSplat } from './scene/gsplat/gsplat.js';
Expand Down
5 changes: 5 additions & 0 deletions src/scene/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ class Scene extends EventHandler {
return this._layers;
}

/**
* Gets the {@link Sky} that defines sky properties.
*
* @type {Sky}
*/
get sky() {
return this._sky;
}
Expand Down
7 changes: 4 additions & 3 deletions src/scene/skybox/sky.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Sky {
* Constructs a new sky.
*
* @param {Scene} scene - The scene owning the sky.
* @ignore
*/
constructor(scene) {
this.device = scene.device;
Expand All @@ -76,9 +77,9 @@ class Sky {
* The type of the sky. One of the SKYMESH_* constants. Defaults to {@link SKYTYPE_INFINITE}.
* Can be:
*
* {@link SKYTYPE_INFINITE}
* {@link SKYTYPE_BOX}
* {@link SKYTYPE_DOME}
* - {@link SKYTYPE_INFINITE}
* - {@link SKYTYPE_BOX}
* - {@link SKYTYPE_DOME}
*
* @type {string}
*/
Expand Down