Skip to content

CSM constructor cannot take null parameters #25956

@bplu4t2f

Description

@bplu4t2f

Description

The CSM constructor in the cascaded shadowmap addon is written as if a null (or undefined) parameter object is a valid use case:

https://github.com/mrdoob/three.js/blob/dev/examples/jsm/csm/CSM.js#L27

However, in practice this will just lead to a null dereference a few lines later in the code:

https://github.com/mrdoob/three.js/blob/dev/examples/jsm/csm/CSM.js#L69

Either it should allow a null (or undefined) parameter, or it should fail early and not pretend that it works at first, thus obfuscating the actual problem.

I don't know which of the two matches the API design philosophy in this project.

Reproduction steps

new CSM()

Code

not applicable

Live example

not applicable

Screenshots

No response

Version

r151

Device

No response

Browser

No response

OS

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions