Skip to content

protected members in Pass -> public #391

@alexpineda

Description

@alexpineda

In my project I re-use passes and effects with different cameras and with the new types (Thank You!) I'm having to // @ts-ignore the assignment since they are protected. Would it be acceptable to have these fields public? Alternatively I could clone the passes/effects, however it causes a pause on initial compile/upload when switching views. I could pre-render them all to upload them all at once as well to avoid the issue perhaps.

updatePostProcessingCamera(camera: Camera, renderLastPassToScreen: boolean) {
        let lastPass: any = null;

        for (const pass of this.passes) {
            // @ts-ignore
            pass.camera = camera;
            pass.renderToScreen = false;
            if (pass.enabled) {
                lastPass = pass;
            }
        }
        lastPass.renderToScreen = renderLastPassToScreen;

        // some effects have cameras eg. DepthOfFieldEffect
        for (const effect of this.effects) {
            // @ts-ignore
            if (effect.camera) {
                // @ts-ignore
                effect.camera = camera;
            }
        }

    }
    ```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions