Reputation: 15776
Both:
are derived from
in both cases the source code does not add any functionality:
But only types and flag
So a Group has type group and flag isGroup=true and Bone has type bone and flag isBone=true
For my usecase I might need to have bones that are groups. That depends on the answer to:
What is the difference between Bone and Group?
The documentation says:
Group: This is almost identical to an Object3D. Its purpose is to make working with groups of objects syntactically clearer.
Bone: A bone which is part of a Skeleton. The skeleton in turn is used by the SkinnedMesh. Bones are almost identical to a blank Object3D.
Therefore both are are almost identical to ... Object3D
For Bone it is at least mentioned which parts of Three.js behave differently. For Group I'd like to know where it makes a difference whether something is a group or not. If it's only syntax than a Bone will behave exactly as a group. If some part of the Three.js code checks for isGroup or for kind being group then it would be a different story ...
How could bones that are groups be implemented using Three.js standard functions?
Would simply setting the flag "isGroup" being sufficient?
Would I have to create a BoneGroup or a GroupBone - to have both flags be set? Which naming would be more consistent with Three.js current naming conventions?
Upvotes: 1
Views: 204
Reputation: 11
I think in your case the best solution is using your Bone as Object3D because it already extends it. There are no such cases where Object3D cannot be used where Group can be except the following:
isGroup property is used internally in THREE.JS source code only once in WebGLRenderer class, projectObject function (https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js , line 1256 in the current version) and defines the rendering order for group children.
So I think it will be almost clean to use Object3D instead of Group and do not create additional classes
Upvotes: 1