Skip to content

Environment should not use hard coded defaults #220

@marklundin

Description

@marklundin

The Environment component contains hardcoded defaults to app.scene properties. This should be more generic as any changes to the engine defaults will require downstream changes. Meaning that adding and removing the component would not return to the initial state. Ideally the defaults could be inferred from the engine directly.

/**
* We have hardcoded the default values for the scene and sky in order to reset them
*
* This isn't perfect as any changes the the engine defaults will break this.
* TODO: Find a better way to reset the scene and sky.
*/
app.scene.exposure = 1;
app.scene.skyboxRotation = new Quat().setFromEulerAngles(0, 0, 0);
app.scene.sky.node.setLocalScale(1, 1, 1);
app.scene.sky.node.setLocalPosition(0, 0, 0);
app.scene.sky.center.set(0, 0.05, 0);
app.scene.sky.type = SKYTYPE_INFINITE;
app.scene.sky.depthWrite = false;
app.scene.skyboxMip = 0;
app.scene.skyboxLuminance = 0;
app.scene.skyboxIntensity = 1;
app.scene.skyboxHighlightMultiplier = 1;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions