Closed spydon closed 1 year ago
@spydon I think this is not the optimal solution. I think we should look into providing something to the "world" that changes the defaults of Defs.
For example, in my use case, it makes sense to have Friction to 0. It becomes redundant always setting the friction to 0. I imagine, for you, this is the same but with 0.2. This reminds me of this.
The defaults change from use case to use case so I believe instead of changing these there should be a global default that the user can override for convenience.
Wdyt?
@spydon I think this is not the optimal solution. I think we should look into providing something to the "world" that changes the defaults of Defs.
Yeah, that sounds like a good idea.
For example, in my use case, it makes sense to have Friction to 0. It becomes redundant always setting the friction to 0. I imagine, for you, this is the same but with 0.2.
I think that use case is much less common than having some friction though? Just like in the real world.
This reminds me of this.
Haha at least we can see each other painting.
@spydon would you like to work on these generic defaults? Or shall I try investigating the possibilities of this?
@spydon would you like to work on these generic defaults? Or shall I try investigating the possibilities of this?
Missed your comment here, please go ahead if you have time! :)
@spydon the only solutions I can think of are:
merge
method and the user can have a global fixtureDefNone of these ideas convince me yet. If I can think of other solutions I let you know.
If we already plan to remove Def
this is not a major concern for me.
The solution I like the most is encouraging developers to subclass, so instead of FixtureDef
they can use FooFixtureDef
. So for example, in pinball, it would be PinballFixtureDef
over FixtureDef
and the subclass sets some defaults accordingly to the desired outcome.
Let me know from the above solutions which one you prefer.
Description
In #54 the friction was set to 0, but I realized it is much more useful to have it set to some value like 0.2 that gives a more wanted result in most of the time (since everything obviously just slides around with 0).
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.Breaking Change
Related Issues