Suggestion: Add children param to Group constructor
See original GitHub issueIs your feature request related to a problem? Please describe.
When using Group
we always end up using the same pattern:
//create group
let group = new Group();
//create meshes
let m1 = new Mesh( geom, mat );
let m2 = new Mesh( geom, mat );
...
//add meshes
group.add( m1 );
group.add( m2 );
...
return group;
I think this can be simplified if Group
accepted children as parameter in constructor, as Mesh
accepts Geometry
and Material
.
Describe the solution you’d like
Using the proposed change the code would look like:
//create meshes
let m1 = new Mesh( geom, mat );
let m2 = new Mesh( geom, mat );
return new Group( [ m1, m2, ... ] );
I think Group
should accept children as parameter since its purpose is precisely that, having children. And it would simplify the code.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to pass large number of parameters to a constructor?
Solution 2 ; class Child { private ; string childblood, DateTime childdbirth ) { sname = childname; sblood = childblood; dbirth = childdbirth;...
Read more >Why default constructor is required in a parent class if it has an ...
With empty parameter list I mean the implicit super() the compiler could add if the super class had a nonparametric constructor. For example...
Read more >Best practices for AudioProcessorValueTreeState and child ...
One solution might be to create a custom ParamGroup struct that holds references to the parameters for a given group using their specific...
Read more >Constructors and Destructors - Manual - PHP
PHP allows developers to declare constructor methods for classes. Classes which have a constructor method call this method on each newly-created object, ...
Read more >Children Parameters - Android Developers
To add a children parameter to a frame or group, select the layer in Figma and click the + button next to “Parameters”,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If we do this, users could expect we change the constructor of
Bone
in the same fashion. Simply because in many cases bones do have bones as children.I think it’s better if 3D objects only accept a geometry and/or material parameter. And that’s it.
Are you aware that you can do this?
This works with an arbitrary number of arguments. Against this backdrop, I do not vote to change the API.