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

using "isSphere" requires three.js version compatibility bump to r160 #515

Open
gouldingken opened this issue Jun 8, 2024 · 3 comments
Open

Comments

@gouldingken
Copy link

Describe the bug

https://github.com/yomotsu/camera-controls/blob/dev/src/CameraControls.ts#L1987

A recent update using "isSphere" instead of instanceof to check the type of a sphere object is causing runtime errors with older three.js (because isSphere is a recent addition: mrdoob/three.js#27395)

Using this property, CameraControls should now specify three.js >= r160 (https://github.com/mrdoob/three.js/releases/tag/r160)

This seems like a minor reason to require a big version dependency bump, so maybe an alternative would be to use a hybrid solution (instanceof if isSphere is missing?)

#510

To Reproduce

Steps to reproduce the behavior:
Use fitToSphere function with three.js before r160

Code

No response

Live example

No response

Expected behavior

no errors, function runs as normal with older three.js OR version requirement bump in package.json

Screenshots or Video

No response

Device

No response

OS

No response

Browser

No response

@gouldingken
Copy link
Author

One point of clarification: it's the peerDependency requirement (devDependency is already newer)

Dev:
"three": "^0.161.0",

"peerDependencies": {
"three": ">=0.126.1" <== this needs to be >= 0.160.0
},

@yomotsu
Copy link
Owner

yomotsu commented Jun 11, 2024

Thank you for pointing that out.
Your corrections are accurate.

I will update the peerDeps version to r160, or should we support older version...?

@yomotsu yomotsu mentioned this issue Jun 12, 2024
@yomotsu
Copy link
Owner

yomotsu commented Jun 12, 2024

The solution is to check const isObject3D = 'isObject3D' in sphereOrMesh rather than isSphere.
fixed with #517

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

No branches or pull requests

2 participants