Draft: Feature/wheel terrain - #202
Conversation
… for checking friction type
…a ScriptableAsset
FilipAlg
left a comment
There was a problem hiding this comment.
Seems to work for the most part. The main thing that's missing is enable/disable support and test. Other than that and the crash that we've discussed, most of the comments is general cleanup.
On a higher level, I'm curious whether we should create default contact materials for all Wheel<>Terrain pairs in a scene automatically. Since the actual contact material configuration is minimal this should be pretty simple and could ease scene setup quite a bit. Not needed for this MR but I would be interested to hear your opinion on this.
| /// </summary> | ||
| [SerializeField] | ||
| [FormerlySerializedAs( "WarnIfNotUsingCorrectForceModel" )] | ||
| private bool m_warnIfNotUsingCorrectForceModel = false; |
There was a problem hiding this comment.
Should this be true by default? Does the component still work by default when the force model is not set correctly?
There was a problem hiding this comment.
I guess in that case we might wanna do the logging only once per run (and contact material?) as well
There was a problem hiding this comment.
No, if not using the correct contact model the friction will be partly using TerrainWheel but mostly rely on "legacy" contacts / terrain mechanics. Open for opinions on what's the desired case but I think generally we allow the user to set up components incorrectly but give hints when mistakes likely have been made. This is such a hint, which is meant to be toggled on when doing debugging rather than proactively telling the user they made a mistake. I.e. this way (default off, continuous warnings) is by design, do you disagree?
There was a problem hiding this comment.
I think we are more likely to receive support tickets about the terrain wheel model "not working" if we do not proactively warn the user about not using the model "as intended". I think its better to warn once on play and have the user opt out of warnings if they truly wish to use this component without the intended contact model.
| base.OnEnable(); | ||
| } | ||
|
|
||
| protected override void OnDisable() |
There was a problem hiding this comment.
OnDisable & OnEnable need to be implemented
There was a problem hiding this comment.
What do you want there?
There was a problem hiding this comment.
I would expect a disabled component to have the cylinder act as a regular cylinder geometry instead of a terrain wheel. I guess that might entail removing the terrain wheel from the simulation if the underlying model does not support enable/disable.
Introduce GUI for DeformableTerrainWheel and related DeformableTerrainMaterial properties.