-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Core: Convert Object3D and EventDispatcher to ES6 classes. #21646
Conversation
|
Thanks! |
@Mugen87 do you still remember what prompted this change https://github.com/mrdoob/three.js/blob/master/src/core/Object3D.js#L66-L94 const v = new THREE.Vector3()
const m = new THREE.Mesh()
m.position = v the request we got was that people want to wire up their own objects which they can then control outside of the class. but it seems these props can't get overwritten any longer. looks like some props are non-replaceable while some others are (matrix, layers). could this block be removed so that all props can be driven externally? |
It was a bad practice. People did this a lot: mesh.position = new THREE.Vector3(1,1,1) Instead of mesh.position.set(1,1,1) And they would do that in loops and would create a lot of garbage. That pattern also broke |
for reference pmndrs/react-three-fiber#1419 they want to drive matrix externally, which is similar, |
It definitely is discouraged. |
understood. im glad i opted for .copy for |
Related issue: -
Description
Converts the remaining two class in the
src/core
folder.