Closed jeromeetienne closed 9 years ago
That's precisely the point: basic classes in the THREE object are created in order of inheritance, so -for example- THREE.Mesh inherits from THREE.Object3D. That means that when iterating through all THREE properties that are functions, Mesh is defined after Object3D is defined. If I push in the natural order of constructors to identify the type, it's going to match Object3D before Mesh. Adding constructors in reverse order (using .unshift() ) makes sure I'll always match the most inherited type, instead of the most basic type.
It's far from black magic, but adding a comment to the function would definitely help.
thanks for the explaination! it was black magick to me :)
have you read your twitter pm recently
you are still mistifying me on this
.unshift()
:) if i put.push
here, all objects are reported asObject3D
instead...what is the black magic ?